Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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"
Expand Down
13 changes: 13 additions & 0 deletions bin/test_runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
/cannot load such file -- #{lib}/
end

require 'test/unit'

ARGV.each do |arg|
begin
load arg
Expand All @@ -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)


4 changes: 4 additions & 0 deletions test/stdlib/ObjectSpace_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading