diff options
author | Daniel Dunbar <daniel@zuster.org> | 2012-01-06 21:39:06 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2012-01-06 21:39:06 +0000 |
commit | 2d4a5bf817ba0d85ddeb34a3c7fc2bc07fda32bd (patch) | |
tree | 4c8afe343befaa289b139292fb733fe5d5c69d80 | |
parent | 3326ec18423716da3a768caae2691e7858913548 (diff) | |
download | external_llvm-2d4a5bf817ba0d85ddeb34a3c7fc2bc07fda32bd.zip external_llvm-2d4a5bf817ba0d85ddeb34a3c7fc2bc07fda32bd.tar.gz external_llvm-2d4a5bf817ba0d85ddeb34a3c7fc2bc07fda32bd.tar.bz2 |
lit/lit.TestRunner: Add an extra_substitutions argument for executeShTest --
useful for test suites which want to piggyback onto the "shtest" format style.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147684 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | utils/lit/lit/TestRunner.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/utils/lit/lit/TestRunner.py b/utils/lit/lit/TestRunner.py index 4b2d626..74220b8 100644 --- a/utils/lit/lit/TestRunner.py +++ b/utils/lit/lit/TestRunner.py @@ -425,7 +425,8 @@ def isExpectedFail(xfails, xtargets, target_triple): return True -def parseIntegratedTestScript(test, normalize_slashes=False): +def parseIntegratedTestScript(test, normalize_slashes=False, + extra_substitutions=[]): """parseIntegratedTestScript - Scan an LLVM/Clang style integrated test script and extract the lines to 'RUN' as well as 'XFAIL' and 'XTARGET' information. The RUN lines also will have variable substitution performed. @@ -452,7 +453,8 @@ def parseIntegratedTestScript(test, normalize_slashes=False): tmpBase = tmpBase.replace('\\', '/') # We use #_MARKER_# to hide %% while we do the other substitutions. - substitutions = [('%%', '#_MARKER_#')] + substitutions = list(extra_substitutions) + substitutions.extend([('%%', '#_MARKER_#')]) substitutions.extend(test.config.substitutions) substitutions.extend([('%s', sourcepath), ('%S', sourcedir), @@ -599,11 +601,12 @@ def executeTclTest(test, litConfig): return formatTestOutput(status, out, err, exitCode, failDueToStderr, script) -def executeShTest(test, litConfig, useExternalSh): +def executeShTest(test, litConfig, useExternalSh, + extra_substitutions=[]): if test.config.unsupported: return (Test.UNSUPPORTED, 'Test is unsupported') - res = parseIntegratedTestScript(test, useExternalSh) + res = parseIntegratedTestScript(test, useExternalSh, extra_substitutions) if len(res) == 2: return res |