summaryrefslogtreecommitdiff
path: root/test/runner.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-09-05 02:32:24 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-09-05 02:32:24 +0000
commit73e4384a23b61761cc9fa013e28b290393569d09 (patch)
tree145b7387bc73ce7f3e73973c73f364019dbda352 /test/runner.rb
parente45738a2976eed3ff291ec075606f64baa3198cb (diff)
* lib/optparse.rb (--version): fix assignment/reference order.
* lib/optparse.rb (OptionParser#help): new; OptionParser#to_s may be deprecated in future. * lib/optparse/version.rb (OptionParser#show_version): hide Object. * test/runner.rb: fix optparse usage. * test/runner.rb: glob all testsuits if no tests given. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4504 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/runner.rb')
-rw-r--r--test/runner.rb31
1 files changed, 21 insertions, 10 deletions
diff --git a/test/runner.rb b/test/runner.rb
index bae7116ea8..d8b981743f 100644
--- a/test/runner.rb
+++ b/test/runner.rb
@@ -2,16 +2,9 @@ require 'test/unit/testsuite'
require 'test/unit/testcase'
require 'optparse'
-runner = 'console'
-opt = OptionParser.new
-opt.on("--runner=console", String) do |arg|
- runner = arg
-end
-opt.parse!(ARGV)
-
-ARGV.each do |tc_name|
- require tc_name
-end
+Revision = %w$Revision$[1..-1]
+(Runner = Revision[0]).chomp!(",v")
+Version = Revision[1].scan(/\d+/, &method(:Integer))
class BulkTestSuite < Test::Unit::TestSuite
def self.suite
@@ -39,4 +32,22 @@ runners_map = {
end,
}
+runner = 'console'
+ARGV.options do |opt|
+ opt.program_name = Runner
+ opt.banner << " [tests...]"
+ opt.on("--runner=mode", runners_map, "UI mode (console, gtk,fox)") do |arg|
+ runner = arg
+ end
+ opt.parse!
+end or abort(ARGV.options.help)
+
+if ARGV.empty?
+ ARGV.replace(Dir.glob(File.join(File.dirname(__FILE__), "**", "test_*.rb")).sort)
+end
+
+ARGV.each do |tc_name|
+ require tc_name
+end
+
runners_map[runner].call(BulkTestSuite.suite)