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