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

ruby-changes:41882

From: nobu <ko1@a...>
Date: Sat, 27 Feb 2016 14:10:00 +0900 (JST)
Subject: [ruby-changes:41882] nobu:r53956 (trunk): test/unit: refine output in job_status=normal

nobu	2016-02-27 14:10:44 +0900 (Sat, 27 Feb 2016)

  New Revision: 53956

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=53956

  Log:
    test/unit: refine output in job_status=normal
    
    * test/lib/test/unit.rb (Test::Unit::StatusLine#jobs_status): show
      status of only changed woker, not to show same lines repeatedly,
      in normal job_status mode.

  Modified files:
    trunk/test/lib/test/unit.rb
Index: test/lib/test/unit.rb
===================================================================
--- test/lib/test/unit.rb	(revision 53955)
+++ test/lib/test/unit.rb	(revision 53956)
@@ -332,7 +332,6 @@ module Test https://github.com/ruby/ruby/blob/trunk/test/lib/test/unit.rb#L332
           # just only dots, ignore
         when /^okay$/
           worker.status = :running
-          jobs_status
         when /^ready(!)?$/
           bang = $1
           worker.status = :ready
@@ -345,7 +344,7 @@ module Test https://github.com/ruby/ruby/blob/trunk/test/lib/test/unit.rb#L344
           worker.run(task, type)
           @test_count += 1
 
-          jobs_status
+          jobs_status(worker)
         when /^done (.+?)$/
           begin
             r = Marshal.load($1.unpack("m")[0])
@@ -360,7 +359,7 @@ module Test https://github.com/ruby/ruby/blob/trunk/test/lib/test/unit.rb#L359
         when /^p (.+?)$/
           del_jobs_status
           print $1.unpack("m")[0]
-          jobs_status if @options[:job_status] == :replace
+          jobs_status(worker) if @options[:job_status] == :replace
         when /^after (.+?)$/
           @warnings << Marshal.load($1.unpack("m")[0])
         when /^bye (.+?)$/
@@ -473,6 +472,7 @@ module Test https://github.com/ruby/ruby/blob/trunk/test/lib/test/unit.rb#L472
             end
           }
         end
+        del_status_line
         result
       end
     end
@@ -546,9 +546,13 @@ module Test https://github.com/ruby/ruby/blob/trunk/test/lib/test/unit.rb#L546
         @status_line_size += line.size
       end
 
-      def jobs_status
+      def jobs_status(worker)
         return if !@options[:job_status] or @options[:verbose]
-        status_line = @workers.map(&:to_s).join(" ")
+        if @options[:job_status] == :replace
+          status_line = @workers.map(&:to_s).join(" ")
+        else
+          status_line = worker.to_s
+        end
         update_status(status_line) or (puts; nil)
       end
 
@@ -606,7 +610,6 @@ module Test https://github.com/ruby/ruby/blob/trunk/test/lib/test/unit.rb#L610
 
       def new_test(s)
         @test_count += 1
-        return if !@options[:job_status] or @options[:verbose]
         update_status(s)
       end
 

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

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