bin/tork-runner in tork-19.5.1 vs bin/tork-runner in tork-19.6.0

- old
+ new

@@ -1,9 +1,9 @@ #!/usr/bin/env ruby =begin ======================================================================= -# TORK-RUNNER 1 2013-12-02 19.5.1 +# TORK-RUNNER 1 2014-01-02 19.6.0 ## NAME tork-runner - runs tests once, non-interactively @@ -26,10 +26,15 @@ This message will be followed by the content of *failed\_test\_log\_file*. *T* `tested,` *P* `passed,` *F* `failed` *T* test files were tested and *P* of them passed but *F* of them failed. +This program prints the following messages to stderr if it is a TTY device. + +`tork-runner:` *NN.N*`% tested` + *NN.N* percent of test files were tested so far. + ## OPTIONS `-h`, `--help` Show this help manual. @@ -80,7 +85,12 @@ when :idle then puts failed.map {|log| [nil, ">> #{log} <<", File.read(log)] }, nil, "#{tested} tested, #{passed} passed, #{failed.count} failed" exit! failed.empty? end + + # tell user how many tests (percentage) have finished running; + # see http://www.termsys.demon.co.uk/vtansi.htm for ANSI VT100 + STDERR.printf "\e[s\e[K%s: %02.1f%% tested\e[u", $0, + ((passed + failed.count) / tested.to_f) * 100 if STDERR.tty? end end