Allow to override environment variables for debug
This commit is contained in:
parent
ffe0f9eb6c
commit
85ee4a65a2
@ -9,8 +9,6 @@ class TestBugReporter < Test::Unit::TestCase
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_bug_reporter_add
|
def test_bug_reporter_add
|
||||||
omit if ENV['RUBY_ON_BUG']
|
|
||||||
|
|
||||||
description = RUBY_DESCRIPTION
|
description = RUBY_DESCRIPTION
|
||||||
description = description.sub(/\+RJIT /, '') unless JITSupport.rjit_force_enabled?
|
description = description.sub(/\+RJIT /, '') unless JITSupport.rjit_force_enabled?
|
||||||
expected_stderr = [
|
expected_stderr = [
|
||||||
@ -27,6 +25,7 @@ class TestBugReporter < Test::Unit::TestCase
|
|||||||
args = ["--disable-gems", "-r-test-/bug_reporter",
|
args = ["--disable-gems", "-r-test-/bug_reporter",
|
||||||
"-C", tmpdir]
|
"-C", tmpdir]
|
||||||
args.push("--yjit") if yjit_enabled? # We want the printed description to match this process's RUBY_DESCRIPTION
|
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, $$"
|
stdin = "#{no_core}register_sample_bug_reporter(12345); Process.kill :SEGV, $$"
|
||||||
assert_in_out_err(args, stdin, [], expected_stderr, encoding: "ASCII-8BIT")
|
assert_in_out_err(args, stdin, [], expected_stderr, encoding: "ASCII-8BIT")
|
||||||
ensure
|
ensure
|
||||||
|
@ -789,11 +789,10 @@ class TestRubyOptions < Test::Unit::TestCase
|
|||||||
end
|
end
|
||||||
|
|
||||||
def assert_segv(args, message=nil)
|
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
|
# We want YJIT to be enabled in the subprocess if it's enabled for us
|
||||||
# so that the Ruby description matches.
|
# so that the Ruby description matches.
|
||||||
args.unshift("--yjit") if self.class.yjit_enabled?
|
args.unshift("--yjit") if self.class.yjit_enabled?
|
||||||
|
args.unshift({'RUBY_ON_BUG' => nil})
|
||||||
|
|
||||||
test_stdin = ""
|
test_stdin = ""
|
||||||
opt = SEGVTest::ExecOptions.dup
|
opt = SEGVTest::ExecOptions.dup
|
||||||
|
@ -155,7 +155,7 @@ module EnvUtil
|
|||||||
|
|
||||||
# remain env
|
# remain env
|
||||||
%w(ASAN_OPTIONS RUBY_ON_BUG).each{|name|
|
%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)
|
args = [args] if args.kind_of?(String)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user