mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
This commit is contained in:
parent
6e4c82607b
commit
48fc312150
1 changed files with 9 additions and 2 deletions
|
@ -433,7 +433,7 @@ module Test
|
||||||
return unless @options[:job_status]
|
return unless @options[:job_status]
|
||||||
puts "" unless @options[:verbose] or @options[:job_status] == :replace
|
puts "" unless @options[:verbose] or @options[:job_status] == :replace
|
||||||
status_line = @workers.map(&:to_s).join(" ")
|
status_line = @workers.map(&:to_s).join(" ")
|
||||||
put_status status_line or (puts; nil)
|
update_status(status_line) or (puts; nil)
|
||||||
end
|
end
|
||||||
|
|
||||||
def del_jobs_status
|
def del_jobs_status
|
||||||
|
@ -463,6 +463,7 @@ module Test
|
||||||
@need_quit = false
|
@need_quit = false
|
||||||
@dead_workers = [] # Array of dead workers.
|
@dead_workers = [] # Array of dead workers.
|
||||||
@warnings = []
|
@warnings = []
|
||||||
|
@total_tests = @tasks.size.to_s(10)
|
||||||
shutting_down = false
|
shutting_down = false
|
||||||
rep = [] # FIXME: more good naming
|
rep = [] # FIXME: more good naming
|
||||||
|
|
||||||
|
@ -528,6 +529,7 @@ module Test
|
||||||
worker = new_worker
|
worker = new_worker
|
||||||
end
|
end
|
||||||
worker.run(@tasks.shift, type)
|
worker.run(@tasks.shift, type)
|
||||||
|
@test_count += 1
|
||||||
end
|
end
|
||||||
|
|
||||||
jobs_status
|
jobs_status
|
||||||
|
@ -711,7 +713,12 @@ module Test
|
||||||
end
|
end
|
||||||
|
|
||||||
def new_test(s)
|
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}")
|
put_status("#{@passed_color}[#{count}/#{@total_tests}]#{@reset_color} #{s}")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue