summaryrefslogtreecommitdiff
path: root/bootstraptest/runner.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-01-15 00:59:19 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-01-15 00:59:19 +0000
commitbd407329df45d84b57fd74329882823d224aecc1 (patch)
treefaabf89d27b64288ebcd1e8d7851ac78eeb4e4ea /bootstraptest/runner.rb
parentcccd464e4d8f84dda8d8c65e825232cd52b8b5b4 (diff)
test: tty option
* bootstraptest/runner.rb (main): add --tty option to output like terminal, for mingw/mswin on cygwin. * lib/test/unit.rb (Test::Unit::Options#setup_options): ditto. * sample/test.rb (Progress#initialize): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38821 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bootstraptest/runner.rb')
-rwxr-xr-xbootstraptest/runner.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/bootstraptest/runner.rb b/bootstraptest/runner.rb
index 246e52e9a5..75e255428a 100755
--- a/bootstraptest/runner.rb
+++ b/bootstraptest/runner.rb
@@ -62,6 +62,7 @@ def main
@verbose = false
$stress = false
@color = nil
+ @tty = nil
@quiet = false
dir = nil
quiet = false
@@ -87,6 +88,10 @@ def main
warn "unknown --color argument: #$3" if $3
@color = $1 ? nil : !$2
true
+ when /\A--tty(=(?:yes|(no)|(.*)))?\z/
+ warn "unknown --tty argument: #$3" if $3
+ @tty = !$1 || !$2
+ true
when /\A(-q|--q(uiet))\z/
quiet = true
@quiet = true
@@ -123,7 +128,7 @@ End
@progress = %w[- \\ | /]
@progress_bs = "\b" * @progress[0].size
- @tty = $stderr.tty?
+ @tty = $stderr.tty? if @tty.nil?
case @color
when nil
@color = @tty && /dumb/ !~ ENV["TERM"]