diff options
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_yjit.rb | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/test/ruby/test_yjit.rb b/test/ruby/test_yjit.rb index fa357b4977..1fe9d68b30 100644 --- a/test/ruby/test_yjit.rb +++ b/test/ruby/test_yjit.rb @@ -10,6 +10,8 @@ require_relative '../lib/jit_support' return unless JITSupport.yjit_supported? +require 'stringio' + # Tests for YJIT with assertions on compilation and side exits # insipired by the RJIT tests in test/ruby/test_rjit.rb class TestYJIT < Test::Unit::TestCase @@ -1470,8 +1472,15 @@ class TestYJIT < Test::Unit::TestCase if exits != :any && exits != recorded_exits && (exits.keys != recorded_exits.keys || !exits.all? { |k, v| v === recorded_exits[k] }) # triple-equal checks range membership or integer equality - flunk "Expected #{exits.empty? ? "no" : exits.inspect} exits" \ - ", but got\n#{recorded_exits.inspect}" + stats_reasons = StringIO.new + ::RubyVM::YJIT.send(:_print_stats_reasons, runtime_stats, stats_reasons) + stats_reasons = stats_reasons.string + flunk <<~EOM + Expected #{exits.empty? ? "no" : exits.inspect} exits, but got: + #{recorded_exits.inspect} + Reasons: + #{stats_reasons} + EOM end end |
