Fixed broken runner for make test-all

This commit is contained in:
Hiroshi SHIBATA 2021-09-07 11:46:12 +09:00
parent 871e7b5f55
commit 3e32412e08
Notes: git 2021-09-11 08:48:42 +09:00
3 changed files with 8 additions and 13 deletions

View File

@ -205,7 +205,7 @@ module MiniTest
end end
def _run_anything type def _run_anything type
suites = TestCase.send "#{type}_suites" suites = Test::Unit::TestCase.send "#{type}_suites"
return if suites.empty? return if suites.empty?
puts puts

View File

@ -71,7 +71,7 @@ module Test
srand(seed) srand(seed)
orig_args.unshift "--seed=#{seed}" orig_args.unshift "--seed=#{seed}"
end end
MiniTest::Unit::TestCase.test_order = order if order Test::Unit::TestCase.test_order = order if order
@help = "\n" + orig_args.map { |s| @help = "\n" + orig_args.map { |s|
" " + (s =~ /[\s|&<>$()]/ ? s.inspect : s) " " + (s =~ /[\s|&<>$()]/ ? s.inspect : s)
@ -517,7 +517,7 @@ module Test
require 'timeout' require 'timeout'
@tasks = @files.dup # Array of filenames. @tasks = @files.dup # Array of filenames.
case MiniTest::Unit::TestCase.test_order case Test::Unit::TestCase.test_order
when :random when :random
@tasks.shuffle! @tasks.shuffle!
else else
@ -1008,7 +1008,7 @@ module Test
def non_options(files, options) def non_options(files, options)
if options.delete(:gc_stress) if options.delete(:gc_stress)
MiniTest::Unit::TestCase.class_eval do Test::Unit::TestCase.class_eval do
oldrun = instance_method(:run) oldrun = instance_method(:run)
define_method(:run) do |runner| define_method(:run) do |runner|
begin begin
@ -1021,7 +1021,7 @@ module Test
end end
end end
if options.delete(:gc_compact) if options.delete(:gc_compact)
MiniTest::Unit::TestCase.class_eval do Test::Unit::TestCase.class_eval do
oldrun = instance_method(:run) oldrun = instance_method(:run)
define_method(:run) do |runner| define_method(:run) do |runner|
begin begin

View File

@ -3,8 +3,6 @@ require 'test/unit/assertions'
module Test module Test
module Unit module Unit
# remove silly TestCase class
remove_const(:TestCase) if defined?(self::TestCase)
## ##
# Provides a simple set of guards that you can use in your tests # Provides a simple set of guards that you can use in your tests
@ -163,6 +161,8 @@ module Test
# Runs the tests reporting the status to +runner+ # Runs the tests reporting the status to +runner+
def run runner def run runner
@options = runner.options
trap "INFO" do trap "INFO" do
runner.report.each_with_index do |msg, i| runner.report.each_with_index do |msg, i|
warn "\n%3d) %s" % [i + 1, msg] warn "\n%3d) %s" % [i + 1, msg]
@ -191,7 +191,7 @@ module Test
rescue *PASSTHROUGH_EXCEPTIONS rescue *PASSTHROUGH_EXCEPTIONS
raise raise
rescue Exception => e rescue Exception => e
@passed = Skip === e @passed = MiniTest::Skip === e
time = Time.now - start_time time = Time.now - start_time
runner.record self.class, self.__name__, self._assertions, time, e runner.record self.class, self.__name__, self._assertions, time, e
result = runner.puke self.class, self.__name__, e result = runner.puke self.class, self.__name__, e
@ -337,11 +337,6 @@ module Test
false false
end end
def run runner
@options = runner.options
super runner
end
def self.method_added(name) def self.method_added(name)
super super
return unless name.to_s.start_with?("test_") return unless name.to_s.start_with?("test_")