[llvm] r224672 - Split executeShTest into two parts so that it can be better leveraged by libc++
Eric Fiselier
eric at efcs.ca
Fri Dec 19 19:23:53 PST 2014
Author: ericwf
Date: Fri Dec 19 21:23:53 2014
New Revision: 224672
URL: http://llvm.org/viewvc/llvm-project?rev=224672&view=rev
Log:
Split executeShTest into two parts so that it can be better leveraged by libc++
Modified:
llvm/trunk/utils/lit/lit/TestRunner.py
Modified: llvm/trunk/utils/lit/lit/TestRunner.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/lit/TestRunner.py?rev=224672&r1=224671&r2=224672&view=diff
==============================================================================
--- llvm/trunk/utils/lit/lit/TestRunner.py (original)
+++ llvm/trunk/utils/lit/lit/TestRunner.py Fri Dec 19 21:23:53 2014
@@ -489,19 +489,8 @@ def parseIntegratedTestScript(test, norm
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, useEx
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)
+
More information about the llvm-commits
mailing list