/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
- failures = []
- STDIN.each_line do |line|
- # puts line
- # next
- if line =~ /UnitTests.+finished/
- @finished = true
- end
- case line
- when /^Test Case .+ failed /
- failures << line.strip
- print "F"
- when /Test\.m:\d+: error/
- failures << line.strip
- when /^Test Case .+ passed /, /^Test Suite .+ started /, /^Test Suite .+ finished /
- print "."
- when /Executed.+test.+failure.+seconds/
- if @finished
- print "\n"
- puts line
- end
- when /is missing/, /unrecognized selector sent/, /set a breakpoint in/, /NSFileManagerXTest_file_that_does_not_exist/,
- /^Error, could not create MachMessagePort for database doctor/, /double free/
- else
- unless line.strip.empty?
- print "\n"
- puts line
- end
- end
- $stdout.flush
- end
- if failures.any?
- puts ""
- puts failures.join("\n")
- puts "#{failures.grep(/failed/).size} failures"
- puts ""
- end