Unverified Commit 613e0bee authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto Committed by GitHub

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

Print exception backtrace if possible without `-v` in test
parents 78c9c71b 52ab095c
...@@ -64,7 +64,7 @@ def assertion_string(err, str, iso=nil, e=nil, bt=nil) ...@@ -64,7 +64,7 @@ def assertion_string(err, str, iso=nil, e=nil, bt=nil)
msg += "\n#{diff}" if diff && !diff.empty? msg += "\n#{diff}" if diff && !diff.empty?
end end
end end
msg += "\nbacktrace:\n #{bt.join("\n ")}" if bt msg += "\nbacktrace:\n #{bt.join("\n ")}" if bt && !bt.empty?
msg msg
end end
...@@ -122,8 +122,7 @@ def assert(str = 'assert', iso = '') ...@@ -122,8 +122,7 @@ def assert(str = 'assert', iso = '')
$mrbtest_child_noassert[-2] += 1 $mrbtest_child_noassert[-2] += 1
t_print('?') t_print('?')
rescue Exception => e rescue Exception => e
bt = e.backtrace if $mrbtest_verbose $asserts.push(assertion_string("#{e.class}: ", str, iso, e, e.backtrace))
$asserts.push(assertion_string("#{e.class}: ", str, iso, e, bt))
$kill_test += 1 $kill_test += 1
t_print('X') t_print('X')
ensure ensure
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment