[#43467] [Q] thread->interrupt_flag が適切に排他制御されていないように見える — KOSAKI Motohiro <kosaki.motohiro@...>

kosakiです

15 messages 2011/05/08
[#43482] Re: [Q] thread->interrupt_flag が適切に排他制御されていないように見える — SASADA Koichi <ko1@...> 2011/05/08

 ささだです.

[#43486] Re: [Q] thread->interrupt_flag が適切に排他制御されていないように見える — KOSAKI Motohiro <kosaki.motohiro@...> 2011/05/09

>  ささだです.

[#43487] Re: [Q] thread->interrupt_flag が適切に排他制御されていないように見える — SASADA Koichi <ko1@...> 2011/05/09

 ささだです.

[#43488] Re: [Q] thread->interrupt_flag が適切に排他制御されていないように見える — KOSAKI Motohiro <kosaki.motohiro@...> 2011/05/09

>  ささだです.

[#43489] Re: [Q] thread->interrupt_flag が適切に排他制御されていないように見える — KOSAKI Motohiro <kosaki.motohiro@...> 2011/05/09

自己解決しました

[#43500] Re: [Q] thread->interrupt_flag が適切に排他制御されていないように見える — SASADA Koichi <ko1@...> 2011/05/09

 ささだです.

[#43501] Re: [Q] thread->interrupt_flag が適切に排他制御されていないように見える — KOSAKI Motohiro <kosaki.motohiro@...> 2011/05/09

>> ということは危ないのは RUBY_VM_SET_INTERRUPT() がロストしたときに、タイムアウトなしの

[#43468] Re: [ruby-changes:19438] Ruby:r31478 (trunk): * test/date/*.rb: use skip /w messages. — KOSAKI Motohiro <kosaki.motohiro@...>

2011/5/8 tadf <ko1@atdot.net>:

8 messages 2011/05/08

[#43476] [Ruby 1.9 - Feature #4653][Open] [PATCH 1/1] new method Enumerable#rude_map — Shyouhei Urabe <shyouhei@...>

16 messages 2011/05/08

[#43493] [Ruby 1.9 - Feature #4657][Open] add option to hide skip messages on unit/test — Shota Fukumori <sorah@...>

11 messages 2011/05/09

[#43502] draft schedule of Ruby 1.9.3 — "Yuki Sonoda (Yugui)" <yugui@...>

-----BEGIN PGP SIGNED MESSAGE-----

23 messages 2011/05/09
[#43505] Re: draft schedule of Ruby 1.9.3 — "U.Nakamura" <usa@...> 2011/05/10

Hello,

[#43513] Re: draft schedule of Ruby 1.9.3 — KOSAKI Motohiro <kosaki.motohiro@...> 2011/05/10

(ruby-coreはずしました)

[#43587] [Ruby 1.9 - Feature #4788][Open] resolv.rb refactoring — Makoto Kishimoto <redmine@...>

15 messages 2011/05/27

[ruby-dev:43493] [Ruby 1.9 - Feature #4657][Open] add option to hide skip messages on unit/test

From: Shota Fukumori <sorah@...>
Date: 2011-05-09 09:31:26 UTC
List: ruby-dev #43493
Issue #4657 has been reported by Shota Fukumori.

----------------------------------------
Feature #4657: add option to hide skip messages on unit/test
http://redmine.ruby-lang.org/issues/4657

Author: Shota Fukumori
Status: Open
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

In This Thread

Prev Next