Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
bootstraptest: colorize
* bootstraptest/runner.rb (exec_test): colorize.
  • Loading branch information
nobu committed May 7, 2012
commit ce113a2e3e34fb0dcbd9f82e00514f29b51c2d81
11 changes: 9 additions & 2 deletions bootstraptest/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,13 @@ def main

@progress = %w[- \\ | /]
@tty = !@verbose && $stderr.tty?
if @tty and /mswin|mingw/ !~ RUBY_PLATFORM and /dumb/ !~ ENV["TERM"]
@passed = "\e[32m"
@failed = "\e[31m"
@reset = "\e[m"
else
@passed = @failed = @reset = ""
end
unless quiet
puts Time.now
if defined?(RUBY_DESCRIPTION)
Expand Down Expand Up @@ -145,9 +152,9 @@ def exec_test(pathes)
load File.expand_path(path)
if @tty
if @error == error
$stderr.print "\b""PASS #{@count-count}"
$stderr.print "\b#{@passed}PASS #{@count-count}#{@reset}"
else
$stderr.print "\b""FAIL #{@error-error}/#{@count-count}"
$stderr.print "\b#{@failed}FAIL #{@error-error}/#{@count-count}#{@reset}"
end
end
end
Expand Down