aboutsummaryrefslogtreecommitdiffstats
path: root/meta/classes/testimage.bbclass
diff options
context:
space:
mode:
authorLucian Musat <george.l.musat@intel.com>2015-09-28 17:52:24 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-10-01 07:43:33 +0100
commitba0f6ca79615579e53369b1614345fc27816307f (patch)
tree5b1f325e280fdea94d448ca269f7cadbc7a84218 /meta/classes/testimage.bbclass
parent3e40688471df8e8ce00c32f1022d6c9025d1926e (diff)
downloadopenembedded-core-contrib-ba0f6ca79615579e53369b1614345fc27816307f.tar.gz
oeqa/testimage: Add ability to run single test from suite.
Just like we have in oe-selftest, you can add <filename>.<Class>.<testname> in TEST_SUITES in order to run just that test (From OE-Core rev: 3bf5204315fedc586fdf641583cfdb2c1a78c5c0) Signed-off-by: Lucian Musat <george.l.musat@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/testimage.bbclass')
-rw-r--r--meta/classes/testimage.bbclass7
1 files changed, 7 insertions, 0 deletions
diff --git a/meta/classes/testimage.bbclass b/meta/classes/testimage.bbclass
index 2efab29d2b..bde510ca26 100644
--- a/meta/classes/testimage.bbclass
+++ b/meta/classes/testimage.bbclass
@@ -146,6 +146,10 @@ def get_tests_list(d, type="runtime"):
testslist.append("oeqa." + type + "." + testname)
found = True
break
+ elif os.path.exists(os.path.join(p, 'lib', 'oeqa', type, testname.split(".")[0] + '.py')):
+ testslist.append("oeqa." + type + "." + testname)
+ found = True
+ break
if not found:
bb.fatal('Test %s specified in TEST_SUITES could not be found in lib/oeqa/runtime under BBPATH' % testname)
@@ -172,6 +176,7 @@ def exportTests(d,tc):
import json
import shutil
import pkgutil
+ import re
exportpath = d.getVar("TEST_EXPORT_DIR", True)
@@ -223,6 +228,8 @@ def exportTests(d,tc):
bb.utils.mkdirhier(os.path.join(exportpath, "oeqa/utils"))
# copy test modules, this should cover tests in other layers too
for t in tc.testslist:
+ if re.search("\w+\.\w+\.test_\S+", t):
+ t = '.'.join(t.split('.')[:3])
mod = pkgutil.get_loader(t)
shutil.copy2(mod.filename, os.path.join(exportpath, "oeqa/runtime"))
# copy __init__.py files