ruby-changes:51799
From: k0kubun <ko1@a...>
Date: Sun, 22 Jul 2018 11:53:48 +0900 (JST)
Subject: [ruby-changes:51799] k0kubun:r64011 (trunk): test_rubyoptions.rb: allow passing test_verbose
k0kubun 2018-07-22 11:53:38 +0900 (Sun, 22 Jul 2018) New Revision: 64011 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=64011 Log: test_rubyoptions.rb: allow passing test_verbose with --jit. `./ruby --jit -Itest/lib test/ruby/test_rubyoptions.rb -n "TestRubyOptions#test_verbose"` has failed without -DMJIT_FORCE_ENABLE like: 1) Failure: TestRubyOptions#test_verbose [/home/travis/build/k0kubun/mjit-test/test/ruby/test_rubyoptions.rb:118]: <"ruby 2.6.0dev (2018-07-21 trunk 64010) +JIT [x86_64-linux]"> expected but was <"ruby 2.6.0dev (2018-07-21 trunk 64010) [x86_64-linux]">. but the test should pass even without -DMJIT_FORCE_ENABLE. Modified files: trunk/test/ruby/test_rubyoptions.rb Index: test/ruby/test_rubyoptions.rb =================================================================== --- test/ruby/test_rubyoptions.rb (revision 64010) +++ test/ruby/test_rubyoptions.rb (revision 64011) @@ -117,7 +117,11 @@ class TestRubyOptions < Test::Unit::Test https://github.com/ruby/ruby/blob/trunk/test/ruby/test_rubyoptions.rb#L117 def test_verbose assert_in_out_err(["-vve", ""]) do |r, e| assert_match(VERSION_PATTERN, r[0]) - assert_equal(RUBY_DESCRIPTION, r[0]) + if RubyVM::MJIT.enabled? && !mjit_force_enabled? + assert_equal(NO_JIT_DESCRIPTION, r[0]) + else + assert_equal(RUBY_DESCRIPTION, r[0]) + end assert_equal([], e) end @@ -1063,4 +1067,10 @@ class TestRubyOptions < Test::Unit::Test https://github.com/ruby/ruby/blob/trunk/test/ruby/test_rubyoptions.rb#L1067 skip "#{IO::NULL} is not a character device" unless File.chardev?(IO::NULL) assert_in_out_err([IO::NULL], success: true) end + + private + + def mjit_force_enabled? + "#{RbConfig::CONFIG['CFLAGS']} #{RbConfig::CONFIG['CPPFLAGS']}".match?(/(\A|\s)-D ?MJIT_FORCE_ENABLE\b/) + end end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/