Permalink
Browse files

tools,test: show signal code when test crashes

On every platform but `Windows`. Also, print the crash information when
using the tap reporter.

PR-URL: #7859
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
  • Loading branch information...
santigimeno committed Jul 24, 2016
1 parent bc464a8 commit df4ef63aa592a47068a180b1d73e3aed8db8562a
Showing with 12 additions and 2 deletions.
  1. +12 −2 tools/test.py
View
@@ -196,7 +196,7 @@ def Done(self):
print failed.output.stdout.strip()
print "Command: %s" % EscapeCommand(failed.command)
if failed.HasCrashed():
print "--- CRASHED ---"
print "--- %s ---" % PrintCrashed(failed.output.exit_code)
if failed.HasTimedOut():
print "--- TIMEOUT ---"
if len(self.failed) == 0:
@@ -285,6 +285,9 @@ def HasRun(self, output):
logger.info(status_line)
self._printDiagnostic("\n".join(output.diagnostic))
if output.HasCrashed():
self._printDiagnostic(PrintCrashed(output.output.exit_code))
if output.HasTimedOut():
self._printDiagnostic('TIMEOUT')
@@ -347,7 +350,7 @@ def HasRun(self, output):
print self.templates['stderr'] % stderr
print "Command: %s" % EscapeCommand(output.command)
if output.HasCrashed():
print "--- CRASHED ---"
print "--- %s ---" % PrintCrashed(output.output.exit_code)
if output.HasTimedOut():
print "--- TIMEOUT ---"
@@ -1476,6 +1479,13 @@ def FormatTime(d):
return time.strftime("%M:%S.", time.gmtime(d)) + ("%03i" % millis)
def PrintCrashed(code):
if utils.IsWindows():
return "CRASHED"
else:
return "CRASHED (Signal: %d)" % -code
def Main():
parser = BuildOptions()
(options, args) = parser.parse_args()

0 comments on commit df4ef63

Please sign in to comment.