summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/classes/testimage.bbclass14
1 files changed, 13 insertions, 1 deletions
diff --git a/meta/classes/testimage.bbclass b/meta/classes/testimage.bbclass
index d571672bc0..e833db4bfe 100644
--- a/meta/classes/testimage.bbclass
+++ b/meta/classes/testimage.bbclass
@@ -229,11 +229,23 @@ def exportTests(d,tc):
229 bb.utils.mkdirhier(os.path.join(exportpath, "oeqa/runtime/files")) 229 bb.utils.mkdirhier(os.path.join(exportpath, "oeqa/runtime/files"))
230 bb.utils.mkdirhier(os.path.join(exportpath, "oeqa/utils")) 230 bb.utils.mkdirhier(os.path.join(exportpath, "oeqa/utils"))
231 # copy test modules, this should cover tests in other layers too 231 # copy test modules, this should cover tests in other layers too
232 bbpath = d.getVar("BBPATH", True).split(':')
232 for t in tc.testslist: 233 for t in tc.testslist:
234 isfolder = False
233 if re.search("\w+\.\w+\.test_\S+", t): 235 if re.search("\w+\.\w+\.test_\S+", t):
234 t = '.'.join(t.split('.')[:3]) 236 t = '.'.join(t.split('.')[:3])
235 mod = pkgutil.get_loader(t) 237 mod = pkgutil.get_loader(t)
236 shutil.copy2(mod.filename, os.path.join(exportpath, "oeqa/runtime")) 238 # More depth than usual?
239 if (t.count('.') > 2):
240 for p in bbpath:
241 foldername = os.path.join(p, 'lib', os.sep.join(t.split('.')).rsplit(os.sep, 1)[0])
242 if os.path.isdir(foldername):
243 isfolder = True
244 target_folder = os.path.join(exportpath, "oeqa", "runtime", os.path.basename(foldername))
245 if not os.path.exists(target_folder):
246 shutil.copytree(foldername, target_folder)
247 if not isfolder:
248 shutil.copy2(mod.filename, os.path.join(exportpath, "oeqa/runtime"))
237 # copy __init__.py files 249 # copy __init__.py files
238 oeqadir = pkgutil.get_loader("oeqa").filename 250 oeqadir = pkgutil.get_loader("oeqa").filename
239 shutil.copy2(os.path.join(oeqadir, "__init__.py"), os.path.join(exportpath, "oeqa")) 251 shutil.copy2(os.path.join(oeqadir, "__init__.py"), os.path.join(exportpath, "oeqa"))