From 666cafbeffbb8d9db27b9c4041d9edcc4e745770 Mon Sep 17 00:00:00 2001 From: k0kubun Date: Thu, 22 Feb 2018 15:11:12 +0000 Subject: 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 --- test/ruby/test_rubyoptions.rb | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'test/ruby/test_rubyoptions.rb') 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 -- cgit v1.2.3