diff options
author | Takashi Kokubun <takashikkbn@gmail.com> | 2022-06-08 20:47:40 -0700 |
---|---|---|
committer | Takashi Kokubun <takashikkbn@gmail.com> | 2022-06-08 21:19:03 -0700 |
commit | 2931957d6ff16b5c095f6e8095384c98130133ad (patch) | |
tree | 31fea40dbf35dc17629d9fb558a11226689323e8 | |
parent | 67a9845a7a447ddfe0f21a8ce9ab0a8309c7e2d7 (diff) | |
download | ruby-2931957d6ff16b5c095f6e8095384c98130133ad.tar.gz |
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.
-rw-r--r-- | test/ruby/test_mjit.rb | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/test/ruby/test_mjit.rb b/test/ruby/test_mjit.rb index 30c5659c14..6f1ccc8402 100644 --- a/test/ruby/test_mjit.rb +++ b/test/ruby/test_mjit.rb @@ -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) |