[前][次][番号順一覧][スレッド一覧]

ruby-changes:67872

From: Hiroshi <ko1@a...>
Date: Sat, 11 Sep 2021 08:48:20 +0900 (JST)
Subject: [ruby-changes:67872] 3e32412e08 (master): Fixed broken runner for `make test-all`

https://git.ruby-lang.org/ruby.git/commit/?id=3e32412e08

From 3e32412e08d2ec77cb84d535b591445cdaa4656a Mon Sep 17 00:00:00 2001
From: Hiroshi SHIBATA <hsbt@r...>
Date: Tue, 7 Sep 2021 11:46:12 +0900
Subject: Fixed broken runner for `make test-all`

---
 tool/lib/minitest/unit.rb      |  2 +-
 tool/lib/test/unit.rb          |  8 ++++----
 tool/lib/test/unit/testcase.rb | 11 +++--------
 3 files changed, 8 insertions(+), 13 deletions(-)

diff --git a/tool/lib/minitest/unit.rb b/tool/lib/minitest/unit.rb
index acf0065..6a446d3 100644
--- a/tool/lib/minitest/unit.rb
+++ b/tool/lib/minitest/unit.rb
@@ -205,7 +205,7 @@ module MiniTest https://github.com/ruby/ruby/blob/trunk/tool/lib/minitest/unit.rb#L205
     end
 
     def _run_anything type
-      suites = TestCase.send "#{type}_suites"
+      suites = Test::Unit::TestCase.send "#{type}_suites"
       return if suites.empty?
 
       puts
diff --git a/tool/lib/test/unit.rb b/tool/lib/test/unit.rb
index 79abe86..27751d0 100644
--- a/tool/lib/test/unit.rb
+++ b/tool/lib/test/unit.rb
@@ -71,7 +71,7 @@ module Test https://github.com/ruby/ruby/blob/trunk/tool/lib/test/unit.rb#L71
           srand(seed)
           orig_args.unshift "--seed=#{seed}"
         end
-        MiniTest::Unit::TestCase.test_order = order if order
+        Test::Unit::TestCase.test_order = order if order
 
         @help = "\n" + orig_args.map { |s|
           "  " + (s =~ /[\s|&<>$()]/ ? s.inspect : s)
@@ -517,7 +517,7 @@ module Test https://github.com/ruby/ruby/blob/trunk/tool/lib/test/unit.rb#L517
         require 'timeout'
         @tasks = @files.dup # Array of filenames.
 
-        case MiniTest::Unit::TestCase.test_order
+        case Test::Unit::TestCase.test_order
         when :random
           @tasks.shuffle!
         else
@@ -1008,7 +1008,7 @@ module Test https://github.com/ruby/ruby/blob/trunk/tool/lib/test/unit.rb#L1008
 
       def non_options(files, options)
         if options.delete(:gc_stress)
-          MiniTest::Unit::TestCase.class_eval do
+          Test::Unit::TestCase.class_eval do
             oldrun = instance_method(:run)
             define_method(:run) do |runner|
               begin
@@ -1021,7 +1021,7 @@ module Test https://github.com/ruby/ruby/blob/trunk/tool/lib/test/unit.rb#L1021
           end
         end
         if options.delete(:gc_compact)
-          MiniTest::Unit::TestCase.class_eval do
+          Test::Unit::TestCase.class_eval do
             oldrun = instance_method(:run)
             define_method(:run) do |runner|
               begin
diff --git a/tool/lib/test/unit/testcase.rb b/tool/lib/test/unit/testcase.rb
index b913621..cbcfb43 100644
--- a/tool/lib/test/unit/testcase.rb
+++ b/tool/lib/test/unit/testcase.rb
@@ -3,8 +3,6 @@ require 'test/unit/assertions' https://github.com/ruby/ruby/blob/trunk/tool/lib/test/unit/testcase.rb#L3
 
 module Test
   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
@@ -163,6 +161,8 @@ module Test https://github.com/ruby/ruby/blob/trunk/tool/lib/test/unit/testcase.rb#L161
       # Runs the tests reporting the status to +runner+
 
       def run runner
+        @options = runner.options
+
         trap "INFO" do
           runner.report.each_with_index do |msg, i|
             warn "\n%3d) %s" % [i + 1, msg]
@@ -191,7 +191,7 @@ module Test https://github.com/ruby/ruby/blob/trunk/tool/lib/test/unit/testcase.rb#L191
         rescue *PASSTHROUGH_EXCEPTIONS
           raise
         rescue Exception => e
-          @passed = Skip === e
+          @passed = MiniTest::Skip === e
           time = Time.now - start_time
           runner.record self.class, self.__name__, self._assertions, time, e
           result = runner.puke self.class, self.__name__, e
@@ -337,11 +337,6 @@ module Test https://github.com/ruby/ruby/blob/trunk/tool/lib/test/unit/testcase.rb#L337
         false
       end
 
-      def run runner
-        @options = runner.options
-        super runner
-      end
-
       def self.method_added(name)
         super
         return unless name.to_s.start_with?("test_")
-- 
cgit v1.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]