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

ruby-changes:34031

From: akr <ko1@a...>
Date: Sun, 25 May 2014 17:15:16 +0900 (JST)
Subject: [ruby-changes:34031] akr:r46112 (trunk): * test/lib/minitest/unit.rb: Less ObjectSpace.each_object(Tempfile)

akr	2014-05-25 17:15:08 +0900 (Sun, 25 May 2014)

  New Revision: 46112

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=46112

  Log:
    * test/lib/minitest/unit.rb: Less ObjectSpace.each_object(Tempfile)
      invocation.

  Modified files:
    trunk/ChangeLog
    trunk/test/lib/minitest/unit.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 46111)
+++ ChangeLog	(revision 46112)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sun May 25 17:09:13 2014  Tanaka Akira  <akr@f...>
+
+	* test/lib/minitest/unit.rb: Less ObjectSpace.each_object(Tempfile)
+	  invocation.
+
 Sun May 25 16:54:06 2014  Tanaka Akira  <akr@f...>
 
 	* test/lib/minitest/unit.rb: Use Thread.list instead of
Index: test/lib/minitest/unit.rb
===================================================================
--- test/lib/minitest/unit.rb	(revision 46111)
+++ test/lib/minitest/unit.rb	(revision 46112)
@@ -923,12 +923,12 @@ module MiniTest https://github.com/ruby/ruby/blob/trunk/test/lib/minitest/unit.rb#L923
         filter === m || filter === "#{suite}##{m}"
       }
 
+      live1 = live_thread_and_tempfile
+
       assertions = filtered_test_methods.map { |method|
         inst = suite.new method
         inst._assertions = 0
 
-        live1 = live_thread_and_tempfile
-
         print "#{suite}##{method} = " if @verbose
 
         start_time = Time.now if @verbose
@@ -938,7 +938,9 @@ module MiniTest https://github.com/ruby/ruby/blob/trunk/test/lib/minitest/unit.rb#L938
         print result
         puts if @verbose
 
-        check_tempfile_and_thread inst, live1
+        live2 = live_thread_and_tempfile
+        check_tempfile_and_thread inst, live1, live2
+        live1 = live2
 
         inst._assertions
       }
@@ -960,8 +962,7 @@ module MiniTest https://github.com/ruby/ruby/blob/trunk/test/lib/minitest/unit.rb#L962
       [live_threads, live_tempfiles]
     end
 
-    def check_tempfile_and_thread(inst, live1)
-      live2 = live_thread_and_tempfile
+    def check_tempfile_and_thread(inst, live1, live2)
       thread_finished = live1[0] - live2[0]
       if !thread_finished.empty?
         list = thread_finished.map {|t| ' ' + t.inspect }.sort.join

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

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