summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authork0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-07-22 02:53:38 +0000
committerk0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-07-22 02:53:38 +0000
commit4e1f20679f9debf04a95f84a830b6f7b757f1f53 (patch)
tree79fa34384d8cf6ec1e406afdda6d7cd9c0da294b
parent85402fa3b59f1f80865c40105b0d7d84077dd292 (diff)
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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64011 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--test/ruby/test_rubyoptions.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb
index c87bf4247a7..2d50adc9aa6 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