mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/test/unit/parallel.rb: Keep $stdin, $stdout before run testcase
and restore after run. Because some test break $stdin, $stdout. Fixes [Bug #4433] [ruby-core:35353] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
19c78f9b9b
commit
d1a7670baf
1 changed files with 8 additions and 2 deletions
|
@ -26,9 +26,11 @@ module Test
|
||||||
|
|
||||||
def _run_suite(suite, type)
|
def _run_suite(suite, type)
|
||||||
r = report.dup
|
r = report.dup
|
||||||
orig_stdout = MiniTest::Unit.output
|
orig_testout = MiniTest::Unit.output
|
||||||
i,o = IO.pipe
|
i,o = IO.pipe
|
||||||
|
|
||||||
MiniTest::Unit.output = o
|
MiniTest::Unit.output = o
|
||||||
|
orig_stdin, orig_stdout = $stdin, $stdout
|
||||||
|
|
||||||
th = Thread.new do
|
th = Thread.new do
|
||||||
begin
|
begin
|
||||||
|
@ -49,7 +51,9 @@ module Test
|
||||||
result = [nil,nil]
|
result = [nil,nil]
|
||||||
end
|
end
|
||||||
|
|
||||||
MiniTest::Unit.output = orig_stdout
|
MiniTest::Unit.output = orig_testout
|
||||||
|
$stdin = orig_stdin
|
||||||
|
$stdout = orig_stdout
|
||||||
|
|
||||||
o.close
|
o.close
|
||||||
begin
|
begin
|
||||||
|
@ -70,6 +74,8 @@ module Test
|
||||||
return result
|
return result
|
||||||
ensure
|
ensure
|
||||||
MiniTest::Unit.output = orig_stdout
|
MiniTest::Unit.output = orig_stdout
|
||||||
|
$stdin = orig_stdin
|
||||||
|
$stdout = orig_stdout
|
||||||
o.close if o && !o.closed?
|
o.close if o && !o.closed?
|
||||||
i.close if i && !i.closed?
|
i.close if i && !i.closed?
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue