MultiTestRunner/Win32: Add SYSTEMROOT to environment, replace '&&' in .bat
authorDaniel Dunbar <daniel@zuster.org>
Sat, 25 Jul 2009 12:57:15 +0000 (12:57 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Sat, 25 Jul 2009 12:57:15 +0000 (12:57 +0000)
files.

llvm-svn: 77071

clang/utils/test/TestRunner.py

index ba43330d9a688c1e5e4a5946c09b715a96a97099..cfbfe6b3b74836cee2bd1debcc2fe7191a1bbbdc 100755 (executable)
@@ -24,7 +24,9 @@ import subprocess
 import sys
 
 # Increase determinism by explicitly choosing the environment.
-kChildEnv = { 'PATH' : os.environ.get('PATH','') }
+kChildEnv = {}
+for var in ('PATH', 'SYSTEMROOT'):
+    kChildEnv[var] = os.environ.get(var, '')
 
 kSystemName = platform.system()
 
@@ -170,7 +172,11 @@ def runOneTest(FILENAME, SUBST, OUTPUT, TESTNAME, CLANG, CLANGCC,
 
     # Write script file
     f = open(SCRIPT,'w')
-    f.write(' &&\n'.join(scriptLines))
+    if kSystemName == 'Windows':
+        f.write('\nif %ERRORLEVEL% NEQ 0 EXIT\n'.join(scriptLines))
+        f.write('\n')
+    else:
+        f.write(' &&\n'.join(scriptLines))
     f.close()
 
     outputFile = open(OUTPUT,'w')