]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
oe-selftest: add libdirs from BBPATH to sys.path
authorChristopher Larson <chris_larson@mentor.com>
Mon, 13 Jul 2015 19:04:21 +0000 (12:04 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 27 Jul 2015 11:28:12 +0000 (12:28 +0100)
This ensures that oeqa.selftest.* from layers are found.

[YOCTO #7625]

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
scripts/oe-selftest

index c19c6928b42b886128b387a6b36477bf07276c41..60f9bb88f5194cefaea434a605a78e0fcd5fbf05 100755 (executable)
@@ -155,6 +155,13 @@ def main():
     parser = get_args_parser()
     args = parser.parse_args()
 
+    # Add <layer>/lib to sys.path, so layers can add selftests
+    log.info("Running bitbake -e to get BBPATH")
+    bbpath = get_bb_var('BBPATH').split(':')
+    layer_libdirs = [p for p in (os.path.join(l, 'lib') for l in bbpath) if os.path.exists(p)]
+    sys.path.extend(layer_libdirs)
+    reload(oeqa.selftest)
+
     if args.list_allclasses:
         args.list_modules = True