summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2019-07-20 12:24:09 -0600
committerSimon Glass <sjg@chromium.org>2019-07-29 09:38:06 -0600
commitbf574f129be2e2c7193024e0efac15d6b3496534 (patch)
tree94afe126f6c8c0f84d2a2d4dc44d1e15a574736c
parentf6e02497ae063b7939b0670153d22a7b17bf4408 (diff)
binman: Add a test function to clean up the output dir
Put tearDown()'s logic into a new _CleanupOutputDir() function so that it can be called from elsewhere. Signed-off-by: Simon Glass <sjg@chromium.org>
-rw-r--r--tools/binman/ftest.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py
index 04bd9f886c..a51865c5c7 100644
--- a/tools/binman/ftest.py
+++ b/tools/binman/ftest.py
@@ -187,6 +187,13 @@ class TestFunctional(unittest.TestCase):
if not self.have_lz4:
self.skipTest('lz4 --no-frame-crc not available')
+ def _CleanupOutputDir(self):
+ """Remove the temporary output directory"""
+ if self.preserve_outdirs:
+ print('Preserving output dir: %s' % tools.outdir)
+ else:
+ tools._FinaliseForTest()
+
def setUp(self):
# Enable this to turn on debugging output
# tout.Init(tout.DEBUG)
@@ -194,10 +201,7 @@ class TestFunctional(unittest.TestCase):
def tearDown(self):
"""Remove the temporary output directory"""
- if self.preserve_outdirs:
- print('Preserving output dir: %s' % tools.outdir)
- else:
- tools._FinaliseForTest()
+ self._CleanupOutputDir()
@classmethod
def _ResetDtbs(self):