ruby-changes:59940
From: Nobuyoshi <ko1@a...>
Date: Thu, 6 Feb 2020 20:57:45 +0900 (JST)
Subject: [ruby-changes:59940] 5fac54a594 (master): Fixed the output from separated test in parallel test
https://git.ruby-lang.org/ruby.git/commit/?id=5fac54a594 From 5fac54a594b475e7b7a07e925c0353e18c685f2b Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Thu, 6 Feb 2020 20:53:11 +0900 Subject: Fixed the output from separated test in parallel test Redirect the output of separated child process to `MiniTest::Unit.output`. diff --git a/tool/lib/test/unit/core_assertions.rb b/tool/lib/test/unit/core_assertions.rb index edaf839..836d712 100644 --- a/tool/lib/test/unit/core_assertions.rb +++ b/tool/lib/test/unit/core_assertions.rb @@ -110,9 +110,12 @@ module Test https://github.com/ruby/ruby/blob/trunk/tool/lib/test/unit/core_assertions.rb#L110 file ||= loc.path line ||= loc.lineno end + capture_stdout = true if /mswin|mingw/ =~ RUBY_PLATFORM res_out = "STDOUT" else + capture_stdout = false + opt[:out] = MiniTest::Unit.output res_p, res_c = IO.pipe opt[res_c.fileno] = res_c.fileno res_out = "IO.new(#{res_c.fileno}, 'w')" @@ -130,7 +133,7 @@ module Test https://github.com/ruby/ruby/blob/trunk/tool/lib/test/unit/core_assertions.rb#L133 eom args = args.dup args.insert((Hash === args.first ? 1 : 0), "-w", "--disable=gems", *$:.map {|l| "-I#{l}"}) - stdout, stderr, status = EnvUtil.invoke_ruby(args, src, true, true, **opt) + stdout, stderr, status = EnvUtil.invoke_ruby(args, src, capture_stdout, true, **opt) if res_c res_c.close res = res_p.read -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/