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
This commit is contained in:
nobu 2015-03-03 05:20:22 +00:00
Родитель 3778826780
Коммит 5eea2af481
1 изменённых файлов: 6 добавлений и 18 удалений

Просмотреть файл

@ -571,26 +571,14 @@ class TestRubyOptions < Test::Unit::TestCase
end end
def test_segv_loaded_features def test_segv_loaded_features
opts = SEGVTest::ExecOptions.dup
bug7402 = '[ruby-core:49573]' bug7402 = '[ruby-core:49573]'
status = Dir.mktmpdir("segv_test") do |tmpdir| status = assert_segv(['-e', 'END {Process.kill :SEGV, $$}',
assert_in_out_err(['-e', 'class Bogus; def to_str; exit true; end; end', '-e', 'class Bogus; def to_str; exit true; end; end',
'-e', '$".clear', '-e', '$".clear',
'-e', '$".unshift Bogus.new', '-e', '$".unshift Bogus.new',
'-e', '(p $"; abort) unless $".size == 1', '-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
assert_not_predicate(status, :success?, "segv but success #{bug7402}") assert_not_predicate(status, :success?, "segv but success #{bug7402}")
end end