Issue #4657 has been updated by Shota Fukumori. Status changed from Open to Closed r31502 ??§ã?³ã?????????????¾ã???????? -q, --hide-skip???skip??¡ã????»ã?¼ã?¸ã??表示????????ªã???ªã????¾ã????? ---------------------------------------- Feature #4657: add option to hide skip messages on unit/test http://redmine.ruby-lang.org/issues/4657 Author: Shota Fukumori Status: Closed Priority: Normal Assignee: Category: lib Target version: ???è¿?test-all???Skip???å¤??????®ã?§ã??skip??®ã?¡ã????»ã?¼ã?¸è¡¨ç¤ºã???????¶ã???????ªã????·ã?§ã?³ã??追å???????¦ã?¯ã?©ã????§ã??????????? ??¡ã?ªã?¿ã?«ã??ruby-ja??§ä»¥ä¸???®ã???????ªæ????????????????¾ã???????? >nurse: ??????????????°ã????????????????®ä?????test-all???skip??£ã?¦ã??test-all??®æ??å¾???§è¡¨ç¤ºã??????????»ã?????å¬??????????? >unak: ??¾ã?£ã?????????????????ªã????? >nurse: ä»?表示????????¦ã????®ã??æ¶?????????»ã???????????? >unak: skip??®è¡¨ç¤ºã???????¶ã???????ªã????·ã?§ã?³ã?¯ã?»ã???????? 以ä????®ã?????????????©ç?¨ã????????test/unit (test-all)???--hide-skip??ªã????·ã?§ã?³ã??追å??????????? --hide-skip??ªã????·ã?§ã?³ã??ä»??????¦å??è¡??????????Skipped??¡ã????»ã?¼ã?¸ã??表示????????ªã???ªã????¾ã????? å¾???¥é????????Skip??°ã?¯æ?«å°¾??®ã?¬ã????¼ã????§ç¢ºèª????????????¨ã????§ã?????????????«ã?ªã?£ã?¦ã????¾ã????? ??ºå??ä¾?: $ make TESTS='--hide-skip date' test-all ./miniruby -I../../lib -I. -I.ext/common ../../tool/runruby.rb --extout=.ext -- "../../test/runner.rb" --ruby="./miniruby -I../../lib -I. -I.ext/common ../../tool/runruby.rb --extout=.ext --" --hide-skip date Run options: "--ruby=./miniruby -I../../lib -I. -I.ext/common ../../tool/runruby.rb --extout=.ext --" --hide-skip # Running tests: ..............................SSS....SSSSSSSSSSSSSSSS.SS........................................................................ Finished tests in 11.376260s, 11.2515 tests/s, 14151.3116 assertions/s. 128 tests, 160989 assertions, 0 failures, 0 errors, 21 skips = patch below diff --git lib/test/unit.rb lib/test/unit.rb index 1f1bb09..e88309f 100644 --- lib/test/unit.rb +++ lib/test/unit.rb @@ -103,6 +103,10 @@ module Test opts.on '--ruby VAL', "Path to ruby; It'll have used at -j option" do |a| options[:ruby] = a.split(/ /).reject(&:empty?) end + + opts.on '--hide-skip', 'Hide skipped tests' do + options[:hide_skip] = true + end end def non_options(files, options) @@ -547,6 +551,7 @@ module Test end } end + report.reject!{|r| r.start_with? "Skipped:" } if @opts[:hide_skip] result end diff --git test/testunit/test4test_hideskip.rb test/testunit/test4test_hideskip.rb new file mode 100644 index 0000000..6fe3284 --- /dev/null +++ test/testunit/test4test_hideskip.rb @@ -0,0 +1,7 @@ +require 'test/unit' + +class TestForTestHideSkip < Test::Unit::TestCase + def test_skip + skip + end +end diff --git test/testunit/test_hideskip.rb test/testunit/test_hideskip.rb new file mode 100644 index 0000000..967ecaf --- /dev/null +++ test/testunit/test_hideskip.rb @@ -0,0 +1,20 @@ +require 'test/unit' + +class TestHideSkip < Test::Unit::TestCase + def test_hideskip + test_out, o = IO.pipe + spawn(*@options[:ruby], "#{File.dirname(__FILE__)}/test4test_hideskip.rb", + out: o, err: o) + o.close + assert_match(/assertions\/s.\n\n 1\) Skipped/,test_out.read) + test_out.close + + test_out, o = IO.pipe + spawn(*@options[:ruby], "#{File.dirname(__FILE__)}/test4test_hideskip.rb", + "--hide-skip", out: o, err: o) + o.close + assert_match(/assertions\/s.\n\n1 tests, 0 assertions, 0 failures, 0 errors, 1 skips/, + test_out.read) + test_out.close + end +end -- http://redmine.ruby-lang.org