summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorryan <ryan@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-24 08:19:12 +0000
committerryan <ryan@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-24 08:19:12 +0000
commit41e7bec9c6d5df2c9729c58bae5a64c0f2ec6ee2 (patch)
tree6905ff15beec478e5b4fe98118fa696a4bb4cc83
parent3c6c7ac4eb2e0c85c0c2d13ed4e65b8e277e15b6 (diff)
downloadruby-41e7bec9c6d5df2c9729c58bae5a64c0f2ec6ee2.tar.gz
ruby-41e7bec9c6d5df2c9729c58bae5a64c0f2ec6ee2.tar.xz
ruby-41e7bec9c6d5df2c9729c58bae5a64c0f2ec6ee2.zip
Added ARGV filtering for tests. Allows for multiple values
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19520 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--test/runner.rb15
1 files changed, 11 insertions, 4 deletions
diff --git a/test/runner.rb b/test/runner.rb
index 0295260ba..fcbd15165 100644
--- a/test/runner.rb
+++ b/test/runner.rb
@@ -6,15 +6,22 @@ rcsid = %w$Id$
Version = rcsid[2].scan(/\d+/).collect!(&method(:Integer)).freeze
Release = rcsid[3].freeze
-# not sure why these are needed now... but whatever
-$:.push(*Dir["test/*"].find_all { |path| File.directory? path })
-
class Module
def tu_deprecation_warning old, new = nil, kaller = nil
# stfu - for now...
end
end
-(Dir["test/test_*.rb"] + Dir["test/**/test_*.rb"]).each do |test|
+test_dir = File.dirname(__FILE__)
+
+# not sure why these are needed now... but whatever
+$:.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")])
+
+test_files = test_files.grep(Regexp.union(*ARGV)) unless ARGV.empty?
+
+test_files.each do |test|
require test
end