diff options
author | Takashi Kokubun <takashikkbn@gmail.com> | 2022-05-20 21:31:00 -0700 |
---|---|---|
committer | Takashi Kokubun <takashikkbn@gmail.com> | 2022-05-20 21:32:55 -0700 |
commit | ead96e7b44b98bef4896d836239345012821f1d2 (patch) | |
tree | 355a7f48a0691e65600864476a1289598b0c79f1 | |
parent | aef36bb9333bdafcc5af44dcd77942656f52b802 (diff) |
Rename test_jit to test_mjit
to avoid confusion with YJIT
-rw-r--r-- | .github/workflows/compilers.yml | 4 | ||||
-rw-r--r-- | test/ruby/test_mjit.rb (renamed from test/ruby/test_jit.rb) | 18 | ||||
-rw-r--r-- | test/ruby/test_mjit_debug.rb (renamed from test/ruby/test_jit_debug.rb) | 8 | ||||
-rw-r--r-- | test/ruby/test_rubyoptions.rb | 2 | ||||
-rw-r--r-- | test/ruby/test_rubyvm_mjit.rb (renamed from test/ruby/test_rubyvm_jit.rb) | 0 | ||||
-rw-r--r-- | test/ruby/test_yjit.rb | 2 | ||||
-rw-r--r-- | tool/lib/test/unit.rb | 12 |
7 files changed, 23 insertions, 23 deletions
diff --git a/.github/workflows/compilers.yml b/.github/workflows/compilers.yml index 886cbd3cd1..ee7f9293d1 100644 --- a/.github/workflows/compilers.yml +++ b/.github/workflows/compilers.yml @@ -251,8 +251,8 @@ jobs: # FIXME: Skip MJIT tests failing in the annocheck case. # https://bugs.ruby-lang.org/issues/18781 - run: | - rm test/ruby/test_jit.rb - rm test/ruby/test_rubyvm_jit.rb + rm test/ruby/test_mjit.rb + rm test/ruby/test_rubyvm_mjit.rb if: ${{ endsWith(matrix.entry.name, 'annocheck') }} working-directory: src - run: make test-all TESTS='-- ruby -ext-' diff --git a/test/ruby/test_jit.rb b/test/ruby/test_mjit.rb index 3e3da24641..30c5659c14 100644 --- a/test/ruby/test_jit.rb +++ b/test/ruby/test_mjit.rb @@ -3,8 +3,8 @@ require 'test/unit' require 'tmpdir' require_relative '../lib/jit_support' -# Test for --jit option -class TestJIT < Test::Unit::TestCase +# Test for --mjit option +class TestMJIT < Test::Unit::TestCase include JITSupport IGNORABLE_PATTERNS = [ @@ -31,7 +31,7 @@ class TestJIT < Test::Unit::TestCase :opt_invokebuiltin_delegate, ].each do |insn| if !RubyVM::INSTRUCTION_NAMES.include?(insn.to_s) - warn "instruction #{insn.inspect} is not defined but included in TestJIT::TEST_PENDING_INSNS" + warn "instruction #{insn.inspect} is not defined but included in TestMJIT::TEST_PENDING_INSNS" end end @@ -46,17 +46,17 @@ class TestJIT < Test::Unit::TestCase # ci.rvm.jp caches its build environment. Clean up temporary files left by SEGV. if ENV['RUBY_DEBUG']&.include?('ci') Dir.glob("#{ENV.fetch('TMPDIR', '/tmp')}/_ruby_mjit_p*u*.*").each do |file| - puts "test/ruby/test_jit.rb: removing #{file}" + puts "test/ruby/test_mjit.rb: removing #{file}" File.unlink(file) end end - # ruby -w -Itest/lib test/ruby/test_jit.rb + # ruby -w -Itest/lib test/ruby/test_mjit.rb if $VERBOSE pid = $$ at_exit do - if pid == $$ && !TestJIT.untested_insns.empty? - warn "you may want to add tests for following insns, when you have a chance: #{TestJIT.untested_insns.join(' ')}" + if pid == $$ && !TestMJIT.untested_insns.empty? + warn "you may want to add tests for following insns, when you have a chance: #{TestMJIT.untested_insns.join(' ')}" end end end @@ -620,7 +620,7 @@ class TestJIT < Test::Unit::TestCase end; end - def test_jit_output + def test_mjit_output out, err = eval_with_jit('5.times { puts "MJIT" }', verbose: 1, min_calls: 5) assert_equal("MJIT\n" * 5, out) assert_match(/^#{JIT_SUCCESS_PREFIX}: block in <main>@-e:1 -> .+_ruby_mjit_p\d+u\d+\.c$/, err) @@ -1237,7 +1237,7 @@ class TestJIT < Test::Unit::TestCase $stderr.puts warn "'#{insn}' insn is not included in the script. Actual insns are: #{used_insns.join(' ')}\n", uplevel: uplevel end - TestJIT.untested_insns.delete(insn) + TestMJIT.untested_insns.delete(insn) end # Collect block's insns or defined method's insns, which are expected to be JIT-ed. diff --git a/test/ruby/test_jit_debug.rb b/test/ruby/test_mjit_debug.rb index b8dc9416ef..0b50acc68d 100644 --- a/test/ruby/test_jit_debug.rb +++ b/test/ruby/test_mjit_debug.rb @@ -1,13 +1,13 @@ -require_relative 'test_jit' +require_relative 'test_mjit' -return unless defined?(TestJIT) +return unless defined?(TestMJIT) return if ENV.key?('APPVEYOR') return if ENV.key?('RUBYCI_NICKNAME') return if ENV['RUBY_DEBUG']&.include?('ci') # ci.rvm.jp return if /mswin/ =~ RUBY_PLATFORM -class TestJITDebug < TestJIT - @@test_suites.delete TestJIT if self.respond_to? :on_parallel_worker? +class TestMJITDebug < TestMJIT + @@test_suites.delete TestMJIT if self.respond_to? :on_parallel_worker? def setup super diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb index b7dfbd25c4..ab15006e4c 100644 --- a/test/ruby/test_rubyoptions.rb +++ b/test/ruby/test_rubyoptions.rb @@ -1122,7 +1122,7 @@ class TestRubyOptions < Test::Unit::TestCase assert_in_out_err([IO::NULL], success: true) end - def test_jit_debug + def test_mjit_debug # mswin uses prebuilt precompiled header. Thus it does not show a pch compilation log to check "-O0 -O1". if JITSupport.supported? && !RUBY_PLATFORM.match?(/mswin/) env = { 'MJIT_SEARCH_BUILD_DIR' => 'true' } diff --git a/test/ruby/test_rubyvm_jit.rb b/test/ruby/test_rubyvm_mjit.rb index 5449c6226d..5449c6226d 100644 --- a/test/ruby/test_rubyvm_jit.rb +++ b/test/ruby/test_rubyvm_mjit.rb diff --git a/test/ruby/test_yjit.rb b/test/ruby/test_yjit.rb index bf6345faa6..1d93ac9b59 100644 --- a/test/ruby/test_yjit.rb +++ b/test/ruby/test_yjit.rb @@ -11,7 +11,7 @@ require_relative '../lib/jit_support' return unless defined?(RubyVM::YJIT) && RubyVM::YJIT.enabled? # Tests for YJIT with assertions on compilation and side exits -# insipired by the MJIT tests in test/ruby/test_jit.rb +# insipired by the MJIT tests in test/ruby/test_mjit.rb class TestYJIT < Test::Unit::TestCase def test_yjit_in_ruby_description assert_includes(RUBY_DESCRIPTION, '+YJIT') diff --git a/tool/lib/test/unit.rb b/tool/lib/test/unit.rb index 74af13c667..ba3685d1ef 100644 --- a/tool/lib/test/unit.rb +++ b/tool/lib/test/unit.rb @@ -74,16 +74,16 @@ module Test end end - module JITFirst + module MJITFirst def group(list) - # JIT first - jit, others = list.partition {|e| /test_jit/ =~ e} - jit + others + # MJIT first + mjit, others = list.partition {|e| /test_mjit/ =~ e} + mjit + others end end class Alpha < NoSort - include JITFirst + include MJITFirst def sort_by_name(list) list.sort_by(&:name) @@ -97,7 +97,7 @@ module Test # shuffle test suites based on CRC32 of their names Shuffle = Struct.new(:seed, :salt) do - include JITFirst + include MJITFirst def initialize(seed) self.class::CRC_TBL ||= (0..255).map {|i| |