[OE-core] [PATCH] oeqa/testimage: Add ability to run single test from suite.
Lucian Musat
george.l.musat at intel.com
Mon Sep 28 11:47:42 UTC 2015
Just like we have in oe-selftest, you can add
<filename>.<Class>.<testname> in TEST_SUITES in order to
run just that test.
Signed-off-by: Lucian Musat <george.l.musat at intel.com>
---
meta/classes/testimage.bbclass | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/meta/classes/testimage.bbclass b/meta/classes/testimage.bbclass
index 2efab29..36ee782 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
+ from re import search as re_search
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 = t.split('.')[0]+'.'+t.split('.')[1]+'.'+t.split('.')[2]
mod = pkgutil.get_loader(t)
shutil.copy2(mod.filename, os.path.join(exportpath, "oeqa/runtime"))
# copy __init__.py files
--
2.1.4
More information about the Openembedded-core
mailing list