summaryrefslogtreecommitdiff
path: root/test/runner.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/runner.rb')
-rw-r--r--test/runner.rb25
1 files changed, 14 insertions, 11 deletions
diff --git a/test/runner.rb b/test/runner.rb
index 8d1b9dc20c..b02e2e0681 100644
--- a/test/runner.rb
+++ b/test/runner.rb
@@ -33,20 +33,23 @@ runners_map = {
}
runner = 'console'
-ARGV.options do |opt|
- opt.program_name = $0
- opt.banner << " [tests...]"
- opt.on("--runner=mode", runners_map.keys, "UI mode (console, gtk,fox)") do |arg|
- runner = arg
- end
- opt.parse!
-end or abort(ARGV.options.help)
+opt = OptionParser.new
+opt.program_name = $0
+opt.banner << " [tests...]"
+opt.on("--runner=mode", runners_map.keys, "UI mode (console, gtk,fox)") do |arg|
+ runner = arg
+end
+begin
+ argv = opt.parse(*ARGV)
+rescue OptionParser::ParseError
+ opt.abort($!)
+end
-if ARGV.empty?
- ARGV.replace(Dir.glob(File.join(File.dirname(__FILE__), "**", "test_*.rb")).sort)
+if argv.empty?
+ argv = Dir.glob(File.join(File.dirname(__FILE__), "**", "test_*.rb")).sort
end
-ARGV.each do |tc_name|
+argv.each do |tc_name|
require tc_name
end