зеркало из https://github.com/github/ruby.git
Allow to override environment variables for debug
This commit is contained in:
Родитель
ffe0f9eb6c
Коммит
85ee4a65a2
|
@ -9,8 +9,6 @@ class TestBugReporter < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
def test_bug_reporter_add
|
||||
omit if ENV['RUBY_ON_BUG']
|
||||
|
||||
description = RUBY_DESCRIPTION
|
||||
description = description.sub(/\+RJIT /, '') unless JITSupport.rjit_force_enabled?
|
||||
expected_stderr = [
|
||||
|
@ -27,6 +25,7 @@ class TestBugReporter < Test::Unit::TestCase
|
|||
args = ["--disable-gems", "-r-test-/bug_reporter",
|
||||
"-C", tmpdir]
|
||||
args.push("--yjit") if yjit_enabled? # We want the printed description to match this process's RUBY_DESCRIPTION
|
||||
args.unshift({"RUBY_ON_BUG" => nil})
|
||||
stdin = "#{no_core}register_sample_bug_reporter(12345); Process.kill :SEGV, $$"
|
||||
assert_in_out_err(args, stdin, [], expected_stderr, encoding: "ASCII-8BIT")
|
||||
ensure
|
||||
|
|
|
@ -789,11 +789,10 @@ class TestRubyOptions < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
def assert_segv(args, message=nil)
|
||||
omit if ENV['RUBY_ON_BUG']
|
||||
|
||||
# We want YJIT to be enabled in the subprocess if it's enabled for us
|
||||
# so that the Ruby description matches.
|
||||
args.unshift("--yjit") if self.class.yjit_enabled?
|
||||
args.unshift({'RUBY_ON_BUG' => nil})
|
||||
|
||||
test_stdin = ""
|
||||
opt = SEGVTest::ExecOptions.dup
|
||||
|
|
|
@ -155,7 +155,7 @@ module EnvUtil
|
|||
|
||||
# remain env
|
||||
%w(ASAN_OPTIONS RUBY_ON_BUG).each{|name|
|
||||
child_env[name] = ENV[name] if ENV[name]
|
||||
child_env = ENV[name] if !child_env.key?(name) and ENV.key?(name)
|
||||
}
|
||||
|
||||
args = [args] if args.kind_of?(String)
|
||||
|
|
Загрузка…
Ссылка в новой задаче