summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-05-07 18:53:42 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-05-07 18:53:42 +0000
commita6003269b6a8c80496141c91c778d169386da486 (patch)
tree54614fc3177475ddf568b46da218d896eb087764
parent8da4634bc31db3e8ec4f20ef734aac1e3053dc14 (diff)
bootstraptest/runner.rb: refine output
* bootstraptest/runner.rb (exec_test, show_progress): show rotators and pass/fail counts. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35575 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rwxr-xr-xbootstraptest/runner.rb26
2 files changed, 29 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 3bf244a..f9832ce 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,7 @@
-Tue May 8 03:51:19 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue May 8 03:53:40 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * bootstraptest/runner.rb (exec_test, show_progress): show rotators
+ and pass/fail counts.
* sample/test.rb (PROGRESS): refine output.
diff --git a/bootstraptest/runner.rb b/bootstraptest/runner.rb
index eaed292..9341a33 100755
--- a/bootstraptest/runner.rb
+++ b/bootstraptest/runner.rb
@@ -110,6 +110,16 @@ End
tests = Dir.glob("#{File.dirname($0)}/test_*.rb").sort if tests.empty?
pathes = tests.map {|path| File.expand_path(path) }
+ @progress = %w[- \\ | /]
+ @progress_bs = "\b" * @progress[0].size
+ @tty = !@verbose && $stderr.tty?
+ if @tty and /mswin|mingw/ !~ RUBY_PLATFORM and /dumb/ !~ ENV["TERM"]
+ @passed = "\e[32m"
+ @failed = "\e[31m"
+ @reset = "\e[m"
+ else
+ @passed = @failed = @reset = ""
+ end
unless quiet
puts Time.now
if defined?(RUBY_DESCRIPTION)
@@ -136,8 +146,18 @@ def exec_test(pathes)
@location = nil
pathes.each do |path|
$stderr.print "\n#{File.basename(path)} "
+ $stderr.print @progress[@count % @progress.size] if @tty
$stderr.puts if @verbose
+ count = @count
+ error = @error
load File.expand_path(path)
+ if @tty
+ if @error == error
+ $stderr.print "#{@progress_bs}#{@passed}PASS #{@count-count}#{@reset}"
+ else
+ $stderr.print "#{@progress_bs}#{@failed}FAIL #{@error-error}/#{@count-count}#{@reset}"
+ end
+ end
end
$stderr.puts
if @error == 0
@@ -162,7 +182,11 @@ def show_progress(message = '')
end
faildesc = yield
if !faildesc
- $stderr.print '.'
+ if @tty
+ $stderr.print "#{@progress_bs}#{@progress[@count % @progress.size]}"
+ else
+ $stderr.print '.'
+ end
$stderr.puts if @verbose
else
$stderr.print 'F'