From c5746c45b2f080f0ede4b69c8e94700b4ac83092 Mon Sep 17 00:00:00 2001 From: ryan Date: Thu, 25 Sep 2008 06:57:05 +0000 Subject: I finally clued into the fact that test/unit's -x was for file level filtering... so that is not going into miniunit and instead goes into test/runner.rb git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19541 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/runner.rb | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'test/runner.rb') diff --git a/test/runner.rb b/test/runner.rb index 0c89c0c76e..fb72c71556 100644 --- a/test/runner.rb +++ b/test/runner.rb @@ -20,10 +20,29 @@ $:.push(*Dir[File.join(test_dir, '*')].find_all { |path| File.directory? path }) test_files = (Dir[File.join(test_dir, "test_*.rb")] + Dir[File.join(test_dir, "**/test_*.rb")]) -flags, files = ARGV.partition { |arg| arg =~ /^-/ } +files = [] +other = [] + +until ARGV.empty? do + arg = ARGV.shift + case arg + when /^-x$/ then + filter = ARGV.shift + test_files.reject! { |f| f =~ /#{filter}/ } + when /^--$/ then + other.push(*ARGV) + ARGV.clear + break + when /^-/ then + other << arg + else + files << arg + end +end + test_files = test_files.grep(Regexp.union(*files)) unless files.empty? -ARGV.replace flags +ARGV.replace other # this passes through to miniunit test_files.each do |test| require test -- cgit v1.2.3