Navigation Menu

Skip to content

Commit

Permalink
inplace reporter: colorize worker ID
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Aug 11, 2012
1 parent 2f8489b commit 6a1c185
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions lib/groonga/tester.rb
Expand Up @@ -318,6 +318,16 @@ def test_failed(name)
def test_not_checked
@n_not_checked_tests += 1
end

def status
if n_failed_tests > 0
:failure
elsif n_not_checked_tests > 0
:no_check
else
:success
end
end
end

class Worker
Expand Down Expand Up @@ -1676,10 +1686,11 @@ def draw

def draw_status_line(worker)
clear_line
left = "[#{worker.id}] "
situation = worker.result.status
left = "[#{colorize(worker.id, situation)}] "
right = " [#{worker.status}]"
rest_width = @term_width - @current_column
center_width = rest_width - left.bytesize - right.bytesize
center_width = rest_width - string_width(left) - string_width(right)
center = justify(worker.suite_name, center_width)
puts("#{left}#{center}#{right}")
end
Expand Down

0 comments on commit 6a1c185

Please sign in to comment.