diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-07-13 15:23:54 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-07-16 21:26:15 +0100 |
commit | 07d19fb3adab7a8d83ba83d9a16395f70d7b7a47 (patch) | |
tree | 728cca6b5eb3f0d48e3c83d4d2147c8c71d98b91 | |
parent | 8001d933a8dc86004db014777f094d718086687d (diff) | |
download | openembedded-core-07d19fb3adab7a8d83ba83d9a16395f70d7b7a47.tar.gz openembedded-core-07d19fb3adab7a8d83ba83d9a16395f70d7b7a47.tar.bz2 openembedded-core-07d19fb3adab7a8d83ba83d9a16395f70d7b7a47.zip |
testsdk: Enable multiprocess execution
This uses the new concurrenttest code to enable parallel test execution
if specified.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/classes/testsdk.bbclass | 7 | ||||
-rw-r--r-- | meta/lib/oeqa/sdk/context.py | 4 |
2 files changed, 10 insertions, 1 deletions
diff --git a/meta/classes/testsdk.bbclass b/meta/classes/testsdk.bbclass index 2b5d66b193..5df17bfa9e 100644 --- a/meta/classes/testsdk.bbclass +++ b/meta/classes/testsdk.bbclass @@ -42,6 +42,8 @@ def testsdk_main(d): host_pkg_manifest = OESDKTestContextExecutor._load_manifest( d.expand("${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.host.manifest")) + processes = d.getVar("TESTIMAGE_NUMBER_THREADS") or d.getVar("BB_NUMBER_THREADS") + sdk_dir = d.expand("${WORKDIR}/testimage-sdk/") bb.utils.remove(sdk_dir, True) bb.utils.mkdirhier(sdk_dir) @@ -65,7 +67,10 @@ def testsdk_main(d): import traceback bb.fatal("Loading tests failed:\n%s" % traceback.format_exc()) - result = tc.runTests() + if processes: + result = tc.runTests(processes=int(processes)) + else: + result = tc.runTests() component = "%s %s" % (pn, OESDKTestContextExecutor.name) context_msg = "%s:%s" % (os.path.basename(tcname), os.path.basename(sdk_env)) diff --git a/meta/lib/oeqa/sdk/context.py b/meta/lib/oeqa/sdk/context.py index 82e4c19bfc..7c091c0534 100644 --- a/meta/lib/oeqa/sdk/context.py +++ b/meta/lib/oeqa/sdk/context.py @@ -65,6 +65,9 @@ class OESDKTestContextExecutor(OETestContextExecutor): sdk_rgroup.add_argument('--sdk-dir', required=False, action='store', help='sdk installed directory') + self.parser.add_argument('-j', '--num-processes', dest='processes', action='store', + type=int, help="number of processes to execute in parallel with") + @staticmethod def _load_manifest(manifest): pkg_manifest = {} @@ -85,6 +88,7 @@ class OESDKTestContextExecutor(OETestContextExecutor): OESDKTestContextExecutor._load_manifest(args.target_manifest) self.tc_kwargs['init']['host_pkg_manifest'] = \ OESDKTestContextExecutor._load_manifest(args.host_manifest) + self.tc_kwargs['run']['processes'] = args.processes @staticmethod def _get_sdk_environs(sdk_dir): |