diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-04-27 07:39:00 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-04-27 07:39:00 +0000 |
commit | ef7a297bc7583da3c849c20402f5f3af3ec0dc13 (patch) | |
tree | d8455c16f51a2a271808745344e117c234c5448d /test/ruby | |
parent | 5291fd86e917773080b70f46cc542870e2088116 (diff) | |
download | ruby-ef7a297bc7583da3c849c20402f5f3af3ec0dc13.tar.gz |
mjit.c: clean so file on Windows
* mjit.c (dlclose): use FreeLibrary to manage the reference count
on the loaded module properly.
* mjit.c (clean_so_file): clean shared object file after unloaded,
in-use files cannot be removed on Windows.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63273 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_jit.rb | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/test/ruby/test_jit.rb b/test/ruby/test_jit.rb index b6cc48f80d..7542f8087e 100644 --- a/test/ruby/test_jit.rb +++ b/test/ruby/test_jit.rb @@ -564,6 +564,16 @@ class TestJIT < Test::Unit::TestCase end; end + def test_clean_so + Dir.mktmpdir("jit_test_clean_so_") do |dir| + code = "x = 0; 10.times {|i|x+=i}" + eval_with_jit({"TMPDIR"=>dir}, code) + assert_send([Dir, :empty?, dir]) + eval_with_jit({"TMPDIR"=>dir}, code, save_temps: true) + assert_not_send([Dir, :empty?, dir]) + end + end + private # The shortest way to test one proc @@ -606,7 +616,7 @@ class TestJIT < Test::Unit::TestCase # Run Ruby script with --jit-wait (Synchronous JIT compilation). # Returns [stdout, stderr] - def eval_with_jit(script, **opts) + def eval_with_jit(env = nil, script, **opts) stdout, stderr, status = super assert_equal(true, status.success?, "Failed to run script with JIT:\n#{code_block(script)}\nstdout:\n#{code_block(stdout)}\nstderr:\n#{code_block(stderr)}") [stdout, stderr] |