summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kanavin <alex@linutronix.de>2025-10-02 12:09:25 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-10-07 00:05:39 +0100
commita35a403adb8d84750fbc6b14faa6d767c8f159d9 (patch)
treef915f595ebc56f5de14947892510aa4b4a26e90b
parenta7ff0230c153e8c537172c856dc5bf8e45644fd6 (diff)
downloadpoky-a35a403adb8d84750fbc6b14faa6d767c8f159d9.tar.gz
bitbake: lib/bb/tests/setup.py: define test parameters in a single dictionary
This makes maintaining and extending them easier. (Bitbake rev: d4379bb791b8961538a4d445d5f956fafffbb0e5) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/bb/tests/setup.py10
1 files 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"]))
227 # (the latter two should do nothing and say that config hasn't changed) 227 # (the latter two should do nothing and say that config hasn't changed)
228 test_file_content = 'initial\n' 228 test_file_content = 'initial\n'
229 self.add_file_to_testrepo('test-file', test_file_content) 229 self.add_file_to_testrepo('test-file', test_file_content)
230 for cf in ('test-config-1', 'test-config-2'): 230
231 for c in ('gadget','gizmo','gadget-notemplate','gizmo-notemplate'): 231 # test-config-1 is tested as a registry config, test-config-2 as a local file
232 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)) 232 test_configurations = {'test-config-1': {'cmdline': 'test-config-1', 'buildconfigs':('gadget','gizmo','gadget-notemplate','gizmo-notemplate')},
233 'test-config-2': {'cmdline': os.path.join(self.registrypath,'config-2/test-config-2.conf.json'), 'buildconfigs': ('gadget','gizmo','gadget-notemplate','gizmo-notemplate') } }
234 for cf, v in test_configurations.items():
235 for c in v['buildconfigs']:
236 out = self.runbbsetup("init --non-interactive {} {}".format(v['cmdline'], c))
233 buildpath = os.path.join(self.tempdir, 'bitbake-builds', '{}-{}'.format(cf, c)) 237 buildpath = os.path.join(self.tempdir, 'bitbake-builds', '{}-{}'.format(cf, c))
234 with open(os.path.join(buildpath, 'config', "config-upstream.json")) as f: 238 with open(os.path.join(buildpath, 'config', "config-upstream.json")) as f:
235 config_upstream = json.load(f) 239 config_upstream = json.load(f)