mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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:
parent
1eeaab8a39
commit
7ed81c28e0
3 changed files with 26 additions and 17 deletions
11
ChangeLog
11
ChangeLog
|
@ -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>
|
Sat Jun 16 01:27:14 2012 Aaron Patterson <aaron@tenderlovemaking.com>
|
||||||
|
|
||||||
* ext/psych/lib/psych.rb: bumping psych to 1.3.3
|
* ext/psych/lib/psych.rb: bumping psych to 1.3.3
|
||||||
|
|
|
@ -735,21 +735,13 @@ module Test
|
||||||
# TODO:
|
# TODO:
|
||||||
# this overriding is for minitest feature that skip messages are
|
# this overriding is for minitest feature that skip messages are
|
||||||
# hidden when not verbose (-v), note this is temporally.
|
# hidden when not verbose (-v), note this is temporally.
|
||||||
e = case e
|
n = report.size
|
||||||
when MiniTest::Skip then
|
rep = super
|
||||||
@skips += 1
|
if MiniTest::Skip === e and /no message given\z/ =~ e.message
|
||||||
return "." if /no message given\z/ =~ e.message
|
report.slice!(n..-1)
|
||||||
"Skipped:\n#{meth}(#{klass}) [#{location e}]:\n#{e.message}\n"
|
rep = "."
|
||||||
when MiniTest::Assertion then
|
end
|
||||||
@failures += 1
|
rep
|
||||||
"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]
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def initialize # :nodoc:
|
def initialize # :nodoc:
|
||||||
|
|
|
@ -25,7 +25,7 @@ module Test
|
||||||
end
|
end
|
||||||
|
|
||||||
def _run_suite(suite, type)
|
def _run_suite(suite, type)
|
||||||
r = report.dup
|
@partial_report = []
|
||||||
orig_testout = MiniTest::Unit.output
|
orig_testout = MiniTest::Unit.output
|
||||||
i,o = IO.pipe
|
i,o = IO.pipe
|
||||||
|
|
||||||
|
@ -63,7 +63,8 @@ module Test
|
||||||
end
|
end
|
||||||
i.close
|
i.close
|
||||||
|
|
||||||
result << (report - r)
|
result << @partial_report
|
||||||
|
@partial_report = nil
|
||||||
result << [@errors-e,@failures-f,@skips-s]
|
result << [@errors-e,@failures-f,@skips-s]
|
||||||
result << ($: - @old_loadpath)
|
result << ($: - @old_loadpath)
|
||||||
result << suite.name
|
result << suite.name
|
||||||
|
@ -144,6 +145,11 @@ module Test
|
||||||
@stdout.close if @stdout
|
@stdout.close if @stdout
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def puke(klass, meth, e)
|
||||||
|
@partial_report << [klass.name, meth, e]
|
||||||
|
super
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue