]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
bitbake-selftest: introduce BB_TMPDIR_NOCLEAN
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Thu, 18 Aug 2016 16:55:53 +0000 (19:55 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 19 Aug 2016 15:44:47 +0000 (16:44 +0100)
Set this env variable to 'yes' to preserve temporary directories used by
the fetcher tests. Useful for debugging tests.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bin/bitbake-selftest
lib/bb/tests/fetch.py

index 25905d7c10c05bfb014c6b653bef056e5de2362b..1e00e33271f1587a91167a5323d7763338f8897e 100755 (executable)
@@ -41,6 +41,7 @@ ENV_HELP = """\
 Environment variables:
   BB_SKIP_NETTESTS      set to 'yes' in order to skip tests using network
                         connection
+  BB_TMPDIR_NOCLEAN     set to 'yes' to preserve test tmp directories
 """
 
 class main(unittest.main):
index 272078f2b3104b2752da23b57e6595acb9a0f184..e8c416afd025a48c0b073e87be4e1d8bcb4cebd8 100644 (file)
@@ -360,7 +360,10 @@ class FetcherTest(unittest.TestCase):
 
     def tearDown(self):
         os.chdir(self.origdir)
-        bb.utils.prunedir(self.tempdir)
+        if os.environ.get("BB_TMPDIR_NOCLEAN") == "yes":
+            print("Not cleaning up %s. Please remove manually." % self.tempdir)
+        else:
+            bb.utils.prunedir(self.tempdir)
 
 class MirrorUriTest(FetcherTest):