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: https://github.com/nodejs/node/pull/7859 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
This commit is contained in:
parent
bc464a8a3b
commit
df4ef63aa5
@ -196,7 +196,7 @@ class SimpleProgressIndicator(ProgressIndicator):
|
|||||||
print failed.output.stdout.strip()
|
print failed.output.stdout.strip()
|
||||||
print "Command: %s" % EscapeCommand(failed.command)
|
print "Command: %s" % EscapeCommand(failed.command)
|
||||||
if failed.HasCrashed():
|
if failed.HasCrashed():
|
||||||
print "--- CRASHED ---"
|
print "--- %s ---" % PrintCrashed(failed.output.exit_code)
|
||||||
if failed.HasTimedOut():
|
if failed.HasTimedOut():
|
||||||
print "--- TIMEOUT ---"
|
print "--- TIMEOUT ---"
|
||||||
if len(self.failed) == 0:
|
if len(self.failed) == 0:
|
||||||
@ -285,6 +285,9 @@ class TapProgressIndicator(SimpleProgressIndicator):
|
|||||||
logger.info(status_line)
|
logger.info(status_line)
|
||||||
self._printDiagnostic("\n".join(output.diagnostic))
|
self._printDiagnostic("\n".join(output.diagnostic))
|
||||||
|
|
||||||
|
if output.HasCrashed():
|
||||||
|
self._printDiagnostic(PrintCrashed(output.output.exit_code))
|
||||||
|
|
||||||
if output.HasTimedOut():
|
if output.HasTimedOut():
|
||||||
self._printDiagnostic('TIMEOUT')
|
self._printDiagnostic('TIMEOUT')
|
||||||
|
|
||||||
@ -347,7 +350,7 @@ class CompactProgressIndicator(ProgressIndicator):
|
|||||||
print self.templates['stderr'] % stderr
|
print self.templates['stderr'] % stderr
|
||||||
print "Command: %s" % EscapeCommand(output.command)
|
print "Command: %s" % EscapeCommand(output.command)
|
||||||
if output.HasCrashed():
|
if output.HasCrashed():
|
||||||
print "--- CRASHED ---"
|
print "--- %s ---" % PrintCrashed(output.output.exit_code)
|
||||||
if output.HasTimedOut():
|
if output.HasTimedOut():
|
||||||
print "--- TIMEOUT ---"
|
print "--- TIMEOUT ---"
|
||||||
|
|
||||||
@ -1476,6 +1479,13 @@ def FormatTime(d):
|
|||||||
return time.strftime("%M:%S.", time.gmtime(d)) + ("%03i" % millis)
|
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():
|
def Main():
|
||||||
parser = BuildOptions()
|
parser = BuildOptions()
|
||||||
(options, args) = parser.parse_args()
|
(options, args) = parser.parse_args()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user