lib/test/unit: refactoring puke

* lib/test/unit.rb (Test::Unit::Runner#puke): modify only result and
  drop useless reports, not override entirely.
* lib/test/unit/parallel.rb (Test::Unit::Worker#_run_suite): report
  unformatted results.  formatting messages is not a workers task.
* lib/test/unit/parallel.rb (Test::Unit::Worker#puke): store raw
  results.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36105 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2012-06-15 22:11:55 +00:00
parent 1eeaab8a39
commit 7ed81c28e0
3 changed files with 26 additions and 17 deletions

View File

@ -1,3 +1,14 @@
Sat Jun 16 07:11:52 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/test/unit.rb (Test::Unit::Runner#puke): modify only result and
drop useless reports, not override entirely.
* lib/test/unit/parallel.rb (Test::Unit::Worker#_run_suite): report
unformatted results. formatting messages is not a workers task.
* lib/test/unit/parallel.rb (Test::Unit::Worker#puke): store raw
results.
Sat Jun 16 01:27:14 2012 Aaron Patterson <aaron@tenderlovemaking.com>
* ext/psych/lib/psych.rb: bumping psych to 1.3.3

View File

@ -735,21 +735,13 @@ module Test
# TODO:
# this overriding is for minitest feature that skip messages are
# hidden when not verbose (-v), note this is temporally.
e = case e
when MiniTest::Skip then
@skips += 1
return "." if /no message given\z/ =~ e.message
"Skipped:\n#{meth}(#{klass}) [#{location e}]:\n#{e.message}\n"
when MiniTest::Assertion then
@failures += 1
"Failure:\n#{meth}(#{klass}) [#{location e}]:\n#{e.message}\n"
else
@errors += 1
bt = MiniTest::filter_backtrace(e.backtrace).join "\n "
"Error:\n#{meth}(#{klass}):\n#{e.class}: #{e.message}\n #{bt}\n"
end
@report << e
e[0, 1]
n = report.size
rep = super
if MiniTest::Skip === e and /no message given\z/ =~ e.message
report.slice!(n..-1)
rep = "."
end
rep
end
def initialize # :nodoc:

View File

@ -25,7 +25,7 @@ module Test
end
def _run_suite(suite, type)
r = report.dup
@partial_report = []
orig_testout = MiniTest::Unit.output
i,o = IO.pipe
@ -63,7 +63,8 @@ module Test
end
i.close
result << (report - r)
result << @partial_report
@partial_report = nil
result << [@errors-e,@failures-f,@skips-s]
result << ($: - @old_loadpath)
result << suite.name
@ -144,6 +145,11 @@ module Test
@stdout.close if @stdout
end
end
def puke(klass, meth, e)
@partial_report << [klass.name, meth, e]
super
end
end
end
end