summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-27 18:10:36 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-27 18:10:36 +0000
commitf1312bc0388b0603f208cef82d8ced4f669eb540 (patch)
treedaf397094d263cfa4960a87666b3905f35654502
parent5b89a56b4f2fe7c71f3d718062ee43c9e3b15cd0 (diff)
test_rubyoptions.rb: split test_segv_test
* test/ruby/test_rubyoptions.rb (test_segv_test): split assertions to each tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42205 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--test/ruby/test_rubyoptions.rb21
1 files changed, 19 insertions, 2 deletions
diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb
index 5e1d2f0cfad..35422ae2ac8 100644
--- a/test/ruby/test_rubyoptions.rb
+++ b/test/ruby/test_rubyoptions.rb
@@ -477,7 +477,7 @@ class TestRubyOptions < Test::Unit::TestCase
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::TestCase
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::TestCase
(?:#{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::TestCase
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|