Skip to content

Commit

Permalink
Update the latest version of CoreAssertions
Browse files Browse the repository at this point in the history
  • Loading branch information
hsbt committed Jun 1, 2021
1 parent 293e42b commit 6fae307
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion test/lib/core_assertions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ def assert_ruby_status(args, test_stdin="", message=nil, **opt)
ABORT_SIGNALS = Signal.list.values_at(*%w"ILL ABRT BUS SEGV TERM")

def separated_runner(out = nil)
include(*Test::Unit::TestCase.ancestors.select {|c| !c.is_a?(Class) })
out = out ? IO.new(out, 'w') : STDOUT
at_exit {
out.puts [Marshal.dump($!)].pack('m'), "assertions=\#{self._assertions}"
Expand All @@ -278,7 +279,7 @@ def assert_separately(args, file = nil, line = nil, src, ignore_stderr: nil, **o
capture_stdout = false
opt[:out] = MiniTest::Unit.output if defined?(MiniTest::Unit)
res_p, res_c = IO.pipe
opt[res_c.fileno] = res_c.fileno
opt[:ios] = [res_c]
end
src = <<eom
# -*- coding: #{line += __LINE__; src.encoding}; -*-
Expand Down
6 changes: 4 additions & 2 deletions test/lib/envutil.rb
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def terminate(pid, signal = :TERM, pgroup = nil, reprieve = 1)

def invoke_ruby(args, stdin_data = "", capture_stdout = false, capture_stderr = false,
encoding: nil, timeout: 10, reprieve: 1, timeout_error: Timeout::Error,
stdout_filter: nil, stderr_filter: nil,
stdout_filter: nil, stderr_filter: nil, ios: nil,
signal: :TERM,
rubybin: EnvUtil.rubybin, precommand: nil,
**opt)
Expand All @@ -141,6 +141,8 @@ def invoke_ruby(args, stdin_data = "", capture_stdout = false, capture_stderr =
out_p.set_encoding(encoding) if out_p
err_p.set_encoding(encoding) if err_p
end
ios.each {|i, o = i|opt[i] = o} if ios

c = "C"
child_env = {}
LANG_ENVS.each {|lc| child_env[lc] = c}
Expand All @@ -152,7 +154,7 @@ def invoke_ruby(args, stdin_data = "", capture_stdout = false, capture_stderr =
end
child_env['ASAN_OPTIONS'] = ENV['ASAN_OPTIONS'] if ENV['ASAN_OPTIONS']
args = [args] if args.kind_of?(String)
pid = spawn(child_env, *precommand, rubybin, *args, **opt)
pid = spawn(child_env, *precommand, rubybin, *args, opt)
in_c.close
out_c&.close
out_c = nil
Expand Down

0 comments on commit 6fae307

Please sign in to comment.