mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
3 changed files with 18 additions and 2 deletions
|
@ -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>
|
||||
|
||||
* lib/test/unit/autorunner.rb (Test::Unit::AutoRunner::options): use
|
||||
|
|
|
@ -56,12 +56,13 @@ module Test
|
|||
c = Collector::Dir.new
|
||||
c.filter = r.filters
|
||||
c.pattern = r.pattern if(r.pattern)
|
||||
c.exclude = r.exclude if(r.exclude)
|
||||
c.collect(*(r.to_run.empty? ? ['.'] : r.to_run))
|
||||
end,
|
||||
}
|
||||
|
||||
attr_reader :suite
|
||||
attr_accessor :output_level, :filters, :to_run, :pattern
|
||||
attr_accessor :output_level, :filters, :to_run, :pattern, :exclude
|
||||
attr_writer :runner, :collector
|
||||
|
||||
def initialize(standalone)
|
||||
|
@ -112,6 +113,11 @@ module Test
|
|||
"Match files to collect against PATTERN.") do |e|
|
||||
@pattern = e
|
||||
end
|
||||
|
||||
o.on('-x', '--exclude=PATTERN', Regexp,
|
||||
"Ignore files to collect against PATTERN.") do |e|
|
||||
@exclude = e
|
||||
end
|
||||
end
|
||||
|
||||
o.on('-n', '--name=NAME', String,
|
||||
|
|
|
@ -7,7 +7,7 @@ module Test
|
|||
class Dir
|
||||
include Collector
|
||||
|
||||
attr_writer :pattern
|
||||
attr_writer :pattern, :exclude
|
||||
|
||||
def initialize(dir=::Dir, file=::File, object_space=::ObjectSpace, req=nil)
|
||||
super()
|
||||
|
@ -16,6 +16,7 @@ module Test
|
|||
@object_space = object_space
|
||||
@req = req
|
||||
@pattern = /\Atest_.*\.rb\Z/m
|
||||
@exclude = nil
|
||||
end
|
||||
|
||||
def collect(*from)
|
||||
|
@ -55,6 +56,7 @@ module Test
|
|||
sub_suites << sub_suite unless(sub_suite.empty?)
|
||||
else
|
||||
(next unless(@pattern =~ e)) if(@pattern)
|
||||
(next if(@exclude =~ e)) if(@exclude)
|
||||
collect_file(e_name, sub_suites, already_gathered)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue