diff options
author | Alexander Kanavin <alex@linutronix.de> | 2025-10-02 12:09:25 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-10-04 11:16:43 +0100 |
commit | d860f6ae698228c8b609cbeec1adcae3b43f9baf (patch) | |
tree | 64d48e65d9d6323c43a657ed1f43005935ff69a3 /bitbake | |
parent | ebfe946049c70d00f5ce5d34e366fefdab7a1e8a (diff) | |
download | poky-d860f6ae698228c8b609cbeec1adcae3b43f9baf.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>
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/bb/tests/setup.py | 10 |
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) |