summaryrefslogtreecommitdiff
path: root/solenv/qa
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2016-10-14 01:04:51 +0200
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2016-10-14 01:07:51 +0200
commit45a7137c6796f33fbf5b8f7cb64e293260d991cb (patch)
tree39101e23cd50fd7e4fa2446771efd004ea4a9222 /solenv/qa
parentbc6c26d3c1269c91f7d963fe96c01740732b094b (diff)
tearDown/clean up solenv test tempdir
Change-Id: I2fc5497b0aeadbc43e967f338a3b8718995f2a5c
Diffstat (limited to 'solenv/qa')
-rw-r--r--solenv/qa/python/gbuildtoide.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/solenv/qa/python/gbuildtoide.py b/solenv/qa/python/gbuildtoide.py
index a1b8d1c691c4..11e66a82f286 100644
--- a/solenv/qa/python/gbuildtoide.py
+++ b/solenv/qa/python/gbuildtoide.py
@@ -16,15 +16,19 @@ import tempfile
class CheckGbuildToIde(unittest.TestCase):
+ def setUp(self):
+ self.tempwork = tempfile.mkdtemp()
+
+ def tearDown(self):
+ subprocess.check_call(['rm', '-rf', self.tempwork])
def test_gbuildtoide(self):
- tempwork = tempfile.mkdtemp()
os.chdir(os.path.join(os.environ['SRCDIR'], 'solenv', 'qa', 'python', 'selftest'))
- subprocess.check_call(['make', 'gbuildtoide', 'WORKDIR=%s' % tempwork])
- jsonfiles = os.listdir(os.path.join(tempwork, 'GbuildToIde', 'Library'))
+ subprocess.check_call(['make', 'gbuildtoide', 'WORKDIR=%s' % self.tempwork])
+ jsonfiles = os.listdir(os.path.join(self.tempwork, 'GbuildToIde', 'Library'))
gbuildlibs = []
for jsonfilename in jsonfiles:
- with open(os.path.join(tempwork, 'GbuildToIde', 'Library', jsonfilename), 'r') as f:
+ with open(os.path.join(self.tempwork, 'GbuildToIde', 'Library', jsonfilename), 'r') as f:
gbuildlibs.append(json.load(f))
foundlibs = set()
for lib in gbuildlibs:
@@ -43,10 +47,10 @@ class CheckGbuildToIde(unittest.TestCase):
self.assertTrue(False)
self.assertEqual(foundlibs, set(['gbuildselftest', 'gbuildselftestdep']))
self.assertEqual(len(foundlibs), 2)
- jsonfiles = os.listdir(os.path.join(tempwork, 'GbuildToIde', 'Executable'))
+ jsonfiles = os.listdir(os.path.join(self.tempwork, 'GbuildToIde', 'Executable'))
gbuildexes = []
for jsonfilename in jsonfiles:
- with open(os.path.join(tempwork, 'GbuildToIde', 'Executable', jsonfilename), 'r') as f:
+ with open(os.path.join(self.tempwork, 'GbuildToIde', 'Executable', jsonfilename), 'r') as f:
gbuildexes.append(json.load(f))
foundexes = set()
for exe in gbuildexes: