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)
|
||||
}.join("\n")
|
||||
|
||||
@failed_output = options[:stderr_on_failure] ? $stderr : $stdout
|
||||
|
||||
@options = options
|
||||
end
|
||||
|
||||
@ -1121,9 +1119,6 @@ module Test
|
||||
parser.on '-x', '--exclude REGEXP', 'Exclude test files on pattern.' do |pattern|
|
||||
(options[:reject] ||= []) << pattern
|
||||
end
|
||||
parser.on '--stderr-on-failure', 'Use stderr to print failure messages' do
|
||||
options[:stderr_on_failure] = true
|
||||
end
|
||||
end
|
||||
|
||||
def complement_test_name f, orig_f
|
||||
@ -1183,6 +1178,23 @@ module Test
|
||||
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
|
||||
def setup_options(parser, options)
|
||||
super
|
||||
@ -1668,6 +1680,7 @@ module Test
|
||||
prepend Test::Unit::Statistics
|
||||
prepend Test::Unit::Skipping
|
||||
prepend Test::Unit::GlobOption
|
||||
prepend Test::Unit::OutputOption
|
||||
prepend Test::Unit::RepeatOption
|
||||
prepend Test::Unit::LoadPathOption
|
||||
prepend Test::Unit::GCOption
|
||||
|
Loading…
x
Reference in New Issue
Block a user