summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzjh <junhuix.zhang@intel.com>2015-07-03 17:32:35 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-07-09 18:00:21 +0100
commitd245899cc98881d2be784f8e7302120765c2bc7f (patch)
tree5f667496105f238e61e9ec7b6b22c7d77ecd2f46
parent129aed8d799b91c7327cebcb241ad3f7a4f7de66 (diff)
downloadpoky-d245899cc98881d2be784f8e7302120765c2bc7f.tar.gz
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] (From OE-Core rev: c270148b3f0e87bbaafbcffbca4ee7b965be6569) Signed-off-by: zjh <junhuix.zhang@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/testimage.bbclass26
1 files changed, 24 insertions, 2 deletions
diff --git a/meta/classes/testimage.bbclass b/meta/classes/testimage.bbclass
index 1e3bb066d4..2b655b49fa 100644
--- a/meta/classes/testimage.bbclass
+++ b/meta/classes/testimage.bbclass
@@ -72,15 +72,37 @@ do_testsdk[nostamp] = "1"
72do_testsdk[depends] += "${TESTIMAGEDEPENDS}" 72do_testsdk[depends] += "${TESTIMAGEDEPENDS}"
73do_testsdk[lockfiles] += "${TESTIMAGELOCK}" 73do_testsdk[lockfiles] += "${TESTIMAGELOCK}"
74 74
75# get testcase list from specified file
76# if path is a relative path, then relative to build/conf/
77def read_testlist(d, fpath):
78 if not os.path.isabs(fpath):
79 builddir = d.getVar("TOPDIR", True)
80 fpath = os.path.join(builddir, "conf", fpath)
81 if not os.path.exists(fpath):
82 bb.fatal("No such manifest file: ", fpath)
83 tcs = []
84 for line in open(fpath).readlines():
85 line = line.strip()
86 if line and not line.startswith("#"):
87 tcs.append(line)
88 return " ".join(tcs)
89
75def get_tests_list(d, type="runtime"): 90def get_tests_list(d, type="runtime"):
76 testsuites = d.getVar("TEST_SUITES", True).split() 91 testsuites = []
92 testslist = []
93 manifests = d.getVar("TEST_SUITES_MANIFEST", True)
94 if manifests is not None:
95 manifests = manifests.split()
96 for manifest in manifests:
97 testsuites.extend(read_testlist(d, manifest).split())
98 else:
99 testsuites = d.getVar("TEST_SUITES", True).split()
77 if type == "sdk": 100 if type == "sdk":
78 testsuites = (d.getVar("TEST_SUITES_SDK", True) or "auto").split() 101 testsuites = (d.getVar("TEST_SUITES_SDK", True) or "auto").split()
79 bbpath = d.getVar("BBPATH", True).split(':') 102 bbpath = d.getVar("BBPATH", True).split(':')
80 103
81 # This relies on lib/ under each directory in BBPATH being added to sys.path 104 # This relies on lib/ under each directory in BBPATH being added to sys.path
82 # (as done by default in base.bbclass) 105 # (as done by default in base.bbclass)
83 testslist = []
84 for testname in testsuites: 106 for testname in testsuites:
85 if testname != "auto": 107 if testname != "auto":
86 if testname.startswith("oeqa."): 108 if testname.startswith("oeqa."):