Skip to content

Commit 85ee4a6

Browse files
committed
Allow to override environment variables for debug
1 parent ffe0f9e commit 85ee4a6

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

test/-ext-/bug_reporter/test_bug_reporter.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ def yjit_enabled?
99
end
1010

1111
def test_bug_reporter_add
12-
omit if ENV['RUBY_ON_BUG']
13-
1412
description = RUBY_DESCRIPTION
1513
description = description.sub(/\+RJIT /, '') unless JITSupport.rjit_force_enabled?
1614
expected_stderr = [
@@ -27,6 +25,7 @@ def test_bug_reporter_add
2725
args = ["--disable-gems", "-r-test-/bug_reporter",
2826
"-C", tmpdir]
2927
args.push("--yjit") if yjit_enabled? # We want the printed description to match this process's RUBY_DESCRIPTION
28+
args.unshift({"RUBY_ON_BUG" => nil})
3029
stdin = "#{no_core}register_sample_bug_reporter(12345); Process.kill :SEGV, $$"
3130
assert_in_out_err(args, stdin, [], expected_stderr, encoding: "ASCII-8BIT")
3231
ensure

test/ruby/test_rubyoptions.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -789,11 +789,10 @@ module SEGVTest
789789
end
790790

791791
def assert_segv(args, message=nil)
792-
omit if ENV['RUBY_ON_BUG']
793-
794792
# We want YJIT to be enabled in the subprocess if it's enabled for us
795793
# so that the Ruby description matches.
796794
args.unshift("--yjit") if self.class.yjit_enabled?
795+
args.unshift({'RUBY_ON_BUG' => nil})
797796

798797
test_stdin = ""
799798
opt = SEGVTest::ExecOptions.dup

tool/lib/envutil.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def invoke_ruby(args, stdin_data = "", capture_stdout = false, capture_stderr =
155155

156156
# remain env
157157
%w(ASAN_OPTIONS RUBY_ON_BUG).each{|name|
158-
child_env[name] = ENV[name] if ENV[name]
158+
child_env = ENV[name] if !child_env.key?(name) and ENV.key?(name)
159159
}
160160

161161
args = [args] if args.kind_of?(String)

0 commit comments

Comments
 (0)