summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKoichi Sasada <ko1@atdot.net>2022-01-26 01:51:16 +0900
committerKoichi Sasada <ko1@atdot.net>2022-01-26 09:56:27 +0900
commite953d6865724d8b7e79aa30c445d986f28f5e1c9 (patch)
tree3b816e815638e361f8466fd3eabf980b989624d7
parentcac6fe90236c8541059edc74080d50c49be7ea87 (diff)
refactoring btest output
don't duplicate the message, but prepare `out` var to choose stdout/err.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/5484
-rwxr-xr-xbootstraptest/runner.rb11
1 files changed, 5 insertions, 6 deletions
diff --git a/bootstraptest/runner.rb b/bootstraptest/runner.rb
index acc113b729..a4101594f1 100755
--- a/bootstraptest/runner.rb
+++ b/bootstraptest/runner.rb
@@ -213,15 +213,14 @@ def exec_test(pathes)
@errbuf.each do |msg|
$stderr.puts msg
end
+
+ out = @quiet ? $stdout : $stderr
+
if @error == 0
if @count == 0
- $stderr.puts "No tests, no problem" unless @quiet
+ out.puts "No tests, no problem" unless @quiet
else
- if @quiet
- $stdout.puts "#{@passed}PASS#{@reset} all #{@count} tests"
- else
- $stderr.puts "#{@passed}PASS#{@reset} all #{@count} tests"
- end
+ out.puts "#{@passed}PASS#{@reset} all #{@count} tests"
end
exit true
else