mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Disable tests on backtraces w/ unknown line numbers
This commit is contained in:
@@ -20,6 +20,9 @@ assert('Kernel.caller, Kernel#caller') do
|
||||
bar(*args)
|
||||
end
|
||||
end
|
||||
|
||||
skip "backtrace isn't available" if(c.new.baz(0)[0].include?("unknown"))
|
||||
|
||||
assert_equal "kernel.rb:#{caller_lineno}:in foo", c.new.baz(0)[0][-19..-1]
|
||||
assert_equal "bar", c.new.baz[0][-3..-1]
|
||||
assert_equal "foo", c.new.baz(0)[0][-3..-1]
|
||||
|
||||
@@ -7,6 +7,9 @@ def enable_debug_info?
|
||||
raise
|
||||
rescue => e
|
||||
@enable_debug_info = !e.backtrace.empty?
|
||||
if(@enable_debug_info && e.backtrace[0].include?("(unknown)"))
|
||||
@enable_debug_info = false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
+2
-1
@@ -382,7 +382,8 @@ def backtrace_available?
|
||||
begin
|
||||
raise "XXX"
|
||||
rescue => exception
|
||||
not exception.backtrace.empty?
|
||||
return false if exception.backtrace.empty?
|
||||
not exception.backtrace[0].include?("unknown")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user