diff options
author | Aníbal Limón <anibal.limon@linux.intel.com> | 2017-05-26 15:37:38 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-06-02 13:36:14 +0100 |
commit | 9ea42734c03377c5cff157b23938f5120a5d21ed (patch) | |
tree | ce40c2f370ea51589dd37a30a770c4f93a6ca971 /meta/lib/oeqa | |
parent | 6632277986ad20ce0cbcb4432018156dfa3ba002 (diff) | |
download | poky-9ea42734c03377c5cff157b23938f5120a5d21ed.tar.gz |
oeqa/core/threaded: Add OETestContextThreaded class
This class sets the {loader,runner}Class to the threaded versions and
overrides loadTests method to be able specify the process_num.
[YOCTO #11450]
(From OE-Core rev: 3ec0d3825aa31219e0ccabc1f158d3a2f8adbda2)
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa')
-rw-r--r-- | meta/lib/oeqa/core/threaded.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/meta/lib/oeqa/core/threaded.py b/meta/lib/oeqa/core/threaded.py index 81df340366..c6058a3e52 100644 --- a/meta/lib/oeqa/core/threaded.py +++ b/meta/lib/oeqa/core/threaded.py | |||
@@ -10,6 +10,7 @@ from unittest.suite import TestSuite | |||
10 | 10 | ||
11 | from oeqa.core.loader import OETestLoader | 11 | from oeqa.core.loader import OETestLoader |
12 | from oeqa.core.runner import OEStreamLogger, OETestResult, OETestRunner | 12 | from oeqa.core.runner import OEStreamLogger, OETestResult, OETestRunner |
13 | from oeqa.core.context import OETestContext | ||
13 | 14 | ||
14 | class OETestLoaderThreaded(OETestLoader): | 15 | class OETestLoaderThreaded(OETestLoader): |
15 | def __init__(self, tc, module_paths, modules, tests, modules_required, | 16 | def __init__(self, tc, module_paths, modules, tests, modules_required, |
@@ -258,3 +259,16 @@ class OETestRunnerThreaded(OETestRunner): | |||
258 | result._fill_tc_results() | 259 | result._fill_tc_results() |
259 | 260 | ||
260 | return result | 261 | return result |
262 | |||
263 | class OETestContextThreaded(OETestContext): | ||
264 | loaderClass = OETestLoaderThreaded | ||
265 | runnerClass = OETestRunnerThreaded | ||
266 | |||
267 | def loadTests(self, module_paths, modules=[], tests=[], | ||
268 | modules_manifest="", modules_required=[], filters={}, process_num=0): | ||
269 | if modules_manifest: | ||
270 | modules = self._read_modules_from_manifest(modules_manifest) | ||
271 | |||
272 | self.loader = self.loaderClass(self, module_paths, modules, tests, | ||
273 | modules_required, filters, process_num) | ||
274 | self.suites = self.loader.discover() | ||