Rename test_jit to test_mjit
to avoid confusion with YJIT
This commit is contained in:
parent
aef36bb933
commit
ead96e7b44
4
.github/workflows/compilers.yml
vendored
4
.github/workflows/compilers.yml
vendored
@ -251,8 +251,8 @@ jobs:
|
|||||||
# FIXME: Skip MJIT tests failing in the annocheck case.
|
# FIXME: Skip MJIT tests failing in the annocheck case.
|
||||||
# https://bugs.ruby-lang.org/issues/18781
|
# https://bugs.ruby-lang.org/issues/18781
|
||||||
- run: |
|
- run: |
|
||||||
rm test/ruby/test_jit.rb
|
rm test/ruby/test_mjit.rb
|
||||||
rm test/ruby/test_rubyvm_jit.rb
|
rm test/ruby/test_rubyvm_mjit.rb
|
||||||
if: ${{ endsWith(matrix.entry.name, 'annocheck') }}
|
if: ${{ endsWith(matrix.entry.name, 'annocheck') }}
|
||||||
working-directory: src
|
working-directory: src
|
||||||
- run: make test-all TESTS='-- ruby -ext-'
|
- run: make test-all TESTS='-- ruby -ext-'
|
||||||
|
@ -3,8 +3,8 @@ require 'test/unit'
|
|||||||
require 'tmpdir'
|
require 'tmpdir'
|
||||||
require_relative '../lib/jit_support'
|
require_relative '../lib/jit_support'
|
||||||
|
|
||||||
# Test for --jit option
|
# Test for --mjit option
|
||||||
class TestJIT < Test::Unit::TestCase
|
class TestMJIT < Test::Unit::TestCase
|
||||||
include JITSupport
|
include JITSupport
|
||||||
|
|
||||||
IGNORABLE_PATTERNS = [
|
IGNORABLE_PATTERNS = [
|
||||||
@ -31,7 +31,7 @@ class TestJIT < Test::Unit::TestCase
|
|||||||
:opt_invokebuiltin_delegate,
|
:opt_invokebuiltin_delegate,
|
||||||
].each do |insn|
|
].each do |insn|
|
||||||
if !RubyVM::INSTRUCTION_NAMES.include?(insn.to_s)
|
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
|
||||||
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.
|
# ci.rvm.jp caches its build environment. Clean up temporary files left by SEGV.
|
||||||
if ENV['RUBY_DEBUG']&.include?('ci')
|
if ENV['RUBY_DEBUG']&.include?('ci')
|
||||||
Dir.glob("#{ENV.fetch('TMPDIR', '/tmp')}/_ruby_mjit_p*u*.*").each do |file|
|
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)
|
File.unlink(file)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# ruby -w -Itest/lib test/ruby/test_jit.rb
|
# ruby -w -Itest/lib test/ruby/test_mjit.rb
|
||||||
if $VERBOSE
|
if $VERBOSE
|
||||||
pid = $$
|
pid = $$
|
||||||
at_exit do
|
at_exit do
|
||||||
if pid == $$ && !TestJIT.untested_insns.empty?
|
if pid == $$ && !TestMJIT.untested_insns.empty?
|
||||||
warn "you may want to add tests for following insns, when you have a chance: #{TestJIT.untested_insns.join(' ')}"
|
warn "you may want to add tests for following insns, when you have a chance: #{TestMJIT.untested_insns.join(' ')}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -620,7 +620,7 @@ class TestJIT < Test::Unit::TestCase
|
|||||||
end;
|
end;
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_jit_output
|
def test_mjit_output
|
||||||
out, err = eval_with_jit('5.times { puts "MJIT" }', verbose: 1, min_calls: 5)
|
out, err = eval_with_jit('5.times { puts "MJIT" }', verbose: 1, min_calls: 5)
|
||||||
assert_equal("MJIT\n" * 5, out)
|
assert_equal("MJIT\n" * 5, out)
|
||||||
assert_match(/^#{JIT_SUCCESS_PREFIX}: block in <main>@-e:1 -> .+_ruby_mjit_p\d+u\d+\.c$/, err)
|
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
|
$stderr.puts
|
||||||
warn "'#{insn}' insn is not included in the script. Actual insns are: #{used_insns.join(' ')}\n", uplevel: uplevel
|
warn "'#{insn}' insn is not included in the script. Actual insns are: #{used_insns.join(' ')}\n", uplevel: uplevel
|
||||||
end
|
end
|
||||||
TestJIT.untested_insns.delete(insn)
|
TestMJIT.untested_insns.delete(insn)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Collect block's insns or defined method's insns, which are expected to be JIT-ed.
|
# Collect block's insns or defined method's insns, which are expected to be JIT-ed.
|
@ -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?('APPVEYOR')
|
||||||
return if ENV.key?('RUBYCI_NICKNAME')
|
return if ENV.key?('RUBYCI_NICKNAME')
|
||||||
return if ENV['RUBY_DEBUG']&.include?('ci') # ci.rvm.jp
|
return if ENV['RUBY_DEBUG']&.include?('ci') # ci.rvm.jp
|
||||||
return if /mswin/ =~ RUBY_PLATFORM
|
return if /mswin/ =~ RUBY_PLATFORM
|
||||||
|
|
||||||
class TestJITDebug < TestJIT
|
class TestMJITDebug < TestMJIT
|
||||||
@@test_suites.delete TestJIT if self.respond_to? :on_parallel_worker?
|
@@test_suites.delete TestMJIT if self.respond_to? :on_parallel_worker?
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
super
|
super
|
@ -1122,7 +1122,7 @@ class TestRubyOptions < Test::Unit::TestCase
|
|||||||
assert_in_out_err([IO::NULL], success: true)
|
assert_in_out_err([IO::NULL], success: true)
|
||||||
end
|
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".
|
# 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/)
|
if JITSupport.supported? && !RUBY_PLATFORM.match?(/mswin/)
|
||||||
env = { 'MJIT_SEARCH_BUILD_DIR' => 'true' }
|
env = { 'MJIT_SEARCH_BUILD_DIR' => 'true' }
|
||||||
|
@ -11,7 +11,7 @@ require_relative '../lib/jit_support'
|
|||||||
return unless defined?(RubyVM::YJIT) && RubyVM::YJIT.enabled?
|
return unless defined?(RubyVM::YJIT) && RubyVM::YJIT.enabled?
|
||||||
|
|
||||||
# Tests for YJIT with assertions on compilation and side exits
|
# 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
|
class TestYJIT < Test::Unit::TestCase
|
||||||
def test_yjit_in_ruby_description
|
def test_yjit_in_ruby_description
|
||||||
assert_includes(RUBY_DESCRIPTION, '+YJIT')
|
assert_includes(RUBY_DESCRIPTION, '+YJIT')
|
||||||
|
@ -74,16 +74,16 @@ module Test
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
module JITFirst
|
module MJITFirst
|
||||||
def group(list)
|
def group(list)
|
||||||
# JIT first
|
# MJIT first
|
||||||
jit, others = list.partition {|e| /test_jit/ =~ e}
|
mjit, others = list.partition {|e| /test_mjit/ =~ e}
|
||||||
jit + others
|
mjit + others
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class Alpha < NoSort
|
class Alpha < NoSort
|
||||||
include JITFirst
|
include MJITFirst
|
||||||
|
|
||||||
def sort_by_name(list)
|
def sort_by_name(list)
|
||||||
list.sort_by(&:name)
|
list.sort_by(&:name)
|
||||||
@ -97,7 +97,7 @@ module Test
|
|||||||
|
|
||||||
# shuffle test suites based on CRC32 of their names
|
# shuffle test suites based on CRC32 of their names
|
||||||
Shuffle = Struct.new(:seed, :salt) do
|
Shuffle = Struct.new(:seed, :salt) do
|
||||||
include JITFirst
|
include MJITFirst
|
||||||
|
|
||||||
def initialize(seed)
|
def initialize(seed)
|
||||||
self.class::CRC_TBL ||= (0..255).map {|i|
|
self.class::CRC_TBL ||= (0..255).map {|i|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user