From 1e4550ac03ac72c3229eb6eca446059616a02b92 Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 3 Mar 2015 08:19:43 +0000 Subject: [PATCH] test_rubyoptions.rb: use assert_in_out_err * test/ruby/test_rubyoptions.rb (assert_segv): assert_in_out_err with the pattern list instead of invoke_ruby. * test/-ext-/bug_reporter/test_bug_reporter.rb (test_bug_reporter_add): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49824 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/-ext-/bug_reporter/test_bug_reporter.rb | 4 +--- test/ruby/test_rubyoptions.rb | 13 ++----------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/test/-ext-/bug_reporter/test_bug_reporter.rb b/test/-ext-/bug_reporter/test_bug_reporter.rb index 6ac5b8f995..e68adeef06 100644 --- a/test/-ext-/bug_reporter/test_bug_reporter.rb +++ b/test/-ext-/bug_reporter/test_bug_reporter.rb @@ -16,9 +16,7 @@ class TestBugReporter < Test::Unit::TestCase args = ["--disable-gems", "-r-test-/bug_reporter/bug_reporter", "-C", tmpdir] stdin = "register_sample_bug_reporter(12345); Process.kill :SEGV, $$" - _, stderr, status = EnvUtil.invoke_ruby(args, stdin, false, true) - stderr.force_encoding("ASCII-8BIT") - assert_pattern_list(expected_stderr, stderr) + assert_in_out_err(args, stdin, [], expected_stderr, encoding: "ASCII-8BIT") ensure FileUtils.rm_rf(tmpdir) if tmpdir end diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb index b1ecef402a..ab0901d1db 100644 --- a/test/ruby/test_rubyoptions.rb +++ b/test/ruby/test_rubyoptions.rb @@ -552,18 +552,9 @@ class TestRubyOptions < Test::Unit::TestCase def assert_segv(args, message=nil) test_stdin = "" opt = SEGVTest::ExecOptions.dup + list = SEGVTest::ExpectedStderrList - _, stderr, status = EnvUtil.invoke_ruby(args, test_stdin, false, true, **opt) - stderr.force_encoding("ASCII-8BIT") - - if signo = status.termsig - sleep 0.1 - EnvUtil.diagnostic_reports(Signal.signame(signo), EnvUtil.rubybin, status.pid, Time.now) - end - - assert_pattern_list(SEGVTest::ExpectedStderrList, stderr, message) - - status + assert_in_out_err(args, test_stdin, //, list, encoding: "ASCII-8BIT", **opt) end def test_segv_test