From 0f3bd3e6a8e0cfb9049a32504b3add02fff40862 Mon Sep 17 00:00:00 2001 From: k0kubun Date: Tue, 11 Sep 2018 11:09:59 +0000 Subject: [PATCH] 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 --- test/ruby/test_jit.rb | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/test/ruby/test_jit.rb b/test/ruby/test_jit.rb index 3fbc26cd15..50f318c2a7 100644 --- a/test/ruby/test_jit.rb +++ b/test/ruby/test_jit.rb @@ -580,24 +580,26 @@ class TestJIT < Test::Unit::TestCase i += 1 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| l.match?(/\AJIT compaction \(\d+\.\dms\): Compacted \d+ methods ->/) end 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 - assert_equal("Too many JIT code -- 1 units unloaded\n", errs[10]) - assert_match(/\A#{JIT_SUCCESS_PREFIX}: mjit10@\(eval\):/, errs[11]) + assert_equal("Too many JIT code -- 1 units unloaded\n", errs[10], debug_info) + 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, # it should trigger compaction. 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 # verify .o files are deleted on unload_units - assert_send([Dir, :empty?, dir]) + assert_send([Dir, :empty?, dir], debug_info) end end