[OE-core] [PATCH] meta/testimage.bbclass: corrected the bug that prevented test cases to be loaded from layers other than meta when using TEST_SUITES = "auto"
Costin Constantin
costin.c.constantin at intel.com
Tue Jun 9 09:44:26 UTC 2015
Signed-off-by: Costin Constantin <costin.c.constantin at intel.com>
---
meta/classes/testimage.bbclass | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/meta/classes/testimage.bbclass b/meta/classes/testimage.bbclass
index 4074ff7..aadee45 100644
--- a/meta/classes/testimage.bbclass
+++ b/meta/classes/testimage.bbclass
@@ -88,19 +88,20 @@ def get_tests_list(d, type="runtime"):
if "auto" in testsuites:
def add_auto_list(path):
- if not os.path.exists(os.path.join(path, '__init__.py')):
- bb.fatal('Tests directory %s exists but is missing __init__.py' % path)
files = sorted([f for f in os.listdir(path) if f.endswith('.py') and not f.startswith('_')])
for f in files:
module = 'oeqa.' + type + '.' + f[:-3]
if module not in testslist:
testslist.append(module)
-
+ tests_found = False
for p in bbpath:
testpath = os.path.join(p, 'lib', 'oeqa', type)
bb.debug(2, 'Searching for tests in %s' % testpath)
- if os.path.exists(testpath):
+ if os.path.exists(os.path.join(testpath, '__init__.py')):
add_auto_list(testpath)
+ tests_found = True
+ if not tests_found:
+ bb.fatal('Couldn\'t find any test files inside meta*/lib/oeqa/runtime or meta*/lib/oeqa/sdk directories.')
return testslist
--
2.1.4
More information about the Openembedded-core
mailing list