mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	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
This commit is contained in:
		
							parent
							
								
									f73a92e46b
								
							
						
					
					
						commit
						1e4550ac03
					
				
					 2 changed files with 3 additions and 14 deletions
				
			
		|  | @ -16,9 +16,7 @@ class TestBugReporter < Test::Unit::TestCase | ||||||
|     args = ["--disable-gems", "-r-test-/bug_reporter/bug_reporter", |     args = ["--disable-gems", "-r-test-/bug_reporter/bug_reporter", | ||||||
|             "-C", tmpdir] |             "-C", tmpdir] | ||||||
|     stdin = "register_sample_bug_reporter(12345); Process.kill :SEGV, $$" |     stdin = "register_sample_bug_reporter(12345); Process.kill :SEGV, $$" | ||||||
|     _, stderr, status = EnvUtil.invoke_ruby(args, stdin, false, true) |     assert_in_out_err(args, stdin, [], expected_stderr, encoding: "ASCII-8BIT") | ||||||
|     stderr.force_encoding("ASCII-8BIT") |  | ||||||
|     assert_pattern_list(expected_stderr, stderr) |  | ||||||
|   ensure |   ensure | ||||||
|     FileUtils.rm_rf(tmpdir) if tmpdir |     FileUtils.rm_rf(tmpdir) if tmpdir | ||||||
|   end |   end | ||||||
|  |  | ||||||
|  | @ -552,18 +552,9 @@ class TestRubyOptions < Test::Unit::TestCase | ||||||
|   def assert_segv(args, message=nil) |   def assert_segv(args, message=nil) | ||||||
|     test_stdin = "" |     test_stdin = "" | ||||||
|     opt = SEGVTest::ExecOptions.dup |     opt = SEGVTest::ExecOptions.dup | ||||||
|  |     list = SEGVTest::ExpectedStderrList | ||||||
| 
 | 
 | ||||||
|     _, stderr, status = EnvUtil.invoke_ruby(args, test_stdin, false, true, **opt) |     assert_in_out_err(args, test_stdin, //, list, encoding: "ASCII-8BIT", **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 |  | ||||||
|   end |   end | ||||||
| 
 | 
 | ||||||
|   def test_segv_test |   def test_segv_test | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 nobu
						nobu