mirror of
https://github.com/ruby/ruby.git
synced 2026-01-27 12:34:21 +00:00
Suppress stderr output in TestRubyOptions#assert_segv
It is checked against the given `list`, do not print the same output twice.
This commit is contained in:
parent
85e61eac85
commit
f0371efbd8
Notes:
git
2025-06-16 11:45:03 +00:00
@ -787,6 +787,12 @@ class TestRubyOptions < Test::Unit::TestCase
|
||||
unless /mswin|mingw/ =~ RUBY_PLATFORM
|
||||
opts[:rlimit_core] = 0
|
||||
end
|
||||
opts[:failed] = proc do |status, message = "", out = ""|
|
||||
if (sig = status.termsig) && Signal.list["SEGV"] == sig
|
||||
out = ""
|
||||
end
|
||||
Test::Unit::CoreAssertions::FailDesc[status, message]
|
||||
end
|
||||
ExecOptions = opts.freeze
|
||||
|
||||
# The regexp list that should match the entire stderr output.
|
||||
|
||||
@ -97,11 +97,12 @@ module Test
|
||||
end
|
||||
|
||||
def assert_in_out_err(args, test_stdin = "", test_stdout = [], test_stderr = [], message = nil,
|
||||
success: nil, **opt)
|
||||
success: nil, failed: nil, **opt)
|
||||
args = Array(args).dup
|
||||
args.insert((Hash === args[0] ? 1 : 0), '--disable=gems')
|
||||
stdout, stderr, status = EnvUtil.invoke_ruby(args, test_stdin, true, true, **opt)
|
||||
desc = FailDesc[status, message, stderr]
|
||||
desc = failed[status, message, stderr] if failed
|
||||
desc ||= FailDesc[status, message, stderr]
|
||||
if block_given?
|
||||
raise "test_stdout ignored, use block only or without block" if test_stdout != []
|
||||
raise "test_stderr ignored, use block only or without block" if test_stderr != []
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user