[llvm-commits] [llvm] r147684 - /llvm/trunk/utils/lit/lit/TestRunner.py
Daniel Dunbar
daniel at zuster.org
Fri Jan 6 13:39:06 PST 2012
Author: ddunbar
Date: Fri Jan 6 15:39:06 2012
New Revision: 147684
URL: http://llvm.org/viewvc/llvm-project?rev=147684&view=rev
Log:
lit/lit.TestRunner: Add an extra_substitutions argument for executeShTest --
useful for test suites which want to piggyback onto the "shtest" format style.
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=147684&r1=147683&r2=147684&view=diff
==============================================================================
--- llvm/trunk/utils/lit/lit/TestRunner.py (original)
+++ llvm/trunk/utils/lit/lit/TestRunner.py Fri Jan 6 15:39:06 2012
@@ -425,7 +425,8 @@
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 @@
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 @@
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
More information about the llvm-commits
mailing list