1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

test_jit.rb: show extra debug info for #test_unload_units

failure

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64681 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
k0kubun 2018-09-11 11:09:59 +00:00
parent 6f7fafbf00
commit 0f3bd3e6a8

View file

@ -580,24 +580,26 @@ class TestJIT < Test::Unit::TestCase
i += 1 i += 1
end end
end; end;
assert_equal('012345678910', out)
debug_info = "stdout:\n```\n#{out}\n```\n\nstderr:\n```\n#{err}```\n"
assert_equal('012345678910', out, debug_info)
compactions, errs = err.lines.partition do |l| compactions, errs = err.lines.partition do |l|
l.match?(/\AJIT compaction \(\d+\.\dms\): Compacted \d+ methods ->/) l.match?(/\AJIT compaction \(\d+\.\dms\): Compacted \d+ methods ->/)
end end
10.times do |i| 10.times do |i|
assert_match(/\A#{JIT_SUCCESS_PREFIX}: mjit#{i}@\(eval\):/, errs[i]) assert_match(/\A#{JIT_SUCCESS_PREFIX}: mjit#{i}@\(eval\):/, errs[i], debug_info)
end end
assert_equal("Too many JIT code -- 1 units unloaded\n", errs[10]) assert_equal("Too many JIT code -- 1 units unloaded\n", errs[10], debug_info)
assert_match(/\A#{JIT_SUCCESS_PREFIX}: mjit10@\(eval\):/, errs[11]) assert_match(/\A#{JIT_SUCCESS_PREFIX}: mjit10@\(eval\):/, errs[11], debug_info)
# On --jit-wait, when the number of JIT-ed code reaches --jit-max-cache, # On --jit-wait, when the number of JIT-ed code reaches --jit-max-cache,
# it should trigger compaction. # it should trigger compaction.
unless RUBY_PLATFORM.match?(/mswin|mingw/) # compaction is not supported on Windows yet unless RUBY_PLATFORM.match?(/mswin|mingw/) # compaction is not supported on Windows yet
assert_equal(2, compactions.size) assert_equal(2, compactions.size, debug_info)
end end
# verify .o files are deleted on unload_units # verify .o files are deleted on unload_units
assert_send([Dir, :empty?, dir]) assert_send([Dir, :empty?, dir], debug_info)
end end
end end