[gnome-continuous-yocto/gnomeostree-3.28-rocko: 1469/8267] oe-selftest: print errors when failed to find test
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-continuous-yocto/gnomeostree-3.28-rocko: 1469/8267] oe-selftest: print errors when failed to find test
- Date: Sat, 16 Dec 2017 21:52:16 +0000 (UTC)
commit 736eab6e73928a6ba1b4b68f506f97a0e0286e66
Author: Robert Yang <liezhi yang windriver com>
Date: Tue Jul 12 05:04:01 2016 -0700
oe-selftest: print errors when failed to find test
For example:
$ oe-selftest --run-tests-by name hello world
2016-07-12 00:33:28,678 - selftest - ERROR - Failed to find test: hello
2016-07-12 00:33:28,679 - selftest - ERROR - Failed to find test: world
(From OE-Core rev: 665a0f93bde0d61e0c7ceab072ca3f1f22b2f700)
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>
scripts/oe-selftest | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/scripts/oe-selftest b/scripts/oe-selftest
index df76f94..303b1d5 100755
--- a/scripts/oe-selftest
+++ b/scripts/oe-selftest
@@ -262,16 +262,22 @@ def get_testsuite_by(criteria, keyword):
result = []
remaining = values[:]
for key in keyword:
+ found = False
if key in remaining:
# Regular matching of exact item
result.append(key)
remaining.remove(key)
+ found = True
else:
# Wildcard matching
pattern = re.compile(fnmatch.translate(r"%s" % key))
added = [x for x in remaining if pattern.match(x)]
- result.extend(added)
- remaining = [x for x in remaining if x not in added]
+ if added:
+ result.extend(added)
+ remaining = [x for x in remaining if x not in added]
+ found = True
+ if not found:
+ log.error("Failed to find test: %s" % key)
return result
@@ -455,6 +461,8 @@ def main():
criteria = args.run_tests_by[0]
keyword = args.run_tests_by[1:]
ts = sorted([ tc.fullpath for tc in get_testsuite_by(criteria, keyword) ])
+ if not ts:
+ return 1
if args.list_tests_by and len(args.list_tests_by) >= 2:
valid_options = ['name', 'class', 'module', 'id', 'tag']
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]