diff options
| author | Alexander Kanavin <alex@linutronix.de> | 2025-10-02 12:09:25 +0200 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-10-14 11:24:57 +0100 |
| commit | bebbf40426e4db8b15a0caa48303f2416373e867 (patch) | |
| tree | 97561013d70133e19de0e28bba3a87cba1309e25 /bitbake | |
| parent | 0c377753492e2559c7c8b26f6b33bacc70c65ee8 (diff) | |
| download | poky-bebbf40426e4db8b15a0caa48303f2416373e867.tar.gz | |
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 <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) |
