aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authork0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-02 15:35:05 +0000
committerk0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-02 15:35:05 +0000
commitef3abac064ea3daa5c95309e90400aae49c198ee (patch)
tree5d94fb41789b594acc9f987c64fa095b9561a72e /test
parentd4381d2ceb725a05857e5e5f39b697f005bb5abb (diff)
downloadruby-ef3abac064ea3daa5c95309e90400aae49c198ee.tar.gz
test_jit.rb: split the test concern
Actually unload_units is working on MinGW, but putiseq is behaving badly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64163 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_jit.rb31
1 files changed, 17 insertions, 14 deletions
diff --git a/test/ruby/test_jit.rb b/test/ruby/test_jit.rb
index 4373ee338c..d0f68c41a9 100644
--- a/test/ruby/test_jit.rb
+++ b/test/ruby/test_jit.rb
@@ -163,14 +163,18 @@ class TestJIT < Test::Unit::TestCase
end
def test_compile_insn_putspecialobject_putiseq
- assert_eval_with_jit("#{<<~"begin;"}\n#{<<~"end;"}", stdout: 'hello', success_count: 2, insns: %i[putspecialobject putiseq])
+ if /mingw/ =~ RUBY_PLATFORM
+ skip "this is currently failing on MinGW [Bug #14948]"
+ end
+
+ assert_eval_with_jit("#{<<~"begin;"}\n#{<<~"end;"}", stdout: 'hellohello', success_count: 2, insns: %i[putspecialobject putiseq])
begin;
- print proc {
+ print 2.times.map {
def method_definition
'hello'
end
method_definition
- }.call
+ }.join
end;
end
@@ -534,37 +538,36 @@ class TestJIT < Test::Unit::TestCase
end
def test_unload_units
- if /mingw/ =~ RUBY_PLATFORM
- skip "this is currently failing on MinGW [Bug #14948]"
- end
-
Dir.mktmpdir("jit_test_unload_units_") do |dir|
# MIN_CACHE_SIZE is 10
out, err = eval_with_jit({"TMPDIR"=>dir}, "#{<<~"begin;"}\n#{<<~'end;'}", verbose: 1, min_calls: 1, max_cache: 10)
begin;
- 10.times do |i|
+ i = 0
+ while i < 11
eval(<<-EOS)
def mjit#{i}
print #{i}
end
mjit#{i}
EOS
+ i += 1
end
end;
- assert_equal('0123456789', out)
+ assert_equal('012345678910', out)
compactions, errs = err.lines.partition do |l|
l.match?(/\AJIT compaction \(\d+\.\dms\): Compacted \d+ methods ->/)
end
- assert_match(/\A#{JIT_SUCCESS_PREFIX}: block in <main>@-e:/, errs[0])
- 9.times do |i|
- assert_match(/\A#{JIT_SUCCESS_PREFIX}: mjit#{i}@\(eval\):/, errs[i + 1])
+ 10.times do |i|
+ assert_match(/\A#{JIT_SUCCESS_PREFIX}: mjit#{i}@\(eval\):/, errs[i])
end
assert_equal("Too many JIT code -- 1 units unloaded\n", errs[10])
- assert_match(/\A#{JIT_SUCCESS_PREFIX}: mjit9@\(eval\):/, errs[11])
+ assert_match(/\A#{JIT_SUCCESS_PREFIX}: mjit10@\(eval\):/, errs[11])
# On --jit-wait, when the number of JIT-ed code reaches --jit-max-cache,
# it should trigger compaction.
- assert_equal(2, compactions.size)
+ unless RUBY_PLATFORM.match?(/mswin|mingw/) # compaction is not supported on Windows yet
+ assert_equal(2, compactions.size)
+ end
# verify .o files are deleted on unload_units
assert_send([Dir, :empty?, dir])