diff options
| -rw-r--r-- | meta/lib/oeqa/sdk/testmetaidesupport.py | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/meta/lib/oeqa/sdk/testmetaidesupport.py b/meta/lib/oeqa/sdk/testmetaidesupport.py new file mode 100644 index 0000000000..2ff76fd8e0 --- /dev/null +++ b/meta/lib/oeqa/sdk/testmetaidesupport.py | |||
| @@ -0,0 +1,43 @@ | |||
| 1 | # | ||
| 2 | # SPDX-License-Identifier: MIT | ||
| 3 | # | ||
| 4 | |||
| 5 | class TestSDK(object): | ||
| 6 | def run(self, d): | ||
| 7 | import json | ||
| 8 | import logging | ||
| 9 | from oeqa.sdk.context import OESDKTestContext, OESDKTestContextExecutor | ||
| 10 | from oeqa.utils import make_logger_bitbake_compatible | ||
| 11 | |||
| 12 | pn = d.getVar("PN") | ||
| 13 | |||
| 14 | logger = make_logger_bitbake_compatible(logging.getLogger("BitBake")) | ||
| 15 | |||
| 16 | sdk_dir = d.expand("${WORKDIR}/testsdk/") | ||
| 17 | bb.utils.remove(sdk_dir, True) | ||
| 18 | bb.utils.mkdirhier(sdk_dir) | ||
| 19 | |||
| 20 | sdk_envs = OESDKTestContextExecutor._get_sdk_environs(d.getVar("DEPLOY_DIR_IMAGE")) | ||
| 21 | tdname = d.expand("${DEPLOY_DIR_IMAGE}/${PN}.testdata.json") | ||
| 22 | test_data = json.load(open(tdname, "r")) | ||
| 23 | |||
| 24 | host_pkg_manifest = {"cmake-native":"", "gcc-cross":"", "gettext-native":"", "meson-native":"", "perl-native":"", "python3-core-native":"", } | ||
| 25 | target_pkg_manifest = {"gtk+3":""} | ||
| 26 | |||
| 27 | for s in sdk_envs: | ||
| 28 | bb.plain("meta-ide-support based SDK testing environment: %s" % s) | ||
| 29 | |||
| 30 | sdk_env = sdk_envs[s] | ||
| 31 | |||
| 32 | tc = OESDKTestContext(td=test_data, logger=logger, sdk_dir=sdk_dir, | ||
| 33 | sdk_env=sdk_env, target_pkg_manifest=target_pkg_manifest, | ||
| 34 | host_pkg_manifest=host_pkg_manifest) | ||
| 35 | |||
| 36 | tc.loadTests(OESDKTestContextExecutor.default_cases) | ||
| 37 | |||
| 38 | results = tc.runTests() | ||
| 39 | if results: | ||
| 40 | results.logSummary(pn) | ||
| 41 | |||
| 42 | if (not results) or (not results.wasSuccessful()): | ||
| 43 | bb.fatal('%s - FAILED' % (pn,), forcelog=True) | ||
