diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2016-10-13 23:24:44 +0200 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2016-10-13 23:25:40 +0200 |
commit | fcb7ee7aad1c798157bc84e418742a42cb625ae6 (patch) | |
tree | d11326d693681073c974a0216750909750669096 | |
parent | 2eb6605c1dcf5ea8e0521a8162d20dfe6399ec88 (diff) |
use tempdir for test
Change-Id: Ie218f87dc2f1c1b6031cc08f2027cfcf392c6c21
-rw-r--r-- | solenv/qa/python/gbuildtoide.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/solenv/qa/python/gbuildtoide.py b/solenv/qa/python/gbuildtoide.py index 6184f9170115..71c67754e6ab 100644 --- a/solenv/qa/python/gbuildtoide.py +++ b/solenv/qa/python/gbuildtoide.py @@ -21,17 +21,19 @@ import unittest import json import os import os.path +import tempfile class CheckGbuildToIde(unittest.TestCase): def test_gbuildtoide(self): + tempwork = tempfile.mkdtemp() os.chdir(os.path.join(os.environ['SRCDIR'], 'solenv', 'qa', 'python', 'selftest')) - subprocess.check_call(['make', 'gbuildtoide']) - jsonfiles = os.listdir(os.path.join(os.environ['WORKDIR'], 'GbuildToIde', 'Library')) + subprocess.check_call(['make', 'gbuildtoide', 'WORKDIR=%s' % tempwork]) + jsonfiles = os.listdir(os.path.join(tempwork, 'GbuildToIde', 'Library')) gbuildlibs = [] for jsonfilename in jsonfiles: - with open(os.path.join(os.environ['WORKDIR'], 'GbuildToIde', 'Library', jsonfilename), 'r') as f: + with open(os.path.join(tempwork, 'GbuildToIde', 'Library', jsonfilename), 'r') as f: print('loading %s' % jsonfilename) gbuildlibs.append(json.load(f)) foundlibs = set() |