diff options
| author | Daniel Dunbar <daniel@zuster.org> | 2009-07-27 19:01:13 +0000 |
|---|---|---|
| committer | Daniel Dunbar <daniel@zuster.org> | 2009-07-27 19:01:13 +0000 |
| commit | b8aa9589bb58f5644609d50ef5da214daf330c2f (patch) | |
| tree | bdd3f542facb1683e4927f75e620d167e133f691 | |
| parent | 375a01c34a74cfc98540bff1e1dbe019c9b756cc (diff) | |
| download | bcm5719-llvm-b8aa9589bb58f5644609d50ef5da214daf330c2f.tar.gz bcm5719-llvm-b8aa9589bb58f5644609d50ef5da214daf330c2f.zip | |
Tweak MultiTestRunner --path argument.
- Accept multiple values instead of embedding separator.
- Make sure this gets used when searching for 'clang' binary.
- Switch makefiles to using --path to stay in sync with cmake.
llvm-svn: 77234
| -rw-r--r-- | clang/test/Makefile | 5 | ||||
| -rwxr-xr-x | clang/utils/test/MultiTestRunner.py | 10 | ||||
| -rwxr-xr-x | clang/utils/test/TestRunner.py | 8 |
3 files changed, 15 insertions, 8 deletions
diff --git a/clang/test/Makefile b/clang/test/Makefile index d649174b718..97c9d27404e 100644 --- a/clang/test/Makefile +++ b/clang/test/Makefile @@ -20,7 +20,10 @@ endif all:: @ echo '--- Running clang tests for $(TARGET_TRIPLE) ---' - @ PATH=$(ToolDir):$(LLVM_SRC_ROOT)/test/Scripts:$$PATH $(PROJ_SRC_DIR)/../utils/test/MultiTestRunner.py $(TESTARGS) $(TESTDIRS) $(VGARG) + @ $(PROJ_SRC_DIR)/../utils/test/MultiTestRunner.py \ + --path $(ToolDir) \ + --path $(LLVM_SRC_ROOT)/test/Scripts \ + $(TESTARGS) $(TESTDIRS) $(VGARG) clean:: @ rm -rf Output/ diff --git a/clang/utils/test/MultiTestRunner.py b/clang/utils/test/MultiTestRunner.py index 04bd74f65d3..8b48d8d6c75 100755 --- a/clang/utils/test/MultiTestRunner.py +++ b/clang/utils/test/MultiTestRunner.py @@ -236,7 +236,7 @@ def main(): action="store_true", default=False) parser.add_option("", "--path", dest="path", help="Additional paths to add to testing environment", - action="store", type=str, default=None) + action="append", type=str, default=[]) (opts, args) = parser.parse_args() @@ -246,6 +246,10 @@ def main(): parser.error('Support for running with valgrind is ' 'temporarily disabled') + # FIXME: Move into configuration object. + TestRunner.kChildEnv["PATH"] = os.pathsep.join(opts.path + + [TestRunner.kChildEnv['PATH']]) + if opts.clang is None: opts.clang = TestRunner.inferClang() if opts.clangcc is None: @@ -266,9 +270,7 @@ def main(): random.shuffle(tests) if opts.maxTests is not None: tests = tests[:opts.maxTests] - if opts.path is not None: - os.environ["PATH"] = opts.path + ":" + os.environ["PATH"]; - + extra = '' if len(tests) != len(allTests): extra = ' of %d'%(len(allTests),) diff --git a/clang/utils/test/TestRunner.py b/clang/utils/test/TestRunner.py index 2059b511846..9aae55cedeb 100755 --- a/clang/utils/test/TestRunner.py +++ b/clang/utils/test/TestRunner.py @@ -142,8 +142,8 @@ def runOneTest(testPath, tmpBase, clang, clangcc): if not ln.endswith('&&'): return (TestStatus.Fail, - "MISSING \'&&\': %s\n" + - "FOLLOWED BY : %s\n" % (ln,scriptLines[i + 1])) + ("MISSING \'&&\': %s\n" + + "FOLLOWED BY : %s\n") % (ln, scriptLines[i + 1])) # Strip off '&&' scriptLines[i] = ln[:-2] @@ -182,12 +182,14 @@ def capture(args): return out def which(command): + # FIXME: Take configuration object. + # Check for absolute match first. if os.path.exists(command): return command # Would be nice if Python had a lib function for this. - paths = os.environ.get('PATH') + paths = kChildEnv['PATH'] if not paths: paths = os.defpath |

