mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-06 04:31:08 +00:00
Print a message when a test failure is due to stderr output
alone, rather than just an exit code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110208 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
56fb5f920e
commit
34f68fc040
@ -470,13 +470,17 @@ def parseIntegratedTestScript(test, normalize_slashes=False):
|
|||||||
isXFail = isExpectedFail(xfails, xtargets, test.suite.config.target_triple)
|
isXFail = isExpectedFail(xfails, xtargets, test.suite.config.target_triple)
|
||||||
return script,isXFail,tmpBase,execdir
|
return script,isXFail,tmpBase,execdir
|
||||||
|
|
||||||
def formatTestOutput(status, out, err, exitCode, script):
|
def formatTestOutput(status, out, err, exitCode, failDueToStderr, script):
|
||||||
output = StringIO.StringIO()
|
output = StringIO.StringIO()
|
||||||
print >>output, "Script:"
|
print >>output, "Script:"
|
||||||
print >>output, "--"
|
print >>output, "--"
|
||||||
print >>output, '\n'.join(script)
|
print >>output, '\n'.join(script)
|
||||||
print >>output, "--"
|
print >>output, "--"
|
||||||
print >>output, "Exit Code: %r" % exitCode
|
print >>output, "Exit Code: %r" % exitCode,
|
||||||
|
if failDueToStderr:
|
||||||
|
print >>output, "(but there was output on stderr)"
|
||||||
|
else:
|
||||||
|
print >>output
|
||||||
if out:
|
if out:
|
||||||
print >>output, "Command Output (stdout):"
|
print >>output, "Command Output (stdout):"
|
||||||
print >>output, "--"
|
print >>output, "--"
|
||||||
@ -511,8 +515,8 @@ def executeTclTest(test, litConfig):
|
|||||||
if len(res) == 2:
|
if len(res) == 2:
|
||||||
return res
|
return res
|
||||||
|
|
||||||
# Test for failure. In addition to the exit code, Tcl commands fail
|
# Test for failure. In addition to the exit code, Tcl commands are
|
||||||
# if there is any standard error output.
|
# considered to fail if there is any standard error output.
|
||||||
out,err,exitCode = res
|
out,err,exitCode = res
|
||||||
if isXFail:
|
if isXFail:
|
||||||
ok = exitCode != 0 or err
|
ok = exitCode != 0 or err
|
||||||
@ -524,7 +528,11 @@ def executeTclTest(test, litConfig):
|
|||||||
if ok:
|
if ok:
|
||||||
return (status,'')
|
return (status,'')
|
||||||
|
|
||||||
return formatTestOutput(status, out, err, exitCode, script)
|
# Set a flag for formatTestOutput so it can explain why the test was
|
||||||
|
# considered to have failed, despite having an exit code of 0.
|
||||||
|
failDueToStderr = exitCode == 0 and err
|
||||||
|
|
||||||
|
return formatTestOutput(status, out, err, exitCode, failDueToStderr, script)
|
||||||
|
|
||||||
def executeShTest(test, litConfig, useExternalSh):
|
def executeShTest(test, litConfig, useExternalSh):
|
||||||
if test.config.unsupported:
|
if test.config.unsupported:
|
||||||
@ -560,4 +568,7 @@ def executeShTest(test, litConfig, useExternalSh):
|
|||||||
if ok:
|
if ok:
|
||||||
return (status,'')
|
return (status,'')
|
||||||
|
|
||||||
return formatTestOutput(status, out, err, exitCode, script)
|
# Sh tests are not considered to fail just from stderr output.
|
||||||
|
failDueToStderr = False
|
||||||
|
|
||||||
|
return formatTestOutput(status, out, err, exitCode, failDueToStderr, script)
|
||||||
|
Loading…
Reference in New Issue
Block a user