Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit fecf611

Browse filesBrowse files
santigimenocjihrig
authored andcommitted
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>
1 parent 10f0c94 commit fecf611
Copy full SHA for fecf611

File tree

Expand file treeCollapse file tree

1 file changed

+12
-2
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+12
-2
lines changed
Open diff view settings
Collapse file

‎tools/test.py‎

Copy file name to clipboardExpand all lines: tools/test.py
+12-2Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ def Done(self):
196196
print failed.output.stdout.strip()
197197
print "Command: %s" % EscapeCommand(failed.command)
198198
if failed.HasCrashed():
199-
print "--- CRASHED ---"
199+
print "--- %s ---" % PrintCrashed(failed.output.exit_code)
200200
if failed.HasTimedOut():
201201
print "--- TIMEOUT ---"
202202
if len(self.failed) == 0:
@@ -285,6 +285,9 @@ def HasRun(self, output):
285285
logger.info(status_line)
286286
self._printDiagnostic("\n".join(output.diagnostic))
287287

288+
if output.HasCrashed():
289+
self._printDiagnostic(PrintCrashed(output.output.exit_code))
290+
288291
if output.HasTimedOut():
289292
self._printDiagnostic('TIMEOUT')
290293

@@ -347,7 +350,7 @@ def HasRun(self, output):
347350
print self.templates['stderr'] % stderr
348351
print "Command: %s" % EscapeCommand(output.command)
349352
if output.HasCrashed():
350-
print "--- CRASHED ---"
353+
print "--- %s ---" % PrintCrashed(output.output.exit_code)
351354
if output.HasTimedOut():
352355
print "--- TIMEOUT ---"
353356

@@ -1476,6 +1479,13 @@ def FormatTime(d):
14761479
return time.strftime("%M:%S.", time.gmtime(d)) + ("%03i" % millis)
14771480

14781481

1482+
def PrintCrashed(code):
1483+
if utils.IsWindows():
1484+
return "CRASHED"
1485+
else:
1486+
return "CRASHED (Signal: %d)" % -code
1487+
1488+
14791489
def Main():
14801490
parser = BuildOptions()
14811491
(options, args) = parser.parse_args()

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.