ESP32-basiertes Kraftort-Suchger�t mit GPS, LED-Ring und PlatformIO-Firmware.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 line
1.2KB

  1. # =========================================================================
  2. # Unity - A Test Framework for C
  3. # ThrowTheSwitch.org
  4. # Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams
  5. # SPDX-License-Identifier: MIT
  6. # =========================================================================
  7. require_relative 'colour_prompt'
  8. $colour_output = true
  9. def report(message)
  10. if !$colour_output
  11. $stdout.puts(message)
  12. else
  13. message = message.join('\n') if message.instance_of?(Array)
  14. message.each_line do |line|
  15. line.chomp!
  16. colour = case line
  17. when /(?:total\s+)?tests:?\s+(\d+)\s+(?:total\s+)?failures:?\s+\d+\s+Ignored:?/i
  18. Regexp.last_match(1).to_i.zero? ? :green : :red
  19. when /PASS/
  20. :green
  21. when /^OK$/
  22. :green
  23. when /(?:FAIL|ERROR)/
  24. :red
  25. when /IGNORE/
  26. :yellow
  27. when /^(?:Creating|Compiling|Linking)/
  28. :white
  29. else
  30. :silver
  31. end
  32. colour_puts(colour, line)
  33. end
  34. end
  35. $stdout.flush
  36. $stderr.flush
  37. end