From c45d780b830dba93d67fd49bccafc401b3805bcb Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 8 May 2012 06:50:05 +0000 Subject: test/mkmf/base.rb: hide compiler output * test/mkmf/base.rb (TestMkmf::Capture#reopen): reopen replaced IO too, to hide compiler output. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/mkmf/base.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/mkmf/base.rb b/test/mkmf/base.rb index ee32fb0c9b..7df1e8961f 100644 --- a/test/mkmf/base.rb +++ b/test/mkmf/base.rb @@ -15,10 +15,12 @@ class TestMkmf < Test::Unit::TestCase end class Capture + attr_accessor :origin def initialize @buffer = "" @filter = nil @out = true + @origin = nil end def clear @buffer.clear @@ -33,8 +35,10 @@ class TestMkmf < Test::Unit::TestCase initialize_copy(io) when File @out = false + @origin.reopen(io) if @origin when IO @out = true + @origin.reopen(io) if @origin else @out = false end @@ -114,10 +118,10 @@ class TestMkmf < Test::Unit::TestCase def mkmf(*args, &block) @stdout.clear - stdout, $stdout = $stdout, @stdout + stdout, @stdout.origin, $stdout = @stdout.origin, $stdout, @stdout @mkmfobj.instance_eval(*args, &block) ensure - $stdout = stdout + $stdout, @stdout.origin = @stdout.origin, stdout end def config_value(name) -- cgit v1.2.3