[cfe-commits] r77234 - in /cfe/trunk: test/Makefile utils/test/MultiTestRunner.py utils/test/TestRunner.py
Daniel Dunbar
daniel at zuster.org
Mon Jul 27 12:01:13 PDT 2009
Author: ddunbar
Date: Mon Jul 27 14:01:13 2009
New Revision: 77234
URL: http://llvm.org/viewvc/llvm-project?rev=77234&view=rev
Log:
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.
Modified:
cfe/trunk/test/Makefile
cfe/trunk/utils/test/MultiTestRunner.py
cfe/trunk/utils/test/TestRunner.py
Modified: cfe/trunk/test/Makefile
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Makefile?rev=77234&r1=77233&r2=77234&view=diff
==============================================================================
--- cfe/trunk/test/Makefile (original)
+++ cfe/trunk/test/Makefile Mon Jul 27 14:01:13 2009
@@ -20,7 +20,10 @@
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/
Modified: cfe/trunk/utils/test/MultiTestRunner.py
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/test/MultiTestRunner.py?rev=77234&r1=77233&r2=77234&view=diff
==============================================================================
--- cfe/trunk/utils/test/MultiTestRunner.py (original)
+++ cfe/trunk/utils/test/MultiTestRunner.py Mon Jul 27 14:01:13 2009
@@ -236,7 +236,7 @@
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 @@
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 @@
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),)
Modified: cfe/trunk/utils/test/TestRunner.py
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/test/TestRunner.py?rev=77234&r1=77233&r2=77234&view=diff
==============================================================================
--- cfe/trunk/utils/test/TestRunner.py (original)
+++ cfe/trunk/utils/test/TestRunner.py Mon Jul 27 14:01:13 2009
@@ -142,8 +142,8 @@
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 @@
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
More information about the cfe-commits
mailing list