test/unit: fix for the test
* test/lib/test/unit.rb (_run_parallel): make sure retrying message is a separate line. * test/lib/test/unit.rb (_prepare_run): do not add Output if testing. * test/lib/test/unit.rb (Skipping#failed): defer showing reports when showing skips, to be sorted. * test/testunit/test_hideskip.rb (test_hideskip): fix assertion for output misordered by mixing output destinations. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53955 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
9c55cb2e9e
commit
de12196865
@ -426,7 +426,7 @@ module Test
|
|||||||
suites.map! {|r| eval("::"+r[:testcase])}
|
suites.map! {|r| eval("::"+r[:testcase])}
|
||||||
del_status_line or puts
|
del_status_line or puts
|
||||||
unless suites.empty?
|
unless suites.empty?
|
||||||
puts "Retrying..."
|
puts "\n""Retrying..."
|
||||||
_run_suites(suites, type)
|
_run_suites(suites, type)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -478,6 +478,10 @@ module Test
|
|||||||
end
|
end
|
||||||
|
|
||||||
module Skipping # :nodoc: all
|
module Skipping # :nodoc: all
|
||||||
|
def failed(s)
|
||||||
|
super if !s or @options[:hide_skip]
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
def setup_options(opts, options)
|
def setup_options(opts, options)
|
||||||
super
|
super
|
||||||
@ -501,6 +505,7 @@ module Test
|
|||||||
report.reject!{|r| r.start_with? "Skipped:" } if @options[:hide_skip]
|
report.reject!{|r| r.start_with? "Skipped:" } if @options[:hide_skip]
|
||||||
report.sort_by!{|r| r.start_with?("Skipped:") ? 0 : \
|
report.sort_by!{|r| r.start_with?("Skipped:") ? 0 : \
|
||||||
(r.start_with?("Failure:") ? 1 : 2) }
|
(r.start_with?("Failure:") ? 1 : 2) }
|
||||||
|
failed(nil)
|
||||||
result
|
result
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -585,7 +590,7 @@ module Test
|
|||||||
if color or @options[:job_status] == :replace
|
if color or @options[:job_status] == :replace
|
||||||
@verbose = !options[:parallel]
|
@verbose = !options[:parallel]
|
||||||
end
|
end
|
||||||
@output = Output.new(self)
|
@output = Output.new(self) unless @options[:testing]
|
||||||
if /\A\/(.*)\/\z/ =~ (filter = options[:filter])
|
if /\A\/(.*)\/\z/ =~ (filter = options[:filter])
|
||||||
filter = Regexp.new($1)
|
filter = Regexp.new($1)
|
||||||
end
|
end
|
||||||
|
@ -3,9 +3,9 @@ require 'test/unit'
|
|||||||
|
|
||||||
class TestHideSkip < Test::Unit::TestCase
|
class TestHideSkip < Test::Unit::TestCase
|
||||||
def test_hideskip
|
def test_hideskip
|
||||||
assert_not_match(/assertions\/s.\n\n 1\) Skipped/, hideskip)
|
assert_not_match(/^ *1\) Skipped/, hideskip)
|
||||||
assert_match(/assertions\/s.\n\n 1\) Skipped/, hideskip("--show-skip"))
|
assert_match(/^ *1\) Skipped/, hideskip("--show-skip"))
|
||||||
assert_match(/assertions\/s.\n\n1 tests, 0 assertions, 0 failures, 0 errors, 1 skips/, hideskip("--hide-skip"))
|
assert_match(/assertions\/s.\n+1 tests, 0 assertions, 0 failures, 0 errors, 1 skips/, hideskip("--hide-skip"))
|
||||||
end
|
end
|
||||||
|
|
||||||
def hideskip(*args)
|
def hideskip(*args)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user