Separate failed output option
It is unrelated to `GlobOption` at all.
This commit is contained in:
parent
babdb158d1
commit
1b34bd07c1
@ -200,8 +200,6 @@ module Test
|
|||||||
" " + (s =~ /[\s|&<>$()]/ ? s.inspect : s)
|
" " + (s =~ /[\s|&<>$()]/ ? s.inspect : s)
|
||||||
}.join("\n")
|
}.join("\n")
|
||||||
|
|
||||||
@failed_output = options[:stderr_on_failure] ? $stderr : $stdout
|
|
||||||
|
|
||||||
@options = options
|
@options = options
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -1121,9 +1119,6 @@ module Test
|
|||||||
parser.on '-x', '--exclude REGEXP', 'Exclude test files on pattern.' do |pattern|
|
parser.on '-x', '--exclude REGEXP', 'Exclude test files on pattern.' do |pattern|
|
||||||
(options[:reject] ||= []) << pattern
|
(options[:reject] ||= []) << pattern
|
||||||
end
|
end
|
||||||
parser.on '--stderr-on-failure', 'Use stderr to print failure messages' do
|
|
||||||
options[:stderr_on_failure] = true
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def complement_test_name f, orig_f
|
def complement_test_name f, orig_f
|
||||||
@ -1183,6 +1178,23 @@ module Test
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
module OutputOption # :nodoc: all
|
||||||
|
def setup_options(parser, options)
|
||||||
|
super
|
||||||
|
parser.separator "output options:"
|
||||||
|
parser.on '--stderr-on-failure', 'Use stderr to print failure messages' do
|
||||||
|
options[:stderr_on_failure] = true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def process_args(args = [])
|
||||||
|
return @options if @options
|
||||||
|
options = super
|
||||||
|
@failed_output = options[:stderr_on_failure] ? $stderr : $stdout
|
||||||
|
options
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
module GCOption # :nodoc: all
|
module GCOption # :nodoc: all
|
||||||
def setup_options(parser, options)
|
def setup_options(parser, options)
|
||||||
super
|
super
|
||||||
@ -1668,6 +1680,7 @@ module Test
|
|||||||
prepend Test::Unit::Statistics
|
prepend Test::Unit::Statistics
|
||||||
prepend Test::Unit::Skipping
|
prepend Test::Unit::Skipping
|
||||||
prepend Test::Unit::GlobOption
|
prepend Test::Unit::GlobOption
|
||||||
|
prepend Test::Unit::OutputOption
|
||||||
prepend Test::Unit::RepeatOption
|
prepend Test::Unit::RepeatOption
|
||||||
prepend Test::Unit::LoadPathOption
|
prepend Test::Unit::LoadPathOption
|
||||||
prepend Test::Unit::GCOption
|
prepend Test::Unit::GCOption
|
||||||
|
Loading…
x
Reference in New Issue
Block a user