* gc.c (rb_gc_set_params): allow GC parameter configuration by

environment variables.  based on a patch from funny-falcon at
  https://gist.github.com/856296, but honors safe level.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2011-03-07 08:39:39 +00:00
parent c414d861c1
commit eb807d42ec
67 changed files with 773 additions and 1845 deletions

View file

@ -384,20 +384,16 @@ class TestProcess < Test::Unit::TestCase
Process.wait Process.spawn(*ECHO["c"], STDERR=>STDOUT, STDOUT=>["out", File::WRONLY|File::CREAT|File::TRUNC, 0644])
assert_equal("c", File.read("out").chomp)
File.open("out", "w") {|f|
Process.wait Process.spawn(*ECHO["d"], STDOUT=>f)
Process.wait Process.spawn(*ECHO["d"], f=>STDOUT, STDOUT=>f)
assert_equal("d", File.read("out").chomp)
}
opts = {STDOUT=>["out", File::WRONLY|File::CREAT|File::TRUNC, 0644]}
if /mswin|mingw/ !~ RUBY_PLATFORM
opts.merge(3=>STDOUT, 4=>STDOUT, 5=>STDOUT, 6=>STDOUT, 7=>STDOUT)
end
Process.wait Process.spawn(*ECHO["e"], opts)
Process.wait Process.spawn(*ECHO["e"], STDOUT=>["out", File::WRONLY|File::CREAT|File::TRUNC, 0644],
3=>STDOUT, 4=>STDOUT, 5=>STDOUT, 6=>STDOUT, 7=>STDOUT)
assert_equal("e", File.read("out").chomp)
opts = {STDOUT=>["out", File::WRONLY|File::CREAT|File::TRUNC, 0644]}
if /mswin|mingw/ !~ RUBY_PLATFORM
opts.merge(3=>0, 4=>:in, 5=>STDIN, 6=>1, 7=>:out, 8=>STDOUT, 9=>2, 10=>:err, 11=>STDERR)
end
Process.wait Process.spawn(*ECHO["ee"], opts)
Process.wait Process.spawn(*ECHO["ee"], STDOUT=>["out", File::WRONLY|File::CREAT|File::TRUNC, 0644],
3=>0, 4=>:in, 5=>STDIN,
6=>1, 7=>:out, 8=>STDOUT,
9=>2, 10=>:err, 11=>STDERR)
assert_equal("ee", File.read("out").chomp)
if /mswin|mingw/ !~ RUBY_PLATFORM
# passing non-stdio fds is not supported on Windows