[oe-commits] [openembedded-core] 21/68: testimage.bbclass: fix behavior of empty TEST_SUITES

git at git.openembedded.org git at git.openembedded.org
Mon Jul 2 10:46:43 UTC 2018


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

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

commit 57f08e7ace4cc9486f86aafd1ade6ab5ad6a94d7
Author: Chen Qi <Qi.Chen at windriver.com>
AuthorDate: Fri Jun 1 13:02:59 2018 +0800

    testimage.bbclass: fix behavior of empty TEST_SUITES
    
    The current behaviour of TEST_SUITES is very confusing.
    
    setting: TEST_SUITES = ""
    result:  Execute all test cases.
    
    setting: TEST_SUITES = "some_case_not_exist"
    result:  Error out with 'Empty test suite' message.
    
    The expected behaviour of TEST_SUITES should be:
    1. when 'auto' is in it, execute as many test cases as possible
    2. when no valid test case is specified, error out and give user message
    
    The first one is implemented by a previous patch.
    The second one is fixed in this patch.
    
    Also add debug message to show test cases to be executed. This is
    for easier debugging.
    
    (From OE-Core rev: 909568821fbad8a6a7034b10a2dc349a210fdfc6)
    
    Signed-off-by: Chen Qi <Qi.Chen at windriver.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
    Signed-off-by: Armin Kuster <akuster808 at gmail.com>
---
 meta/classes/testimage.bbclass | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/meta/classes/testimage.bbclass b/meta/classes/testimage.bbclass
index 77291c2..e67647a 100644
--- a/meta/classes/testimage.bbclass
+++ b/meta/classes/testimage.bbclass
@@ -260,10 +260,16 @@ def testimage_main(d):
     # Load tests before starting the target
     test_paths = get_runtime_paths(d)
     test_modules = d.getVar('TEST_SUITES').split()
+    if not test_modules:
+        bb.fatal('Empty test suite, please verify TEST_SUITES variable')
+
     tc.loadTests(test_paths, modules=test_modules)
 
-    if not getSuiteCases(tc.suites):
+    suitecases = getSuiteCases(tc.suites)
+    if not suitecases:
         bb.fatal('Empty test suite, please verify TEST_SUITES variable')
+    else:
+        bb.debug(2, 'test suites:\n\t%s' % '\n\t'.join([str(c) for c in suitecases]))
 
     package_extraction(d, tc.suites)
 

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


More information about the Openembedded-commits mailing list