From bebbf40426e4db8b15a0caa48303f2416373e867 Mon Sep 17 00:00:00 2001 From: Alexander Kanavin Date: Thu, 2 Oct 2025 12:09:25 +0200 Subject: [PATCH] bitbake: lib/bb/tests/setup.py: define test parameters in a single dictionary This makes maintaining and extending them easier. (Bitbake rev: 16dc8e3dad7dde7e7651cce13549e61574cafba1) Signed-off-by: Alexander Kanavin Signed-off-by: Richard Purdie --- bitbake/lib/bb/tests/setup.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/bitbake/lib/bb/tests/setup.py b/bitbake/lib/bb/tests/setup.py index 329a0c5259..c77e750db7 100644 --- a/bitbake/lib/bb/tests/setup.py +++ b/bitbake/lib/bb/tests/setup.py @@ -227,9 +227,13 @@ print("BBPATH is {{}}".format(os.environ["BBPATH"])) # (the latter two should do nothing and say that config hasn't changed) test_file_content = 'initial\n' self.add_file_to_testrepo('test-file', test_file_content) - for cf in ('test-config-1', 'test-config-2'): - for c in ('gadget','gizmo','gadget-notemplate','gizmo-notemplate'): - out = self.runbbsetup("init --non-interactive {} {}".format(os.path.join(self.registrypath,'config-2/test-config-2.conf.json') if cf == 'test-config-2' else cf, c)) + + # test-config-1 is tested as a registry config, test-config-2 as a local file + test_configurations = {'test-config-1': {'cmdline': 'test-config-1', 'buildconfigs':('gadget','gizmo','gadget-notemplate','gizmo-notemplate')}, + 'test-config-2': {'cmdline': os.path.join(self.registrypath,'config-2/test-config-2.conf.json'), 'buildconfigs': ('gadget','gizmo','gadget-notemplate','gizmo-notemplate') } } + for cf, v in test_configurations.items(): + for c in v['buildconfigs']: + out = self.runbbsetup("init --non-interactive {} {}".format(v['cmdline'], c)) buildpath = os.path.join(self.tempdir, 'bitbake-builds', '{}-{}'.format(cf, c)) with open(os.path.join(buildpath, 'config', "config-upstream.json")) as f: config_upstream = json.load(f)