[oe-commits] zjh : testimage: Add support for test suites manifest files

git at git.openembedded.org git at git.openembedded.org
Thu Jul 9 17:01:11 UTC 2015


Module: openembedded-core.git
Branch: master-next
Commit: c270148b3f0e87bbaafbcffbca4ee7b965be6569
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=c270148b3f0e87bbaafbcffbca4ee7b965be6569

Author: zjh <junhuix.zhang at intel.com>
Date:   Fri Jul  3 17:32:35 2015 +0800

testimage: Add support for test suites manifest files

Allow the list of TEST_SUITES to be read from a list of manifest files
in the TEST_SUITES_MANIFEST variable.

[YOCTO #7848]

Signed-off-by: zjh <junhuix.zhang at intel.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 meta/classes/testimage.bbclass | 26 ++++++++++++++++++++++++--
 1 file changed, 24 insertions(+), 2 deletions(-)

diff --git a/meta/classes/testimage.bbclass b/meta/classes/testimage.bbclass
index 1e3bb06..2b655b4 100644
--- a/meta/classes/testimage.bbclass
+++ b/meta/classes/testimage.bbclass
@@ -72,15 +72,37 @@ do_testsdk[nostamp] = "1"
 do_testsdk[depends] += "${TESTIMAGEDEPENDS}"
 do_testsdk[lockfiles] += "${TESTIMAGELOCK}"
 
+# get testcase list from specified file
+# if path is a relative path, then relative to build/conf/
+def read_testlist(d, fpath):
+    if not os.path.isabs(fpath):
+        builddir = d.getVar("TOPDIR", True)
+        fpath = os.path.join(builddir, "conf", fpath)
+    if not os.path.exists(fpath):
+        bb.fatal("No such manifest file: ", fpath)
+    tcs = []
+    for line in open(fpath).readlines():
+        line = line.strip()
+        if line and not line.startswith("#"):
+            tcs.append(line)
+    return " ".join(tcs)
+
 def get_tests_list(d, type="runtime"):
-    testsuites = d.getVar("TEST_SUITES", True).split()
+    testsuites = []
+    testslist = []
+    manifests = d.getVar("TEST_SUITES_MANIFEST", True)
+    if manifests is not None:
+        manifests = manifests.split()
+        for manifest in manifests:
+            testsuites.extend(read_testlist(d, manifest).split())
+    else:
+        testsuites = d.getVar("TEST_SUITES", True).split()
     if type == "sdk":
         testsuites = (d.getVar("TEST_SUITES_SDK", True) or "auto").split()
     bbpath = d.getVar("BBPATH", True).split(':')
 
     # This relies on lib/ under each directory in BBPATH being added to sys.path
     # (as done by default in base.bbclass)
-    testslist = []
     for testname in testsuites:
         if testname != "auto":
             if testname.startswith("oeqa."):



More information about the Openembedded-commits mailing list