summaryrefslogtreecommitdiff
path: root/test/runner.rb
diff options
context:
space:
mode:
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)