mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
This commit is contained in:
parent
63a164f32e
commit
c45d780b83
1 changed files with 6 additions and 2 deletions
|
@ -15,10 +15,12 @@ class TestMkmf < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
class Capture
|
class Capture
|
||||||
|
attr_accessor :origin
|
||||||
def initialize
|
def initialize
|
||||||
@buffer = ""
|
@buffer = ""
|
||||||
@filter = nil
|
@filter = nil
|
||||||
@out = true
|
@out = true
|
||||||
|
@origin = nil
|
||||||
end
|
end
|
||||||
def clear
|
def clear
|
||||||
@buffer.clear
|
@buffer.clear
|
||||||
|
@ -33,8 +35,10 @@ class TestMkmf < Test::Unit::TestCase
|
||||||
initialize_copy(io)
|
initialize_copy(io)
|
||||||
when File
|
when File
|
||||||
@out = false
|
@out = false
|
||||||
|
@origin.reopen(io) if @origin
|
||||||
when IO
|
when IO
|
||||||
@out = true
|
@out = true
|
||||||
|
@origin.reopen(io) if @origin
|
||||||
else
|
else
|
||||||
@out = false
|
@out = false
|
||||||
end
|
end
|
||||||
|
@ -114,10 +118,10 @@ class TestMkmf < Test::Unit::TestCase
|
||||||
|
|
||||||
def mkmf(*args, &block)
|
def mkmf(*args, &block)
|
||||||
@stdout.clear
|
@stdout.clear
|
||||||
stdout, $stdout = $stdout, @stdout
|
stdout, @stdout.origin, $stdout = @stdout.origin, $stdout, @stdout
|
||||||
@mkmfobj.instance_eval(*args, &block)
|
@mkmfobj.instance_eval(*args, &block)
|
||||||
ensure
|
ensure
|
||||||
$stdout = stdout
|
$stdout, @stdout.origin = @stdout.origin, stdout
|
||||||
end
|
end
|
||||||
|
|
||||||
def config_value(name)
|
def config_value(name)
|
||||||
|
|
Loading…
Add table
Reference in a new issue