diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-06-26 07:46:26 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-06-26 07:46:26 +0000 |
commit | 5605afa5e218ea9ee62c4da358fab01b1bfa23e7 (patch) | |
tree | 0ed0dff958ced3b67f13d824321dcc86f5013c0a /bootstraptest/runner.rb | |
parent | ffa20cf154591dbef2761ef7c61af534b4908f4f (diff) | |
download | ruby-5605afa5e218ea9ee62c4da358fab01b1bfa23e7.tar.gz |
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 'bootstraptest/runner.rb')
-rwxr-xr-x | bootstraptest/runner.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/bootstraptest/runner.rb b/bootstraptest/runner.rb index 95981eeca2..eef8a20d19 100755 --- a/bootstraptest/runner.rb +++ b/bootstraptest/runner.rb @@ -62,6 +62,7 @@ def main @verbose = false $stress = false @color = nil + @quiet = false dir = nil quiet = false tests = nil @@ -88,6 +89,7 @@ def main true when /\A(-q|--q(uiet))\z/ quiet = true + @quiet = true true when /\A(-v|--v(erbose))\z/ @verbose = true @@ -162,7 +164,7 @@ def exec_test(pathes) @errbuf = [] @location = nil pathes.each do |path| - $stderr.print "\n#{File.basename(path)} " + $stderr.print "#{File.basename(path)} " $stderr.print @progress[@count % @progress.size] if @tty $stderr.puts if @verbose count = @count @@ -171,12 +173,13 @@ def exec_test(pathes) if @tty if @error == error $stderr.print "#{@progress_bs}#{@passed}PASS #{@count-count}#{@reset}" + $stderr.print "\r\e[2K\r" if @quiet else $stderr.print "#{@progress_bs}#{@failed}FAIL #{@error-error}/#{@count-count}#{@reset}" end end + $stderr.puts unless @quiet end - $stderr.puts if @error == 0 if @count == 0 $stderr.puts "No tests, no problem" |