From 960d059ef71901980c95cd28013b7a93bc3f83d5 Mon Sep 17 00:00:00 2001 From: eregon Date: Mon, 1 Apr 2019 20:45:55 +0000 Subject: Simplify spec as there is no easy way to tell if MJIT support is available git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67403 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- spec/ruby/command_line/feature_spec.rb | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'spec/ruby/command_line') diff --git a/spec/ruby/command_line/feature_spec.rb b/spec/ruby/command_line/feature_spec.rb index 66cc0cb71a..b2b6284bc4 100644 --- a/spec/ruby/command_line/feature_spec.rb +++ b/spec/ruby/command_line/feature_spec.rb @@ -39,22 +39,10 @@ describe "The --enable and --disable flags" do ruby_version_is "2.6" do it "can be used with jit" do + # Only test if it can be disabled, because MJIT does not support all platforms, and + # it can be disabled at build time with `./configure --disable-jit-support`. ruby_exe("p RubyVM::MJIT.enabled?", options: "--disable=jit").chomp.should == "false" ruby_exe("p RubyVM::MJIT.enabled?", options: "--disable-jit").chomp.should == "false" - - mjit_disabled = false - begin - warning = IO.popen([RbConfig.ruby, '--jit-warning', '-e', ''], err: [:child, :out], &:read) - mjit_disabled = warning.include?('warning: MJIT support is disabled.') # ./configure --disable-jit-support - rescue Errno::ENOENT # for msys2 https://ci.appveyor.com/project/ruby/ruby/builds/23429035/job/dvjqa34m9pxvv2nt - end - if mjit_disabled - ruby_exe("p RubyVM::MJIT.enabled?", options: "--enable=jit").chomp.should == "false" - ruby_exe("p RubyVM::MJIT.enabled?", options: "--enable-jit").chomp.should == "false" - else - ruby_exe("p RubyVM::MJIT.enabled?", options: "--enable=jit").chomp.should == "true" - ruby_exe("p RubyVM::MJIT.enabled?", options: "--enable-jit").chomp.should == "true" - end end end -- cgit v1.2.3