diff --git a/test/lib/jit_support.rb b/test/lib/jit_support.rb index 3b0d21094d..d00625278f 100644 --- a/test/lib/jit_support.rb +++ b/test/lib/jit_support.rb @@ -33,4 +33,12 @@ module JITSupport err.match?(JIT_SUCCESS_PREFIX) end end + + def remove_mjit_logs(stderr) + if RubyVM::MJIT.enabled? + stderr.gsub(/^MJIT warning: Skipped to compile unsupported instruction: \w+\n/m, '') + else + stderr + end + end end diff --git a/test/test_open3.rb b/test/test_open3.rb index 6011ddd733..c480b8cef1 100644 --- a/test/test_open3.rb +++ b/test/test_open3.rb @@ -2,6 +2,7 @@ require 'test/unit' require 'open3' +require_relative 'lib/jit_support' class TestOpen3 < Test::Unit::TestCase RUBY = EnvUtil.rubybin @@ -126,7 +127,7 @@ class TestOpen3 < Test::Unit::TestCase i.close STDERR.reopen(old) assert_equal("zo", o.read) - assert_equal("ze", r.read) + assert_equal("ze", JITSupport.remove_mjit_logs(r.read)) } } }