From 943bdc2fd8f42882b239922a2feeabe5e5f9c83b Mon Sep 17 00:00:00 2001 From: Eric Fiselier Date: Sat, 20 Dec 2014 03:23:53 +0000 Subject: Split executeShTest into two parts so that it can be better leveraged by libc++ git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224672 91177308-0d34-0410-b5e6-96231b3b80d8 (cherry picked from commit 2bea59bd02fe2a448314dfba205cd748a66ac6b9) --- utils/lit/lit/TestRunner.py | 31 ++++++++++++++++++------------- 1 file 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) + -- cgit v1.1