diff options
author | William Blevins <wblevins001@gmail.com> | 2016-09-23 04:43:00 (GMT) |
---|---|---|
committer | William Blevins <wblevins001@gmail.com> | 2016-09-23 04:43:00 (GMT) |
commit | 2c18000b934722c69e23a2d0ad181767d5266ac9 (patch) | |
tree | 5e1e05b0b5b5bfe42d57614f635c199ff70d9dc6 /QMTest | |
parent | 9128cb07092b16c4602b352544414a06a4ec641a (diff) | |
download | SCons-2c18000b934722c69e23a2d0ad181767d5266ac9.zip SCons-2c18000b934722c69e23a2d0ad181767d5266ac9.tar.gz SCons-2c18000b934722c69e23a2d0ad181767d5266ac9.tar.bz2 |
Allowed for multiple fixture dirs and added default global directory.
Diffstat (limited to 'QMTest')
-rw-r--r-- | QMTest/TestCmd.py | 25 | ||||
-rw-r--r-- | QMTest/TestSCons.py | 2 |
2 files changed, 17 insertions, 10 deletions
diff --git a/QMTest/TestCmd.py b/QMTest/TestCmd.py index bff0d6a..109c83a 100644 --- a/QMTest/TestCmd.py +++ b/QMTest/TestCmd.py @@ -924,7 +924,7 @@ class TestCmd(object): self.condition = 'no_result' self.workdir_set(workdir) self.subdir(subdir) - self.script_srcdir = None + self.fixture_dirs = [] def __del__(self): self.cleanup() @@ -1248,8 +1248,13 @@ class TestCmd(object): assumed to be under the temporary working directory, it gets created automatically, if it does not already exist. """ - if srcdir and self.script_srcdir and not os.path.isabs(srcdir): - spath = os.path.join(self.script_srcdir, srcdir) + + if srcdir and self.fixture_dirs and not os.path.isabs(srcdir): + for dir in self.fixture_dirs: + spath = os.path.join(self.fixture_dirs, srcdir) + if os.path.isdir(spath): + continue + else: spath = srcdir if dstdir: @@ -1285,13 +1290,15 @@ class TestCmd(object): automatically, if it does not already exist. """ srcpath, srctail = os.path.split(srcfile) - if srcpath: - if self.script_srcdir and not os.path.isabs(srcpath): - spath = os.path.join(self.script_srcdir, srcfile) - else: - spath = srcfile + + if srcpath and (not self.fixture_dirs or os.path.isabs(srcpath)): + spath = srcfile else: - spath = os.path.join(self.script_srcdir, srcfile) + for dir in self.fixture_dirs: + spath = os.path.join(self.fixture_dirs, srcfile) + if os.path.isfile(spath): + continue + if not dstfile: if srctail: dpath = os.path.join(self.workdir, srctail) diff --git a/QMTest/TestSCons.py b/QMTest/TestSCons.py index 0d5dc90..f02ddd8 100644 --- a/QMTest/TestSCons.py +++ b/QMTest/TestSCons.py @@ -268,7 +268,7 @@ class TestSCons(TestCommon): SCons.Node.FS.default_fs = SCons.Node.FS.FS() try: - self.script_srcdir = os.environ['PYTHON_SCRIPT_DIR'] + self.fixture_dirs = os.environ['FIXTURE_DIRS'].split(':') except KeyError: pass |