summaryrefslogtreecommitdiff
path: root/test/ruby/test_jit.rb
diff options
context:
space:
mode:
authork0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-26 13:39:53 +0000
committerk0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-26 13:39:53 +0000
commit08e1705eec3b48a120d7b74aaf2da2e1396bd6d9 (patch)
tree798ab365c79f3618f3573625ba7b8f62330ea5f7 /test/ruby/test_jit.rb
parenta3bb9f1093323f8f36849882f1d536b77563149a (diff)
process.c: finish MJIT prior to #exec
to prevent ruby from leaving MJIT-related files. test_jit.rb: add a test to prevent that git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65994 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_jit.rb')
-rw-r--r--test/ruby/test_jit.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ruby/test_jit.rb b/test/ruby/test_jit.rb
index 6aee86b367..91829cbaa9 100644
--- a/test/ruby/test_jit.rb
+++ b/test/ruby/test_jit.rb
@@ -776,6 +776,18 @@ class TestJIT < Test::Unit::TestCase
end
end
+ def test_clean_objects_on_exec
+ Dir.mktmpdir("jit_test_clean_objects_on_exec_") do |dir|
+ eval_with_jit({"TMPDIR"=>dir}, "#{<<~"begin;"}\n#{<<~"end;"}", min_calls: 1)
+ begin;
+ def a; end; a
+ exec "true"
+ end;
+ error_message = "Undeleted files:\n #{Dir.glob("#{dir}/*").join("\n ")}\n"
+ assert_send([Dir, :empty?, dir], error_message)
+ end
+ end if system("which true")
+
def test_lambda_longjmp
assert_eval_with_jit("#{<<~"begin;"}\n#{<<~"end;"}", stdout: '5', success_count: 1)
begin;