PageRenderTime 35ms CodeModel.GetById 8ms RepoModel.GetById 1ms app.codeStats 0ms

/support/rake/display_ocunit_failures_at_end.rb

http://github.com/framework-x/fx-core
Ruby | 37 lines | 34 code | 1 blank | 2 comment | 4 complexity | 3508b9c911786d510fe5c53175d270de MD5 | raw file
  1. failures = []
  2. STDIN.each_line do |line|
  3. # puts line
  4. # next
  5. if line =~ /UnitTests.+finished/
  6. @finished = true
  7. end
  8. case line
  9. when /^Test Case .+ failed /
  10. failures << line.strip
  11. print "F"
  12. when /Test\.m:\d+: error/
  13. failures << line.strip
  14. when /^Test Case .+ passed /, /^Test Suite .+ started /, /^Test Suite .+ finished /
  15. print "."
  16. when /Executed.+test.+failure.+seconds/
  17. if @finished
  18. print "\n"
  19. puts line
  20. end
  21. when /is missing/, /unrecognized selector sent/, /set a breakpoint in/, /NSFileManagerXTest_file_that_does_not_exist/,
  22. /^Error, could not create MachMessagePort for database doctor/, /double free/
  23. else
  24. unless line.strip.empty?
  25. print "\n"
  26. puts line
  27. end
  28. end
  29. $stdout.flush
  30. end
  31. if failures.any?
  32. puts ""
  33. puts failures.join("\n")
  34. puts "#{failures.grep(/failed/).size} failures"
  35. puts ""
  36. end