[oe-commits] [openembedded-core] 25/42: testsdk.bbclass: check python module testtools and subunit

git at git.openembedded.org git at git.openembedded.org
Mon Jul 30 11:45:29 UTC 2018


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master
in repository openembedded-core.

commit ae53461608c4e71533378369b3f623b4c9002e39
Author: Robert Yang <liezhi.yang at windriver.com>
AuthorDate: Fri Jul 27 11:17:36 2018 +0800

    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
    
    Signed-off-by: Robert Yang <liezhi.yang at windriver.com>
    Signed-off-by: Ross Burton <ross.burton at intel.com>
---
 meta/classes/testsdk.bbclass | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/meta/classes/testsdk.bbclass b/meta/classes/testsdk.bbclass
index 5df17bf..d3f475d 100644
--- a/meta/classes/testsdk.bbclass
+++ b/meta/classes/testsdk.bbclass
@@ -43,6 +43,12 @@ def testsdk_main(d):
         d.expand("${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.host.manifest"))
 
     processes = d.getVar("TESTIMAGE_NUMBER_THREADS") or d.getVar("BB_NUMBER_THREADS")
+    if processes:
+        try:
+            import testtools, subunit
+        except ImportError:
+            bb.warn("Failed to import testtools or subunit, the testcases will run serially")
+            processes = None
 
     sdk_dir = d.expand("${WORKDIR}/testimage-sdk/")
     bb.utils.remove(sdk_dir, True)

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list