ruby-changes:30153
From: nobu <ko1@a...>
Date: Sun, 28 Jul 2013 03:12:16 +0900 (JST)
Subject: [ruby-changes:30153] nobu:r42205 (trunk): test_rubyoptions.rb: split test_segv_test
nobu 2013-07-28 03:10:36 +0900 (Sun, 28 Jul 2013) New Revision: 42205 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=42205 Log: test_rubyoptions.rb: split test_segv_test * test/ruby/test_rubyoptions.rb (test_segv_test): split assertions to each tests. Modified files: trunk/test/ruby/test_rubyoptions.rb Index: test/ruby/test_rubyoptions.rb =================================================================== --- test/ruby/test_rubyoptions.rb (revision 42204) +++ test/ruby/test_rubyoptions.rb (revision 42205) @@ -477,7 +477,7 @@ class TestRubyOptions < Test::Unit::Test https://github.com/ruby/ruby/blob/trunk/test/ruby/test_rubyoptions.rb#L477 end end - def test_segv_test + module SEGVTest opts = {} if /mswin|mingw/ =~ RUBY_PLATFORM additional = '[\s\w\.\']*' @@ -485,7 +485,9 @@ class TestRubyOptions < Test::Unit::Test https://github.com/ruby/ruby/blob/trunk/test/ruby/test_rubyoptions.rb#L485 opts[:rlimit_core] = 0 additional = "" end - expected_stderr = + ExecOptions = opts.freeze + + ExpectedStderr = %r(\A -e:(?:1:)?\s\[BUG\]\sSegmentation\sfault\n #{ Regexp.quote(RUBY_DESCRIPTION) }\n\n @@ -511,7 +513,17 @@ class TestRubyOptions < Test::Unit::Test https://github.com/ruby/ruby/blob/trunk/test/ruby/test_rubyoptions.rb#L513 (?:#{additional}) \z )x + end + + def test_segv_test + opts = SEGVTest::ExecOptions.dup + expected_stderr = SEGVTest::ExpectedStderr + assert_in_out_err(["--disable-gems", "-e", "Process.kill :SEGV, $$"], "", [], expected_stderr, nil, opts) + end + + def test_segv_loaded_features + opts = SEGVTest::ExecOptions.dup bug7402 = '[ruby-core:49573]' status = assert_in_out_err(['-e', 'class Bogus; def to_str; exit true; end; end', @@ -521,6 +533,11 @@ class TestRubyOptions < Test::Unit::Test https://github.com/ruby/ruby/blob/trunk/test/ruby/test_rubyoptions.rb#L533 nil, opts) assert_not_predicate(status, :success?, "segv but success #{bug7402}") + end + + def test_segv_setproctitle + opts = SEGVTest::ExecOptions.dup + expected_stderr = SEGVTest::ExpectedStderr bug7597 = '[ruby-dev:46786]' Tempfile.create(["test_ruby_test_bug7597", ".rb"]) {|t| -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/