summaryrefslogtreecommitdiff
path: root/sample
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-06-26 07:46:26 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-06-26 07:46:26 +0000
commit5605afa5e218ea9ee62c4da358fab01b1bfa23e7 (patch)
tree0ed0dff958ced3b67f13d824321dcc86f5013c0a /sample
parentffa20cf154591dbef2761ef7c61af534b4908f4f (diff)
test: reduce output if succeded
* bootstraptest/runner.rb (exec_test): reduce output if succeded. * sample/test.rb (PROGRESS.finish): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36221 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sample')
-rwxr-xr-xsample/test.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/sample/test.rb b/sample/test.rb
index dcb4cdf24b..50de4cd778 100755
--- a/sample/test.rb
+++ b/sample/test.rb
@@ -7,10 +7,13 @@ $failed = 0
PROGRESS = Object.new
PROGRESS.instance_eval do
@color = nil
+ @quiet = nil
case ARGV[0]
when /\A--color(?:=(?:always|(auto)|(never)|(.*)))?\z/
warn "unknown --color argument: #$3" if $3
@color = $1 ? nil : !$2
+ when /\A-(q|-quiet)\z/
+ @quiet = true
end
@count = 0
@rotator = %w[- \\ | /]
@@ -46,6 +49,7 @@ PROGRESS.instance_eval do
end
def self.finish
STDERR.print "#{@bs}#{' ' * @bs.size}#{@bs}#{@passed}#{@ok ? 'OK' : ''} #{$testnum}#{@reset}"
+ STDERR.print @quiet ? "\r\e[2K\r" : "\n"
end
else
def self.pass
@@ -65,7 +69,7 @@ def test_check(what)
unless $ntest.zero?
PROGRESS.finish
end
- STDERR.print "\nsample/test.rb:#{what} "
+ STDERR.print "sample/test.rb:#{what} "
PROGRESS.init
$what = what
$testnum = 0