[oe-commits] Daniel Istrate : scripts/oe-selftest: Added mechanism for including/ removing bblayers.inc

git at git.openembedded.org git at git.openembedded.org
Tue Jul 7 23:06:04 UTC 2015


Module: openembedded-core.git
Branch: master
Commit: cf7bf27f565b34fdcd2caa25aaef068c0970965e
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=cf7bf27f565b34fdcd2caa25aaef068c0970965e

Author: Daniel Istrate <daniel.alexandrux.istrate at intel.com>
Date:   Mon Jun 29 18:31:55 2015 +0300

scripts/oe-selftest: Added mechanism for including/removing bblayers.inc

When oe-selftest starts it includes bblayers.inc into bblayers.conf
When oe-selftest ends it deletes bblayers.inc and the included line
from bblayers.conf

Signed-off-by: Daniel Istrate <daniel.alexandrux.istrate at intel.com>
Signed-off-by: Ross Burton <ross.burton at intel.com>

---

 scripts/oe-selftest | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/scripts/oe-selftest b/scripts/oe-selftest
index fd58a66..fa6245a 100755
--- a/scripts/oe-selftest
+++ b/scripts/oe-selftest
@@ -100,6 +100,11 @@ def add_include():
             ftools.append_file(os.path.join(builddir, "conf/local.conf"), \
                     "\n#include added by oe-selftest.py\ninclude selftest.inc")
 
+    if "#include added by oe-selftest.py" \
+        not in ftools.read_file(os.path.join(builddir, "conf/bblayers.conf")):
+            log.info("Adding: \"include bblayers.inc\" in bblayers.conf")
+            ftools.append_file(os.path.join(builddir, "conf/bblayers.conf"), \
+                    "\n#include added by oe-selftest.py\ninclude bblayers.inc")
 
 def remove_include():
     builddir = os.environ.get("BUILDDIR")
@@ -111,6 +116,11 @@ def remove_include():
             ftools.remove_from_file(os.path.join(builddir, "conf/local.conf"), \
                     "#include added by oe-selftest.py\ninclude selftest.inc")
 
+    if "#include added by oe-selftest.py" \
+        in ftools.read_file(os.path.join(builddir, "conf/bblayers.conf")):
+            log.info("Removing the include from bblayers.conf")
+            ftools.remove_from_file(os.path.join(builddir, "conf/bblayers.conf"), \
+                    "#include added by oe-selftest.py\ninclude bblayers.inc")
 
 def remove_inc_files():
     try:
@@ -122,6 +132,11 @@ def remove_inc_files():
     except (AttributeError, OSError,) as e:    # AttributeError may happen if BUILDDIR is not set
         pass
 
+    try:
+        os.remove(os.path.join(os.environ.get("BUILDDIR"), "conf/bblayers.inc"))
+    except:
+        pass
+
 def get_tests(exclusive_modules=[], include_hidden=False):
     testslist = []
     for x in exclusive_modules:
@@ -167,7 +182,6 @@ def main():
                     print e
                     pass
 
-
     if args.run_tests or args.run_all_tests:
         if not preflight_check():
             return 1



More information about the Openembedded-commits mailing list