diff mbox series

[5/7] bitbake-setup: tests: avoid repeating the list of config variants

Message ID 20260116095741.3654153-5-alex.kanavin@gmail.com
State New
Headers show
Series [1/7] bitbake-setup: pass only the registry settting into obtain_config(), not the whole settings | expand

Commit Message

Alexander Kanavin Jan. 16, 2026, 9:57 a.m. UTC
From: Alexander Kanavin <alex@linutronix.de>

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
 lib/bb/tests/setup.py | 28 +++++++---------------------
 1 file changed, 7 insertions(+), 21 deletions(-)
diff mbox series

Patch

diff --git a/lib/bb/tests/setup.py b/lib/bb/tests/setup.py
index 802f017fb..ef331c8a2 100644
--- a/lib/bb/tests/setup.py
+++ b/lib/bb/tests/setup.py
@@ -324,17 +324,12 @@  print("BBPATH is {{}}".format(os.environ["BBPATH"]))
         self.add_file_to_testrepo('test-file', test_file_content)
 
         # test-config-1 is tested as a registry config, test-config-2 as a local file
+        variants = ('gadget','gizmo','gizmo-env-passthrough','gizmo-no-fragment','gadget-notemplate','gizmo-notemplate')
+        variants_local = variants + ('gizmo-notemplate-with-filerelative-layers',)
         test_configurations = {'test-config-1': {'cmdline': 'test-config-1',
-                                                 'buildconfigs':('gadget','gizmo',
-                                                                 'gizmo-env-passthrough',
-                                                                 'gizmo-no-fragment',
-                                                                 'gadget-notemplate','gizmo-notemplate')},
+                                                 'buildconfigs': variants},
                                'test-config-2': {'cmdline': os.path.join(self.registrypath,'config-2/test-config-2.conf.json'),
-                                                 'buildconfigs': ('gadget','gizmo',
-                                                                  'gizmo-env-passthrough',
-                                                                  'gizmo-no-fragment',
-                                                                  'gadget-notemplate','gizmo-notemplate',
-                                                                  'gizmo-notemplate-with-filerelative-layers')}
+                                                 'buildconfigs': variants_local}
                                }
         for cf, v in test_configurations.items():
             for c in v['buildconfigs']:
@@ -352,10 +347,7 @@  print("BBPATH is {{}}".format(os.environ["BBPATH"]))
         prev_test_file_content = test_file_content
         test_file_content = 'modified\n'
         self.add_file_to_testrepo('test-file', test_file_content)
-        for c in ('gadget', 'gizmo',
-                  'gizmo-env-passthrough',
-                  'gizmo-no-fragment',
-                  'gadget-notemplate', 'gizmo-notemplate'):
+        for c in variants:
             setuppath = self.get_setup_path('test-config-1', c)
             os.environ['BBPATH'] = os.path.join(setuppath, 'build')
             out = self.runbbsetup("status")
@@ -375,10 +367,7 @@  print("BBPATH is {{}}".format(os.environ["BBPATH"]))
         self.git('checkout -b {}'.format(branch), cwd=self.testrepopath)
         self.add_file_to_testrepo('test-file', test_file_content)
         json_1 = self.add_json_config_to_registry('test-config-1.conf.json', branch, branch)
-        for c in ('gadget', 'gizmo',
-                  'gizmo-env-passthrough',
-                  'gizmo-no-fragment',
-                  'gadget-notemplate', 'gizmo-notemplate'):
+        for c in variants:
             setuppath = self.get_setup_path('test-config-1', c)
             os.environ['BBPATH'] = os.path.join(setuppath, 'build')
             out = self.runbbsetup("status")
@@ -408,10 +397,7 @@  print("BBPATH is {{}}".format(os.environ["BBPATH"]))
         self.git('checkout -b {}'.format(branch), cwd=self.testrepopath)
         self.add_file_to_testrepo('test-file', test_file_content)
         json_1 = self.add_json_config_to_registry('test-config-1.conf.json', branch, branch)
-        for c in ('gadget', 'gizmo',
-                  'gizmo-env-passthrough',
-                  'gizmo-no-fragment',
-                  'gadget-notemplate', 'gizmo-notemplate'):
+        for c in variants:
             setuppath = self.get_setup_path('test-config-1', c)
             os.environ['BBPATH'] = os.path.join(setuppath, 'build')
             # write something in local.conf and bblayers.conf