diff --git a/Rakefile b/Rakefile index 0ea6c54b3..765ee7151 100644 --- a/Rakefile +++ b/Rakefile @@ -25,12 +25,12 @@ test_config = lambda do |t| t.test_files = FileList["test/**/*_test.rb"].reject do |path| path =~ %r{test/stdlib/} end - if defined?(RubyMemcheck) - if t.is_a?(RubyMemcheck::TestTask) + # if defined?(RubyMemcheck) + # if t.is_a?(RubyMemcheck::TestTask) t.verbose = true t.options = '-v' - end - end + # end + # end end Rake::TestTask.new(test: :compile, &test_config) @@ -238,6 +238,8 @@ task :stdlib_test => :compile do test_files.shuffle! end + ENV["TESTOPTS"] ||= "--verbose" + sh "#{ruby} -Ilib #{bin}/test_runner.rb #{test_files.join(' ')}" # TODO: Ractor tests need to be run in a separate process sh "#{ruby} -Ilib #{bin}/test_runner.rb test/stdlib/CGI-escape_test.rb" diff --git a/bin/test_runner.rb b/bin/test_runner.rb index c63113ba3..e474ba3ec 100755 --- a/bin/test_runner.rb +++ b/bin/test_runner.rb @@ -18,6 +18,8 @@ /cannot load such file -- #{lib}/ end +require 'test/unit' + ARGV.each do |arg| begin load arg @@ -29,3 +31,14 @@ end end end + +args = [] + +unless ENV["TESTOPTS"].nil? + require "shellwords" + args.concat Shellwords.shellsplit(ENV["TESTOPTS"]) +end + +exit Test::Unit::AutoRunner.run(false, nil, args) + + diff --git a/test/stdlib/ObjectSpace_test.rb b/test/stdlib/ObjectSpace_test.rb index bfbaab3e2..5e369e9ed 100644 --- a/test/stdlib/ObjectSpace_test.rb +++ b/test/stdlib/ObjectSpace_test.rb @@ -189,6 +189,10 @@ def test_reachable_objects_from ObjectSpace, :reachable_objects_from, nil end + def test_reachable_objects_from_root_no_assertion + ObjectSpace.reachable_objects_from_root + end + def test_reachable_objects_from_root assert_send_type "() -> Hash[String, untyped]", ObjectSpace, :reachable_objects_from_root