mirror of
https://github.com/ThrowTheSwitch/Unity.git
synced 2025-06-23 16:19:07 +08:00
- centralized pretty printing so people can use it more easily
- updated unity helper examples to get them working again - got examples running again git-svn-id: http://unity.svn.sourceforge.net/svnroot/unity/trunk@65 e7d17a6e-8845-0410-bbbc-c8efb4fdad7e
This commit is contained in:
@ -2,53 +2,17 @@ require 'yaml'
|
||||
require 'fileutils'
|
||||
require 'auto/unity_test_summary'
|
||||
require 'auto/generate_test_runner'
|
||||
require 'auto/colour_prompt'
|
||||
require 'auto/colour_reporter'
|
||||
#require 'auto/test_file_filter'
|
||||
|
||||
module RakefileHelpers
|
||||
|
||||
C_EXTENSION = '.c'
|
||||
$color_output = true
|
||||
|
||||
def report(message)
|
||||
if not $color_output
|
||||
puts($stdout.puts(message))
|
||||
else
|
||||
message.each_line do |line|
|
||||
line.chomp!
|
||||
if line.include?('Tests') &&
|
||||
line.include?('Failures') &&
|
||||
line.include?('Ignored')
|
||||
if line.include?('0 Failures')
|
||||
colour = :green
|
||||
else
|
||||
colour = :red
|
||||
end
|
||||
elsif line.include?('PASS') ||
|
||||
line == 'OK'
|
||||
colour = :green
|
||||
elsif line.include? "Running Unity system tests..."
|
||||
colour = :blue
|
||||
elsif line.include?('FAIL') ||
|
||||
line.include?('Expected') ||
|
||||
line.include?('Memory Mismatch') ||
|
||||
line.include?('not within delta')
|
||||
colour = :red
|
||||
elsif line.include?(' IGNORED')
|
||||
colour = :yellow
|
||||
else
|
||||
colour = :blue
|
||||
end
|
||||
colour_puts colour, line
|
||||
end
|
||||
end
|
||||
$stdout.flush
|
||||
$stderr.flush
|
||||
end
|
||||
|
||||
def load_configuration(config_file)
|
||||
$cfg_file = config_file
|
||||
$cfg = YAML.load(File.read($cfg_file))
|
||||
$colour_output = false unless $cfg['colour']
|
||||
end
|
||||
|
||||
def configure_clean
|
||||
|
Reference in New Issue
Block a user