diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-06-22 12:45:12 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-06-22 12:45:12 +0000 |
commit | 48fc312150b6ad1ff4219dd11da2cb0cae91aefe (patch) | |
tree | 1a3dc10af5ca383617d21317550c88a8125cabe8 /lib | |
parent | 6e4c82607b10ba87dd856db86156ca2ed9b858fe (diff) | |
download | ruby-48fc312150b6ad1ff4219dd11da2cb0cae91aefe.tar.gz |
lib/test/unit.rb: show file count in parallel mode
* lib/test/unit.rb (Test::Unit::Runner#_run_parallel): show file count
in parallel mode. since worker processes run tests per files, the
parent process cannot tell how many tests will be run in advance.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36184 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/test/unit.rb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/test/unit.rb b/lib/test/unit.rb index 79514dda43..5d279758b0 100644 --- a/lib/test/unit.rb +++ b/lib/test/unit.rb @@ -433,7 +433,7 @@ module Test return unless @options[:job_status] puts "" unless @options[:verbose] or @options[:job_status] == :replace status_line = @workers.map(&:to_s).join(" ") - put_status status_line or (puts; nil) + update_status(status_line) or (puts; nil) end def del_jobs_status @@ -463,6 +463,7 @@ module Test @need_quit = false @dead_workers = [] # Array of dead workers. @warnings = [] + @total_tests = @tasks.size.to_s(10) shutting_down = false rep = [] # FIXME: more good naming @@ -528,6 +529,7 @@ module Test worker = new_worker end worker.run(@tasks.shift, type) + @test_count += 1 end jobs_status @@ -711,7 +713,12 @@ module Test end def new_test(s) - count = (@test_count += 1).to_s(10).rjust(@total_tests.size) + @test_count += 1 + update_status(s) + end + + def update_status(s) + count = @test_count.to_s(10).rjust(@total_tests.size) put_status("#{@passed_color}[#{count}/#{@total_tests}]#{@reset_color} #{s}") end |