summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2011-03-05 09:46:53 +0000
committerNAKAMURA Takumi <geek4civic@gmail.com>2011-03-05 09:46:53 +0000
commit250c357ce7876074c1e294cee2849ccd389e681b (patch)
treed7f553a40c88b51936d1b9f8e5ad5a9bf8b1b4b8
parente9dc4d309ab19e96febd18a3fe7de84cd94eef33 (diff)
downloadbcm5719-llvm-250c357ce7876074c1e294cee2849ccd389e681b.tar.gz
bcm5719-llvm-250c357ce7876074c1e294cee2849ccd389e681b.zip
utils/lit/lit/TestRunner.py: bash is available with MSYS on Python/W32. Then we can execute "bash tests".
llvm-svn: 127074
-rw-r--r--llvm/utils/lit/lit/TestRunner.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/llvm/utils/lit/lit/TestRunner.py b/llvm/utils/lit/lit/TestRunner.py
index dba78143bee..80d0ba11839 100644
--- a/llvm/utils/lit/lit/TestRunner.py
+++ b/llvm/utils/lit/lit/TestRunner.py
@@ -337,23 +337,28 @@ def executeTclScriptInternal(test, litConfig, tmpBase, commands, cwd):
return out, err, exitCode
def executeScript(test, litConfig, tmpBase, commands, cwd):
+ bashPath = litConfig.getBashPath();
+ isWin32CMDEXE = (litConfig.isWindows and not bashPath)
script = tmpBase + '.script'
- if litConfig.isWindows:
+ if isWin32CMDEXE:
script += '.bat'
# Write script file
f = open(script,'w')
- if litConfig.isWindows:
+ if isWin32CMDEXE:
f.write('\nif %ERRORLEVEL% NEQ 0 EXIT\n'.join(commands))
else:
f.write(' &&\n'.join(commands))
f.write('\n')
f.close()
- if litConfig.isWindows:
+ if isWin32CMDEXE:
command = ['cmd','/c', script]
else:
- command = ['/bin/sh', script]
+ if bashPath:
+ command = [bashPath, script]
+ else:
+ command = ['/bin/sh', script]
if litConfig.useValgrind:
# FIXME: Running valgrind on sh is overkill. We probably could just
# run on clang with no real loss.
@@ -553,7 +558,7 @@ def executeShTest(test, litConfig, useExternalSh):
if test.config.unsupported:
return (Test.UNSUPPORTED, 'Test is unsupported')
- res = parseIntegratedTestScript(test)
+ res = parseIntegratedTestScript(test, useExternalSh)
if len(res) == 2:
return res
OpenPOWER on IntegriCloud