diff options
| -rw-r--r-- | meta/classes/testimage.bbclass | 7 |
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"): | |||
| 146 | testslist.append("oeqa." + type + "." + testname) | 146 | testslist.append("oeqa." + type + "." + testname) |
| 147 | found = True | 147 | found = True |
| 148 | break | 148 | break |
| 149 | elif os.path.exists(os.path.join(p, 'lib', 'oeqa', type, testname.split(".")[0] + '.py')): | ||
| 150 | testslist.append("oeqa." + type + "." + testname) | ||
| 151 | found = True | ||
| 152 | break | ||
| 149 | if not found: | 153 | if not found: |
| 150 | bb.fatal('Test %s specified in TEST_SUITES could not be found in lib/oeqa/runtime under BBPATH' % testname) | 154 | bb.fatal('Test %s specified in TEST_SUITES could not be found in lib/oeqa/runtime under BBPATH' % testname) |
| 151 | 155 | ||
| @@ -172,6 +176,7 @@ def exportTests(d,tc): | |||
| 172 | import json | 176 | import json |
| 173 | import shutil | 177 | import shutil |
| 174 | import pkgutil | 178 | import pkgutil |
| 179 | import re | ||
| 175 | 180 | ||
| 176 | exportpath = d.getVar("TEST_EXPORT_DIR", True) | 181 | exportpath = d.getVar("TEST_EXPORT_DIR", True) |
| 177 | 182 | ||
| @@ -223,6 +228,8 @@ def exportTests(d,tc): | |||
| 223 | bb.utils.mkdirhier(os.path.join(exportpath, "oeqa/utils")) | 228 | bb.utils.mkdirhier(os.path.join(exportpath, "oeqa/utils")) |
| 224 | # copy test modules, this should cover tests in other layers too | 229 | # copy test modules, this should cover tests in other layers too |
| 225 | for t in tc.testslist: | 230 | for t in tc.testslist: |
| 231 | if re.search("\w+\.\w+\.test_\S+", t): | ||
| 232 | t = '.'.join(t.split('.')[:3]) | ||
| 226 | mod = pkgutil.get_loader(t) | 233 | mod = pkgutil.get_loader(t) |
| 227 | shutil.copy2(mod.filename, os.path.join(exportpath, "oeqa/runtime")) | 234 | shutil.copy2(mod.filename, os.path.join(exportpath, "oeqa/runtime")) |
| 228 | # copy __init__.py files | 235 | # copy __init__.py files |
