]> code.ossystems Code Review - openembedded-core.git/commitdiff
selftest: automatically add the meta-selftest layer
authorBenjamin Esquivel <benjamin.esquivel@linux.intel.com>
Thu, 19 Jan 2017 15:55:52 +0000 (15:55 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 23 Jan 2017 12:04:01 +0000 (12:04 +0000)
adding the meta-selftest layer is a small bump you always encounter
when you want to run selftest. Adding an automatic procedure to include
the layer if it is not yet present.

Signed-off-by: Benjamin Esquivel <benjamin.esquivel@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
scripts/oe-selftest

index 0baf572c103e5dffefb1b9ef62e6c26b04eb23d0..58d3b1ef8a56a4f2b5e8ca390b2f3996bb967cd9 100755 (executable)
@@ -131,8 +131,16 @@ def preflight_check():
         os.chdir(builddir)
 
     if not "meta-selftest" in get_bb_var("BBLAYERS"):
-        log.error("You don't seem to have the meta-selftest layer in BBLAYERS")
-        return False
+        log.warn("meta-selftest layer not found in BBLAYERS, adding it")
+        meta_selftestdir = os.path.join(
+                get_bb_var("BBLAYERS_FETCH_DIR"),
+                'meta-selftest')
+        if os.path.isdir(meta_selftestdir):
+            runCmd("bitbake-layers add-layer %s" %meta_selftestdir)
+        else:
+            log.error("could not locate meta-selftest in:\n%s"
+                    %meta_selftestdir)
+            return False
 
     if "buildhistory.bbclass" in get_bb_var("BBINCLUDED"):
         log.error("You have buildhistory enabled already and this isn't recommended for selftest, please disable it first.")