summaryrefslogtreecommitdiffstats
path: root/scripts/oe-selftest
diff options
context:
space:
mode:
authorDaniel Istrate <daniel.alexandrux.istrate@intel.com>2015-06-29 18:31:55 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-07-08 00:01:19 +0100
commit75fa966d7c1ceaf0d40889addb4ab3cc2d05c47a (patch)
tree3b4ffb6091fb5581ffad83b8d696196d4bb2197b /scripts/oe-selftest
parentffa54b94b636a24aa5264916d2b1abfcf029f7ae (diff)
downloadpoky-75fa966d7c1ceaf0d40889addb4ab3cc2d05c47a.tar.gz
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 (From OE-Core rev: cf7bf27f565b34fdcd2caa25aaef068c0970965e) Signed-off-by: Daniel Istrate <daniel.alexandrux.istrate@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/oe-selftest')
-rwxr-xr-xscripts/oe-selftest16
1 files changed, 15 insertions, 1 deletions
diff --git a/scripts/oe-selftest b/scripts/oe-selftest
index fd58a66123..fa6245a3a6 100755
--- a/scripts/oe-selftest
+++ b/scripts/oe-selftest
@@ -100,6 +100,11 @@ def add_include():
100 ftools.append_file(os.path.join(builddir, "conf/local.conf"), \ 100 ftools.append_file(os.path.join(builddir, "conf/local.conf"), \
101 "\n#include added by oe-selftest.py\ninclude selftest.inc") 101 "\n#include added by oe-selftest.py\ninclude selftest.inc")
102 102
103 if "#include added by oe-selftest.py" \
104 not in ftools.read_file(os.path.join(builddir, "conf/bblayers.conf")):
105 log.info("Adding: \"include bblayers.inc\" in bblayers.conf")
106 ftools.append_file(os.path.join(builddir, "conf/bblayers.conf"), \
107 "\n#include added by oe-selftest.py\ninclude bblayers.inc")
103 108
104def remove_include(): 109def remove_include():
105 builddir = os.environ.get("BUILDDIR") 110 builddir = os.environ.get("BUILDDIR")
@@ -111,6 +116,11 @@ def remove_include():
111 ftools.remove_from_file(os.path.join(builddir, "conf/local.conf"), \ 116 ftools.remove_from_file(os.path.join(builddir, "conf/local.conf"), \
112 "#include added by oe-selftest.py\ninclude selftest.inc") 117 "#include added by oe-selftest.py\ninclude selftest.inc")
113 118
119 if "#include added by oe-selftest.py" \
120 in ftools.read_file(os.path.join(builddir, "conf/bblayers.conf")):
121 log.info("Removing the include from bblayers.conf")
122 ftools.remove_from_file(os.path.join(builddir, "conf/bblayers.conf"), \
123 "#include added by oe-selftest.py\ninclude bblayers.inc")
114 124
115def remove_inc_files(): 125def remove_inc_files():
116 try: 126 try:
@@ -122,6 +132,11 @@ def remove_inc_files():
122 except (AttributeError, OSError,) as e: # AttributeError may happen if BUILDDIR is not set 132 except (AttributeError, OSError,) as e: # AttributeError may happen if BUILDDIR is not set
123 pass 133 pass
124 134
135 try:
136 os.remove(os.path.join(os.environ.get("BUILDDIR"), "conf/bblayers.inc"))
137 except:
138 pass
139
125def get_tests(exclusive_modules=[], include_hidden=False): 140def get_tests(exclusive_modules=[], include_hidden=False):
126 testslist = [] 141 testslist = []
127 for x in exclusive_modules: 142 for x in exclusive_modules:
@@ -167,7 +182,6 @@ def main():
167 print e 182 print e
168 pass 183 pass
169 184
170
171 if args.run_tests or args.run_all_tests: 185 if args.run_tests or args.run_all_tests:
172 if not preflight_check(): 186 if not preflight_check():
173 return 1 187 return 1