summaryrefslogtreecommitdiff
path: root/bootstraptest
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2022-09-28 21:39:25 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2022-09-28 23:18:55 +0900
commitfc54dbe8b40d131c72e9216b5ec2b50ae7fb5107 (patch)
treef1311af071965947ffdd1449f1b48157d161b1bf /bootstraptest
parent3c3bd03a7c4d2213367c65a9aa92f255e1d6cbc9 (diff)
downloadruby-fc54dbe8b40d131c72e9216b5ec2b50ae7fb5107.tar.gz
bootstraptest/runner: fold dots by window size
Diffstat (limited to 'bootstraptest')
-rwxr-xr-xbootstraptest/runner.rb31
1 files changed, 27 insertions, 4 deletions
diff --git a/bootstraptest/runner.rb b/bootstraptest/runner.rb
index 9699b10bc0..f88fa1b102 100755
--- a/bootstraptest/runner.rb
+++ b/bootstraptest/runner.rb
@@ -73,9 +73,32 @@ BT = Struct.new(:ruby,
:failed,
:reset,
:columns,
+ :window_width,
:width,
:platform,
- ).new
+ ) do
+ def putc(c)
+ unless self.quiet
+ if self.window_width == nil
+ if BT.tty
+ unless w = ENV["COLUMNS"] and (w = w.to_i) > 0
+ w = 80
+ end
+ w -= 1
+ else
+ w = false
+ end
+ self.window_width = w
+ end
+ if self.window_width and self.columns >= self.window_width
+ $stderr.puts
+ self.columns = 0
+ end
+ $stderr.print c
+ self.columns += 1
+ end
+ end
+end.new
BT_STATE = Struct.new(:count, :error).new
@@ -240,7 +263,7 @@ def concurrent_exec_test
end
end
- $stderr.print ' ' unless BT.quiet
+ BT.putc ' '
aq.close
i = 1
term_wn = 0
@@ -252,7 +275,7 @@ def concurrent_exec_test
when BT.tty
$stderr.print "#{BT.progress_bs}#{BT.progress[(i+=1) % BT.progress.size]}"
else
- $stderr.print '.'
+ BT.putc '.'
end
else
term_wn += 1
@@ -427,7 +450,7 @@ class Assertion < Struct.new(:src, :path, :lineno, :proc)
elsif BT.verbose
$stderr.printf(". %.3f\n", t)
else
- $stderr.print '.'
+ BT.putc '.'
end
else
$stderr.print "#{BT.failed}F"