Merge pull request #5013 from shuujii/print-exception-backtrace-if-possible-without--v-in-test

Print exception backtrace if possible without `-v` in test
This commit is contained in:
Yukihiro "Matz" Matsumoto
2020-06-08 09:59:43 +09:00
committed by GitHub
+2 -3
View File
@@ -64,7 +64,7 @@ def assertion_string(err, str, iso=nil, e=nil, bt=nil)
msg += "\n#{diff}" if diff && !diff.empty?
end
end
msg += "\nbacktrace:\n #{bt.join("\n ")}" if bt
msg += "\nbacktrace:\n #{bt.join("\n ")}" if bt && !bt.empty?
msg
end
@@ -122,8 +122,7 @@ def assert(str = 'assert', iso = '')
$mrbtest_child_noassert[-2] += 1
t_print('?')
rescue Exception => e
bt = e.backtrace if $mrbtest_verbose
$asserts.push(assertion_string("#{e.class}: ", str, iso, e, bt))
$asserts.push(assertion_string("#{e.class}: ", str, iso, e, e.backtrace))
$kill_test += 1
t_print('X')
ensure