diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb index c87bf4247a..2d50adc9aa 100644 --- a/test/ruby/test_rubyoptions.rb +++ b/test/ruby/test_rubyoptions.rb @@ -117,7 +117,11 @@ class TestRubyOptions < Test::Unit::TestCase 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::TestCase 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