зеркало из https://github.com/github/ruby.git
MJIT: Ignore existence of .bundle.dSYM on macOS
We could fix it, but removing files in the directory recursively is tedious in C and --mjit-debug is not a concern for users. We have TestMJITDebug for detecting linker problems that are ignored by -O. It's not really for maintaining --mjit-debug itself.
This commit is contained in:
Родитель
67a9845a7a
Коммит
2931957d6f
|
@ -1,4 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
require 'shellwords'
|
||||
require 'test/unit'
|
||||
require 'tmpdir'
|
||||
require_relative '../lib/jit_support'
|
||||
|
@ -710,10 +711,12 @@ class TestMJIT < Test::Unit::TestCase
|
|||
if RUBY_PLATFORM.match?(/mswin/)
|
||||
# "Permission Denied" error is preventing to remove so file on AppVeyor/RubyCI.
|
||||
omit 'Removing so file is randomly failing on AppVeyor/RubyCI mswin due to Permission Denied.'
|
||||
else
|
||||
# verify .c files are deleted on unload_units
|
||||
assert_send([Dir, :empty?, dir], debug_info)
|
||||
end
|
||||
if RUBY_PLATFORM.match?(/darwin/)
|
||||
omit '.bundle.dSYM directory is left but removing it is not supported for now'
|
||||
end
|
||||
# verify .c files are deleted on unload_units
|
||||
assert_send([Dir, :empty?, dir], debug_info)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -998,10 +1001,13 @@ class TestMJIT < Test::Unit::TestCase
|
|||
if RUBY_PLATFORM.match?(/mswin/)
|
||||
omit 'Removing so file is randomly failing on AppVeyor/RubyCI mswin due to Permission Denied.'
|
||||
end
|
||||
if RUBY_PLATFORM.match?(/darwin/)
|
||||
omit '.bundle.dSYM directory is left but removing it is not supported for now'
|
||||
end
|
||||
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])
|
||||
assert_send([Dir, :empty?, dir], "Directory #{dir} was not empty:\n#{Dir.glob("#{dir}/*").join("\n")}\n")
|
||||
eval_with_jit({"TMPDIR"=>dir}, code, save_temps: true)
|
||||
assert_not_send([Dir, :empty?, dir])
|
||||
end
|
||||
|
@ -1012,6 +1018,9 @@ class TestMJIT < Test::Unit::TestCase
|
|||
# TODO: check call stack and close handle of code which is not on stack, and remove objects on best-effort basis
|
||||
omit 'Removing so file being used does not work on Windows'
|
||||
end
|
||||
if RUBY_PLATFORM.match?(/darwin/)
|
||||
omit '.bundle.dSYM directory is left but removing it is not supported for now'
|
||||
end
|
||||
Dir.mktmpdir("jit_test_clean_objects_on_exec_") do |dir|
|
||||
eval_with_jit({"TMPDIR"=>dir}, "#{<<~"begin;"}\n#{<<~"end;"}", min_calls: 1)
|
||||
begin;
|
||||
|
@ -1173,6 +1182,9 @@ class TestMJIT < Test::Unit::TestCase
|
|||
assert_equal("Successful MJIT finish\n" * 2, err.gsub(/^#{JIT_SUCCESS_PREFIX}:[^\n]+\n/, ''), debug_info)
|
||||
|
||||
# ensure objects are deleted
|
||||
if RUBY_PLATFORM.match?(/darwin/)
|
||||
omit '.bundle.dSYM directory is left but removing it is not supported for now'
|
||||
end
|
||||
assert_send([Dir, :empty?, dir], debug_info)
|
||||
end
|
||||
end if defined?(fork)
|
||||
|
|
Загрузка…
Ссылка в новой задаче