Sha256: 825b4b4bfc28449c6b24c804d9ffc2d1f1f5855a6655f6101debbeb69d461e64

Contents?: true

Size: 1.15 KB

Versions: 14

Compression:

Stored size: 1.15 KB

Contents

# ==========================================
#   Unity Project - A Test Framework for C
#   Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
#   [Released under MIT License. Please refer to license.txt for details]
# ==========================================

require "#{File.expand_path(File.dirname(__FILE__))}/colour_prompt"

$colour_output = true

def report(message)
  if !$colour_output
    $stdout.puts(message)
  else
    message = message.join('\n') if message.class == Array
    message.each_line do |line|
      line.chomp!
      colour = case line
               when /(?:total\s+)?tests:?\s+(\d+)\s+(?:total\s+)?failures:?\s+\d+\s+Ignored:?/i
                 Regexp.last_match(1).to_i.zero? ? :green : :red
               when /PASS/
                 :green
               when /^OK$/
                 :green
               when /(?:FAIL|ERROR)/
                 :red
               when /IGNORE/
                 :yellow
               when /^(?:Creating|Compiling|Linking)/
                 :white
               else
                 :silver
               end
      colour_puts(colour, line)
    end
  end
  $stdout.flush
  $stderr.flush
end

Version data entries

14 entries across 6 versions & 2 rubygems

Version Path
simdjson-0.3.0 vendor/simdjson/dependencies/cJSON/tests/unity/auto/colour_reporter.rb
ceedling-0.30.0 vendor/c_exception/vendor/unity/auto/colour_reporter.rb
ceedling-0.30.0 vendor/cmock/vendor/c_exception/vendor/unity/auto/colour_reporter.rb
ceedling-0.28.3 vendor/unity/auto/colour_reporter.rb
ceedling-0.28.3 vendor/cmock/vendor/unity/auto/colour_reporter.rb
ceedling-0.28.2 vendor/unity/auto/colour_reporter.rb
ceedling-0.28.1 vendor/unity/auto/colour_reporter.rb
ceedling-0.28.1 vendor/c_exception/vendor/unity/auto/colour_reporter.rb
ceedling-0.28.1 vendor/cmock/vendor/c_exception/vendor/unity/auto/colour_reporter.rb
ceedling-0.28.1 vendor/cmock/vendor/unity/auto/colour_reporter.rb
ceedling-0.27.0 vendor/c_exception/vendor/unity/auto/colour_reporter.rb
ceedling-0.27.0 vendor/unity/auto/colour_reporter.rb
ceedling-0.27.0 vendor/cmock/vendor/unity/auto/colour_reporter.rb
ceedling-0.27.0 vendor/cmock/vendor/c_exception/vendor/unity/auto/colour_reporter.rb