1
0
mirror of https://github.com/ThrowTheSwitch/Unity.git synced 2026-01-23 08:25:58 +01:00
Files
Unity/auto/colour_reporter.rb
mvandervoord 3a2595ceb6 - added accessor to line number
- tweaked reporting colors

git-svn-id: http://unity.svn.sourceforge.net/svnroot/unity/trunk@66 e7d17a6e-8845-0410-bbbc-c8efb4fdad7e
2010-03-24 01:06:07 +00:00

33 lines
718 B
Ruby

require "#{File.expand_path(File.dirname(__FILE__))}/colour_prompt"
$colour_output = true
def report(message)
if not $colour_output
$stdout.puts(message)
else
message.each_line do |line|
line.chomp!
colour = case(line)
when /Tests\s+(\d+)\s+Failures\s+\d+\s+Ignored/
($1.to_i == 0) ? :green : :red
when /PASS/
:green
when /^OK$/
:green
when /(?:FAIL|ERROR)/
:red
when /IGNORE/
:yellow
when /^(?:Creating|Compiling|Linking)/
:white
else
:blue
end
colour_puts(colour, line)
end
end
$stdout.flush
$stderr.flush
end