aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Albert <danalbert@google.com>2015-01-09 01:56:38 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-01-09 01:56:38 +0000
commit72714e0f8a3c209461d46551ebcf111e3f35ba32 (patch)
tree4b121bcd0873e89d3d260433e97e0d405f5d5e6b
parent9cf8d9ca5aef24403867b7154f369cc831739178 (diff)
parent51f06ecc5d0f71448146f98905b1796ae88d28da (diff)
downloadexternal_llvm-72714e0f8a3c209461d46551ebcf111e3f35ba32.zip
external_llvm-72714e0f8a3c209461d46551ebcf111e3f35ba32.tar.gz
external_llvm-72714e0f8a3c209461d46551ebcf111e3f35ba32.tar.bz2
am 51f06ecc: Merge "Split executeShTest into two parts so that it can be better leveraged by libc++"
* commit '51f06ecc5d0f71448146f98905b1796ae88d28da': Split executeShTest into two parts so that it can be better leveraged by libc++
-rw-r--r--utils/lit/lit/TestRunner.py31
1 files changed, 18 insertions, 13 deletions
diff --git a/utils/lit/lit/TestRunner.py b/utils/lit/lit/TestRunner.py
index 6688029..268e46c 100644
--- a/utils/lit/lit/TestRunner.py
+++ b/utils/lit/lit/TestRunner.py
@@ -489,19 +489,8 @@ def parseIntegratedTestScript(test, normalize_slashes=False,
return script,tmpBase,execdir
-def executeShTest(test, litConfig, useExternalSh,
- extra_substitutions=[]):
- if test.config.unsupported:
- return (Test.UNSUPPORTED, 'Test is unsupported')
-
- res = parseIntegratedTestScript(test, useExternalSh, extra_substitutions)
- if isinstance(res, lit.Test.Result):
- return res
- if litConfig.noExecute:
- return lit.Test.Result(Test.PASS)
-
- script, tmpBase, execdir = res
-
+def _runShTest(test, litConfig, useExternalSh,
+ script, tmpBase, execdir):
# Create the output directory if it does not already exist.
lit.util.mkdir_p(os.path.dirname(tmpBase))
@@ -529,3 +518,19 @@ def executeShTest(test, litConfig, useExternalSh,
output += """Command Output (stderr):\n--\n%s\n--\n""" % (err,)
return lit.Test.Result(status, output)
+
+
+def executeShTest(test, litConfig, useExternalSh,
+ extra_substitutions=[]):
+ if test.config.unsupported:
+ return (Test.UNSUPPORTED, 'Test is unsupported')
+
+ res = parseIntegratedTestScript(test, useExternalSh, extra_substitutions)
+ if isinstance(res, lit.Test.Result):
+ return res
+ if litConfig.noExecute:
+ return lit.Test.Result(Test.PASS)
+
+ script, tmpBase, execdir = res
+ return _runShTest(test, litConfig, useExternalSh, script, tmpBase, execdir)
+