Skip to content

Commit c70e33c

Browse files
committed
Improve CRASH Message: Scripts
Scripts can also cause `test.crashes` to be true, but they often do not contain a backtrace. The message "CRASHED (backtraces produced)" is then misleading, so we change it to "CRASHED (script failed)" if we cannot find backtraces in the test.
1 parent e688212 commit c70e33c

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

test_report.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -377,11 +377,14 @@ def report_single_test(suite, test, tests, failure_msg=None):
377377
suite.log.testfail(f"{test.name} COMPILE FAILED")
378378
elif test.crashed:
379379
sf.write("CRASHED\n")
380-
for btf in test.backtrace:
381-
suite.log.warn(f"+++ Next backtrace: {btf} +++")
382-
suite.log.warn(open(btf, 'r').read())
383-
suite.log.warn(f"+++ End of backtrace: {btf} +++\n")
384-
suite.log.testfail(f"{test.name} CRASHED (backtraces produced)")
380+
if len(test.backtrace) > 0:
381+
for btf in test.backtrace:
382+
suite.log.warn(f"+++ Next backtrace: {btf} +++")
383+
suite.log.warn(open(btf, 'r').read())
384+
suite.log.warn(f"+++ End of backtrace: {btf} +++\n")
385+
suite.log.testfail(f"{test.name} CRASHED (backtraces produced)")
386+
else:
387+
suite.log.testfail(f"{test.name} CRASHED (script failed)")
385388
else:
386389
sf.write("FAILED\n")
387390
suite.log.testfail(f"{test.name} FAILED")

0 commit comments

Comments
 (0)