summaryrefslogtreecommitdiff
path: root/test/runner.rb
diff options
context:
space:
mode:
authorryan <ryan@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-25 06:57:05 +0000
committerryan <ryan@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-25 06:57:05 +0000
commitc5746c45b2f080f0ede4b69c8e94700b4ac83092 (patch)
treee998a8d683c8f7eefa2462b51f9b4db1afefacc5 /test/runner.rb
parent2c59d0ee7079a862f0d0ea2433286e141973afad (diff)
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
Diffstat (limited to 'test/runner.rb')
-rw-r--r--test/runner.rb23
1 files changed, 21 insertions, 2 deletions
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