diff options
-rw-r--r-- | test/lib/jit_support.rb | 5 | ||||
-rw-r--r-- | test/ruby/test_rubyoptions.rb | 4 | ||||
-rw-r--r-- | test/ruby/test_yjit.rb | 3 |
3 files changed, 9 insertions, 3 deletions
diff --git a/test/lib/jit_support.rb b/test/lib/jit_support.rb index 6ad68f75be..c7618e03a0 100644 --- a/test/lib/jit_support.rb +++ b/test/lib/jit_support.rb @@ -62,6 +62,11 @@ module JITSupport end && !appveyor_pdb_corrupted? && !PENDING_RUBYCI_NICKNAMES.include?(ENV['RUBYCI_NICKNAME']) end + def yjit_supported? + # e.g. x86_64-linux, x64-mswin64_140, x64-mingw32, x64-mingw-ucrt + RUBY_PLATFORM.match?(/^(x86_64|x64)-/) + end + # AppVeyor's Visual Studio 2013 / 2015 are known to spuriously generate broken pch / pdb, like: # error C2859: c:\projects\ruby\x64-mswin_120\include\ruby-2.8.0\x64-mswin64_120\rb_mjit_header-2.8.0.pdb # is not the pdb file that was used when this precompiled header was created, recreate the precompiled header. diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb index 0f73eb1682..665d93fc16 100644 --- a/test/ruby/test_rubyoptions.rb +++ b/test/ruby/test_rubyoptions.rb @@ -233,7 +233,7 @@ class TestRubyOptions < Test::Unit::TestCase %w(--version --jit --disable=jit), %w(--version --enable=jit --disable=jit), %w(--version --enable-jit --disable-jit), - ] unless /^x86_64|mswin64/ =~ RUBY_PLATFORM), + ] unless JITSupport.yjit_supported?), ].each do |args| assert_in_out_err([env] + args) do |r, e| assert_match(VERSION_PATTERN, r[0]) @@ -251,7 +251,7 @@ class TestRubyOptions < Test::Unit::TestCase %w(--version --jit), %w(--version --enable=jit), %w(--version --enable-jit), - ] unless /^x86_64|mswin64/ =~ RUBY_PLATFORM), + ] unless JITSupport.yjit_supported?), ].each do |args| assert_in_out_err([env] + args) do |r, e| assert_match(VERSION_PATTERN_WITH_JIT, r[0]) diff --git a/test/ruby/test_yjit.rb b/test/ruby/test_yjit.rb index 6390ab4c01..41a6d50779 100644 --- a/test/ruby/test_yjit.rb +++ b/test/ruby/test_yjit.rb @@ -2,6 +2,7 @@ require 'test/unit' require 'envutil' require 'tmpdir' +require_relative '../lib/jit_support' return unless defined?(RubyVM::YJIT) && RubyVM::YJIT.enabled? @@ -29,7 +30,7 @@ class TestYJIT < Test::Unit::TestCase %w(--version --disable=jit --yjit), %w(--version --disable=jit --enable-jit), %w(--version --disable=jit --enable=jit), - ] if RUBY_PLATFORM.start_with?('x86_64-') && RUBY_PLATFORM !~ /mswin|mingw|msys/), + ] if JITSupport.yjit_supported?), ].each do |version_args| assert_in_out_err(version_args) do |stdout, stderr| assert_equal(RUBY_DESCRIPTION, stdout.first) |