* lib/test/unit/autorunner.rb (Test::Unit::AutoRunner::options): add
new option --exclude (-x) to skip some tests. * lib/test/unit/collector/dir.rb (Test::Unit::Collector::Dir.exclude): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7279 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
6116dd832c
commit
c2b7884076
@ -1,3 +1,11 @@
|
|||||||
|
Tue Nov 16 13:35:54 2004 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
|
* lib/test/unit/autorunner.rb (Test::Unit::AutoRunner::options): add
|
||||||
|
new option --exclude (-x) to skip some tests.
|
||||||
|
|
||||||
|
* lib/test/unit/collector/dir.rb (Test::Unit::Collector::Dir.exclude):
|
||||||
|
ditto.
|
||||||
|
|
||||||
Tue Nov 16 11:19:07 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Tue Nov 16 11:19:07 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* lib/test/unit/autorunner.rb (Test::Unit::AutoRunner::options): use
|
* lib/test/unit/autorunner.rb (Test::Unit::AutoRunner::options): use
|
||||||
|
@ -56,12 +56,13 @@ module Test
|
|||||||
c = Collector::Dir.new
|
c = Collector::Dir.new
|
||||||
c.filter = r.filters
|
c.filter = r.filters
|
||||||
c.pattern = r.pattern if(r.pattern)
|
c.pattern = r.pattern if(r.pattern)
|
||||||
|
c.exclude = r.exclude if(r.exclude)
|
||||||
c.collect(*(r.to_run.empty? ? ['.'] : r.to_run))
|
c.collect(*(r.to_run.empty? ? ['.'] : r.to_run))
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
||||||
attr_reader :suite
|
attr_reader :suite
|
||||||
attr_accessor :output_level, :filters, :to_run, :pattern
|
attr_accessor :output_level, :filters, :to_run, :pattern, :exclude
|
||||||
attr_writer :runner, :collector
|
attr_writer :runner, :collector
|
||||||
|
|
||||||
def initialize(standalone)
|
def initialize(standalone)
|
||||||
@ -112,6 +113,11 @@ module Test
|
|||||||
"Match files to collect against PATTERN.") do |e|
|
"Match files to collect against PATTERN.") do |e|
|
||||||
@pattern = e
|
@pattern = e
|
||||||
end
|
end
|
||||||
|
|
||||||
|
o.on('-x', '--exclude=PATTERN', Regexp,
|
||||||
|
"Ignore files to collect against PATTERN.") do |e|
|
||||||
|
@exclude = e
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
o.on('-n', '--name=NAME', String,
|
o.on('-n', '--name=NAME', String,
|
||||||
|
@ -7,7 +7,7 @@ module Test
|
|||||||
class Dir
|
class Dir
|
||||||
include Collector
|
include Collector
|
||||||
|
|
||||||
attr_writer :pattern
|
attr_writer :pattern, :exclude
|
||||||
|
|
||||||
def initialize(dir=::Dir, file=::File, object_space=::ObjectSpace, req=nil)
|
def initialize(dir=::Dir, file=::File, object_space=::ObjectSpace, req=nil)
|
||||||
super()
|
super()
|
||||||
@ -16,6 +16,7 @@ module Test
|
|||||||
@object_space = object_space
|
@object_space = object_space
|
||||||
@req = req
|
@req = req
|
||||||
@pattern = /\Atest_.*\.rb\Z/m
|
@pattern = /\Atest_.*\.rb\Z/m
|
||||||
|
@exclude = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
def collect(*from)
|
def collect(*from)
|
||||||
@ -55,6 +56,7 @@ module Test
|
|||||||
sub_suites << sub_suite unless(sub_suite.empty?)
|
sub_suites << sub_suite unless(sub_suite.empty?)
|
||||||
else
|
else
|
||||||
(next unless(@pattern =~ e)) if(@pattern)
|
(next unless(@pattern =~ e)) if(@pattern)
|
||||||
|
(next if(@exclude =~ e)) if(@exclude)
|
||||||
collect_file(e_name, sub_suites, already_gathered)
|
collect_file(e_name, sub_suites, already_gathered)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user