[前][次][番号順一覧][スレッド一覧]

ruby-changes:37736

From: nobu <ko1@a...>
Date: Tue, 3 Mar 2015 14:20:43 +0900 (JST)
Subject: [ruby-changes:37736] nobu:r49817 (trunk): test_rubyoptions.rb: use assert_segv

nobu	2015-03-03 14:20:22 +0900 (Tue, 03 Mar 2015)

  New Revision: 49817

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=49817

  Log:
    test_rubyoptions.rb: use assert_segv
    
    * test/ruby/test_rubyoptions.rb (test_segv_loaded_features): use
      assert_segv to simplify.

  Modified files:
    trunk/test/ruby/test_rubyoptions.rb
Index: test/ruby/test_rubyoptions.rb
===================================================================
--- test/ruby/test_rubyoptions.rb	(revision 49816)
+++ test/ruby/test_rubyoptions.rb	(revision 49817)
@@ -571,26 +571,14 @@ class TestRubyOptions < Test::Unit::Test https://github.com/ruby/ruby/blob/trunk/test/ruby/test_rubyoptions.rb#L571
   end
 
   def test_segv_loaded_features
-    opts = SEGVTest::ExecOptions.dup
-
     bug7402 = '[ruby-core:49573]'
 
-    status = Dir.mktmpdir("segv_test") do |tmpdir|
-      assert_in_out_err(['-e', 'class Bogus; def to_str; exit true; end; end',
-                         '-e', '$".clear',
-                         '-e', '$".unshift Bogus.new',
-                         '-e', '(p $"; abort) unless $".size == 1',
-                         '-e', 'Process.kill :SEGV, $$',
-                         '-C', tmpdir,
-                        ],
-                        "", [], //,
-                        nil,
-                        opts)
-    end
-    if signo = status.termsig
-      sleep 0.1
-      EnvUtil.diagnostic_reports(Signal.signame(signo), EnvUtil.rubybin, status.pid, Time.now)
-    end
+    status = assert_segv(['-e', 'END {Process.kill :SEGV, $$}',
+                          '-e', 'class Bogus; def to_str; exit true; end; end',
+                          '-e', '$".clear',
+                          '-e', '$".unshift Bogus.new',
+                          '-e', '(p $"; abort) unless $".size == 1',
+                         ])
     assert_not_predicate(status, :success?, "segv but success #{bug7402}")
   end
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]