summaryrefslogtreecommitdiffstats
path: root/utils/lit/TestRunner.py
diff options
context:
space:
mode:
Diffstat (limited to 'utils/lit/TestRunner.py')
-rw-r--r--utils/lit/TestRunner.py26
1 files changed, 9 insertions, 17 deletions
diff --git a/utils/lit/TestRunner.py b/utils/lit/TestRunner.py
index bee1167..20fbc6c 100644
--- a/utils/lit/TestRunner.py
+++ b/utils/lit/TestRunner.py
@@ -112,6 +112,9 @@ def executeShCmd(cmd, cfg, cwd, results):
r[2] = tempfile.TemporaryFile(mode=r[1])
else:
r[2] = open(r[0], r[1])
+ # Workaround a Win32 and/or subprocess bug when appending.
+ if r[1] == 'a':
+ r[2].seek(0, 2)
result = r[2]
final_redirects.append(result)
@@ -350,7 +353,7 @@ def isExpectedFail(xfails, xtargets, target_triple):
return True
-def parseIntegratedTestScript(test, requireAndAnd):
+def parseIntegratedTestScript(test):
"""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.
@@ -364,6 +367,8 @@ def parseIntegratedTestScript(test, requireAndAnd):
execpath = test.getExecPath()
execdir,execbase = os.path.split(execpath)
tmpBase = os.path.join(execdir, 'Output', execbase)
+ if test.index is not None:
+ tmpBase += '_%d' % test.index
# We use #_MARKER_# to hide %% while we do the other substitutions.
substitutions = [('%%', '#_MARKER_#')]
@@ -422,19 +427,6 @@ def parseIntegratedTestScript(test, requireAndAnd):
if script[-1][-1] == '\\':
return (Test.UNRESOLVED, "Test has unterminated run lines (with '\\')")
- # Validate interior lines for '&&', a lovely historical artifact.
- if requireAndAnd:
- for i in range(len(script) - 1):
- ln = script[i]
-
- if not ln.endswith('&&'):
- return (Test.FAIL,
- ("MISSING \'&&\': %s\n" +
- "FOLLOWED BY : %s\n") % (ln, script[i + 1]))
-
- # Strip off '&&'
- script[i] = ln[:-2]
-
isXFail = isExpectedFail(xfails, xtargets, test.suite.config.target_triple)
return script,isXFail,tmpBase,execdir
@@ -459,7 +451,7 @@ def executeTclTest(test, litConfig):
if test.config.unsupported:
return (Test.UNSUPPORTED, 'Test is unsupported')
- res = parseIntegratedTestScript(test, False)
+ res = parseIntegratedTestScript(test)
if len(res) == 2:
return res
@@ -488,11 +480,11 @@ def executeTclTest(test, litConfig):
return formatTestOutput(status, out, err, exitCode, script)
-def executeShTest(test, litConfig, useExternalSh, requireAndAnd):
+def executeShTest(test, litConfig, useExternalSh):
if test.config.unsupported:
return (Test.UNSUPPORTED, 'Test is unsupported')
- res = parseIntegratedTestScript(test, requireAndAnd)
+ res = parseIntegratedTestScript(test)
if len(res) == 2:
return res
OpenPOWER on IntegriCloud