summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorChen Qi <Qi.Chen@windriver.com>2018-06-01 13:02:59 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-07-02 11:41:25 +0100
commit1066af146869c8ed29397a94fd6e8e05f451c492 (patch)
tree77007c7ce865a1112f48f9d8aa7b0264992e6da5 /meta/classes
parent72f658348b0fdb55c6a10ed6628e99e80954b99c (diff)
downloadpoky-1066af146869c8ed29397a94fd6e8e05f451c492.tar.gz
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) (From OE-Core rev: 57f08e7ace4cc9486f86aafd1ade6ab5ad6a94d7) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/testimage.bbclass8
1 files changed, 7 insertions, 1 deletions
diff --git a/meta/classes/testimage.bbclass b/meta/classes/testimage.bbclass
index 77291c22ce..e67647ae09 100644
--- a/meta/classes/testimage.bbclass
+++ b/meta/classes/testimage.bbclass
@@ -260,10 +260,16 @@ def testimage_main(d):
260 # Load tests before starting the target 260 # Load tests before starting the target
261 test_paths = get_runtime_paths(d) 261 test_paths = get_runtime_paths(d)
262 test_modules = d.getVar('TEST_SUITES').split() 262 test_modules = d.getVar('TEST_SUITES').split()
263 if not test_modules:
264 bb.fatal('Empty test suite, please verify TEST_SUITES variable')
265
263 tc.loadTests(test_paths, modules=test_modules) 266 tc.loadTests(test_paths, modules=test_modules)
264 267
265 if not getSuiteCases(tc.suites): 268 suitecases = getSuiteCases(tc.suites)
269 if not suitecases:
266 bb.fatal('Empty test suite, please verify TEST_SUITES variable') 270 bb.fatal('Empty test suite, please verify TEST_SUITES variable')
271 else:
272 bb.debug(2, 'test suites:\n\t%s' % '\n\t'.join([str(c) for c in suitecases]))
267 273
268 package_extraction(d, tc.suites) 274 package_extraction(d, tc.suites)
269 275