diff options
author | k0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-02-22 15:11:12 +0000 |
---|---|---|
committer | k0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-02-22 15:11:12 +0000 |
commit | 666cafbeffbb8d9db27b9c4041d9edcc4e745770 (patch) | |
tree | f6a4ea2a6e43c421a5240cc6c6de8212f18304a8 /test/ruby/test_rubyoptions.rb | |
parent | 073c8cfee453280ad4d57651a823fc02e8a6fb83 (diff) |
test_rubyoptions.rb: don't test --jit if not supported
test/lib/jit_support.rb: carved out JITSupport
test/ruby/test_jit.rb: ditto
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62533 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_rubyoptions.rb')
-rw-r--r-- | test/ruby/test_rubyoptions.rb | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb index 038d0c2db2..3a7c28afd3 100644 --- a/test/ruby/test_rubyoptions.rb +++ b/test/ruby/test_rubyoptions.rb @@ -3,6 +3,7 @@ require 'test/unit' require 'tmpdir' require 'tempfile' +require_relative '../lib/jit_support' class TestRubyOptions < Test::Unit::TestCase def write_file(filename, content) @@ -171,14 +172,16 @@ class TestRubyOptions < Test::Unit::TestCase end assert_equal([], e) end - assert_in_out_err(%w(--version --jit)) do |r, e| - assert_match(VERSION_PATTERN_WITH_JIT, r[0]) - if RubyVM::MJIT.enabled? - assert_equal(RUBY_DESCRIPTION, r[0]) - else - assert_equal(EnvUtil.invoke_ruby(['--jit', '-e', 'print RUBY_DESCRIPTION'], '', true).first, r[0]) + if JITSupport.supported? + assert_in_out_err(%w(--version --jit)) do |r, e| + assert_match(VERSION_PATTERN_WITH_JIT, r[0]) + if RubyVM::MJIT.enabled? + assert_equal(RUBY_DESCRIPTION, r[0]) + else + assert_equal(EnvUtil.invoke_ruby(['--jit', '-e', 'print RUBY_DESCRIPTION'], '', true).first, r[0]) + end + assert_equal([], e) end - assert_equal([], e) end end |