ruby-changes:51082
From: k0kubun <ko1@a...>
Date: Sat, 28 Apr 2018 18:22:14 +0900 (JST)
Subject: [ruby-changes:51082] k0kubun:r63289 (trunk): test_open3.rb: let test_popen2 work with --jit
k0kubun 2018-04-28 18:22:07 +0900 (Sat, 28 Apr 2018) New Revision: 63289 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=63289 Log: test_open3.rb: let test_popen2 work with --jit test/lib/jit_support.rb: add .remove_mjit_logs to normalize stderr Modified files: trunk/test/lib/jit_support.rb trunk/test/test_open3.rb Index: test/test_open3.rb =================================================================== --- test/test_open3.rb (revision 63288) +++ test/test_open3.rb (revision 63289) @@ -2,6 +2,7 @@ https://github.com/ruby/ruby/blob/trunk/test/test_open3.rb#L2 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 https://github.com/ruby/ruby/blob/trunk/test/test_open3.rb#L127 i.close STDERR.reopen(old) assert_equal("zo", o.read) - assert_equal("ze", r.read) + assert_equal("ze", JITSupport.remove_mjit_logs(r.read)) } } } Index: test/lib/jit_support.rb =================================================================== --- test/lib/jit_support.rb (revision 63288) +++ test/lib/jit_support.rb (revision 63289) @@ -33,4 +33,12 @@ module JITSupport https://github.com/ruby/ruby/blob/trunk/test/lib/jit_support.rb#L33 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/