Explorar o código

selftest: automatically add the meta-selftest layer

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>
Benjamin Esquivel %!s(int64=7) %!d(string=hai) anos
pai
achega
b5000dd7b1
Modificáronse 1 ficheiros con 10 adicións e 2 borrados
  1. 10 2
      scripts/oe-selftest

+ 10 - 2
scripts/oe-selftest

@@ -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.")