diff options
| author | Robert Yang <liezhi.yang@windriver.com> | 2018-07-27 11:17:36 +0800 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-07-30 12:44:35 +0100 |
| commit | ac134ce9be6e15c7e6b49c14173903855df14318 (patch) | |
| tree | 128b1e50528c30ef5dde87dda348202211e9cc0c /meta/classes/testsdk.bbclass | |
| parent | 3bbe1ec7d578854091f59bcd20d450cd609bff4d (diff) | |
| download | poky-ac134ce9be6e15c7e6b49c14173903855df14318.tar.gz | |
testsdk.bbclass: check python module testtools and subunit
The testtools or subunit is not part of python's standard library, so check them
before use.
Fixed when they are not installed on host:
$ bitbake core-image-minimal -ctestsdk
Exception: ImportError: No module named 'testtools'
Now it can run with a warning:
WARNING: core-image-minimal-1.0-r0 do_testsdk: Failed to import testtools or subunit, the testcases will run serially
(From OE-Core rev: ae53461608c4e71533378369b3f623b4c9002e39)
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/testsdk.bbclass')
| -rw-r--r-- | meta/classes/testsdk.bbclass | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/meta/classes/testsdk.bbclass b/meta/classes/testsdk.bbclass index 5df17bfa9e..d3f475d22b 100644 --- a/meta/classes/testsdk.bbclass +++ b/meta/classes/testsdk.bbclass | |||
| @@ -43,6 +43,12 @@ def testsdk_main(d): | |||
| 43 | d.expand("${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.host.manifest")) | 43 | d.expand("${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.host.manifest")) |
| 44 | 44 | ||
| 45 | processes = d.getVar("TESTIMAGE_NUMBER_THREADS") or d.getVar("BB_NUMBER_THREADS") | 45 | processes = d.getVar("TESTIMAGE_NUMBER_THREADS") or d.getVar("BB_NUMBER_THREADS") |
| 46 | if processes: | ||
| 47 | try: | ||
| 48 | import testtools, subunit | ||
| 49 | except ImportError: | ||
| 50 | bb.warn("Failed to import testtools or subunit, the testcases will run serially") | ||
| 51 | processes = None | ||
| 46 | 52 | ||
| 47 | sdk_dir = d.expand("${WORKDIR}/testimage-sdk/") | 53 | sdk_dir = d.expand("${WORKDIR}/testimage-sdk/") |
| 48 | bb.utils.remove(sdk_dir, True) | 54 | bb.utils.remove(sdk_dir, True) |
