Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 0/2] fix oe-selftest and testimage.bbclass
@ 2016-07-12 12:04 Robert Yang
  2016-07-12 12:04 ` [PATCH 1/2] oe-selftest: print errors when failed to find test Robert Yang
  2016-07-12 12:04 ` [PATCH 2/2] testimage.bbclass: INHERIT -> IMAGE_CLASSES Robert Yang
  0 siblings, 2 replies; 3+ messages in thread
From: Robert Yang @ 2016-07-12 12:04 UTC (permalink / raw)
  To: openembedded-core

The following changes since commit b17f91ed06a604e3d356fe17756bfe2ca61594b7:

  tune-ppce500mc.inc: pass -mcpu=e500mc for ppce500mc kernel compile (2016-07-10 14:12:07 +0100)

are available in the git repository at:

  git://git.openembedded.org/openembedded-core-contrib rbt/test
  http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=rbt/test

Robert Yang (2):
  oe-selftest: print errors when failed to find test
  testimage.bbclass: INHERIT -> IMAGE_CLASSES

 meta/classes/testimage.bbclass |  2 +-
 scripts/oe-selftest            | 12 ++++++++++--
 2 files changed, 11 insertions(+), 3 deletions(-)

-- 
2.9.0



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] oe-selftest: print errors when failed to find test
  2016-07-12 12:04 [PATCH 0/2] fix oe-selftest and testimage.bbclass Robert Yang
@ 2016-07-12 12:04 ` Robert Yang
  2016-07-12 12:04 ` [PATCH 2/2] testimage.bbclass: INHERIT -> IMAGE_CLASSES Robert Yang
  1 sibling, 0 replies; 3+ messages in thread
From: Robert Yang @ 2016-07-12 12:04 UTC (permalink / raw)
  To: openembedded-core

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

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
 scripts/oe-selftest | 12 ++++++++++--
 1 file 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']
-- 
2.9.0



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] testimage.bbclass: INHERIT -> IMAGE_CLASSES
  2016-07-12 12:04 [PATCH 0/2] fix oe-selftest and testimage.bbclass Robert Yang
  2016-07-12 12:04 ` [PATCH 1/2] oe-selftest: print errors when failed to find test Robert Yang
@ 2016-07-12 12:04 ` Robert Yang
  1 sibling, 0 replies; 3+ messages in thread
From: Robert Yang @ 2016-07-12 12:04 UTC (permalink / raw)
  To: openembedded-core

Use IMAGE_CLASSES which is only seen by image recipe.

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
 meta/classes/testimage.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes/testimage.bbclass b/meta/classes/testimage.bbclass
index 7fd0f62..6d8cc6e 100644
--- a/meta/classes/testimage.bbclass
+++ b/meta/classes/testimage.bbclass
@@ -8,7 +8,7 @@
 # To use it add testimage to global inherit and call your target image with -c testimage
 # You can try it out like this:
 # - first build a qemu core-image-sato
-# - add INHERIT += "testimage" in local.conf
+# - add IMAGE_CLASSES += "testimage" in local.conf
 # - then bitbake core-image-sato -c testimage. That will run a standard suite of tests.
 
 # You can set (or append to) TEST_SUITES in local.conf to select the tests
-- 
2.9.0



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-07-12 12:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-12 12:04 [PATCH 0/2] fix oe-selftest and testimage.bbclass Robert Yang
2016-07-12 12:04 ` [PATCH 1/2] oe-selftest: print errors when failed to find test Robert Yang
2016-07-12 12:04 ` [PATCH 2/2] testimage.bbclass: INHERIT -> IMAGE_CLASSES Robert Yang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox