From 5eea2af4811ead7f9935a6670c7e672379f4cf92 Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 3 Mar 2015 05:20:22 +0000 Subject: [PATCH] test_rubyoptions.rb: use assert_segv * test/ruby/test_rubyoptions.rb (test_segv_loaded_features): use assert_segv to simplify. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49817 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_rubyoptions.rb | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb index 0ff96aee0a..b1ecef402a 100644 --- a/test/ruby/test_rubyoptions.rb +++ b/test/ruby/test_rubyoptions.rb @@ -571,26 +571,14 @@ class TestRubyOptions < Test::Unit::TestCase 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