ruby-changes:41881
From: nobu <ko1@a...>
Date: Sat, 27 Feb 2016 13:16:00 +0900 (JST)
Subject: [ruby-changes:41881] nobu:r53955 (trunk): test/unit: fix for the test
nobu 2016-02-27 13:16:44 +0900 (Sat, 27 Feb 2016) New Revision: 53955 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=53955 Log: 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. Modified files: trunk/test/lib/test/unit.rb trunk/test/testunit/test_hideskip.rb Index: test/lib/test/unit.rb =================================================================== --- test/lib/test/unit.rb (revision 53954) +++ test/lib/test/unit.rb (revision 53955) @@ -426,7 +426,7 @@ module Test https://github.com/ruby/ruby/blob/trunk/test/lib/test/unit.rb#L426 suites.map! {|r| eval("::"+r[:testcase])} del_status_line or puts unless suites.empty? - puts "Retrying..." + puts "\n""Retrying..." _run_suites(suites, type) end end @@ -478,6 +478,10 @@ module Test https://github.com/ruby/ruby/blob/trunk/test/lib/test/unit.rb#L478 end module Skipping # :nodoc: all + def failed(s) + super if !s or @options[:hide_skip] + end + private def setup_options(opts, options) super @@ -501,6 +505,7 @@ module Test https://github.com/ruby/ruby/blob/trunk/test/lib/test/unit.rb#L505 report.reject!{|r| r.start_with? "Skipped:" } if @options[:hide_skip] report.sort_by!{|r| r.start_with?("Skipped:") ? 0 : \ (r.start_with?("Failure:") ? 1 : 2) } + failed(nil) result end end @@ -585,7 +590,7 @@ module Test https://github.com/ruby/ruby/blob/trunk/test/lib/test/unit.rb#L590 if color or @options[:job_status] == :replace @verbose = !options[:parallel] end - @output = Output.new(self) + @output = Output.new(self) unless @options[:testing] if /\A\/(.*)\/\z/ =~ (filter = options[:filter]) filter = Regexp.new($1) end Index: test/testunit/test_hideskip.rb =================================================================== --- test/testunit/test_hideskip.rb (revision 53954) +++ test/testunit/test_hideskip.rb (revision 53955) @@ -3,9 +3,9 @@ require 'test/unit' https://github.com/ruby/ruby/blob/trunk/test/testunit/test_hideskip.rb#L3 class TestHideSkip < Test::Unit::TestCase def test_hideskip - assert_not_match(/assertions\/s.\n\n 1\) Skipped/, hideskip) - assert_match(/assertions\/s.\n\n 1\) Skipped/, hideskip("--show-skip")) - assert_match(/assertions\/s.\n\n1 tests, 0 assertions, 0 failures, 0 errors, 1 skips/, hideskip("--hide-skip")) + assert_not_match(/^ *1\) Skipped/, hideskip) + assert_match(/^ *1\) Skipped/, hideskip("--show-skip")) + assert_match(/assertions\/s.\n+1 tests, 0 assertions, 0 failures, 0 errors, 1 skips/, hideskip("--hide-skip")) end def hideskip(*args) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/