bin/rgot in rgot-0.0.4 vs bin/rgot in rgot-0.0.5

- old
+ new

@@ -19,10 +19,16 @@ opts[:benchtime] = arg end o.on '--timeout [sec]', "set timeout sec to testing" do |arg| opts[:timeout] = arg end + o.on '--cpu [count,...]', "set cpu counts of comma splited" do |arg| + opts[:cpu] = arg + end + o.on '--thread [count,...]', "set thread counts of comma splited" do |arg| + opts[:thread] = arg + end o.on '--require [path]', "load some code before running" do |arg| opts[:require_paths] << arg end o.on '--load-path [path]', "Specify $LOAD_PATH directory" do |arg| $LOAD_PATH.unshift(arg) @@ -89,12 +95,22 @@ duration = Rgot.now at_exit { template = "%s\t%s\t%.3fs" - if $!.kind_of?(SystemExit) && $!.success? - puts sprintf(template, "ok", test_module, Rgot.now - duration) + case $! + when SystemExit + if $!.success? + # exit 0 + puts sprintf(template, "ok", test_module, Rgot.now - duration) + else + # exit 1 + puts sprintf(template, "FAIL", test_module, Rgot.now - duration) + end + when NilClass + # not raise, not exit else + # any exception puts sprintf(template, "FAIL", test_module, Rgot.now - duration) end } m = Rgot::M.new(tests: tests, benchmarks: benchmarks, examples: examples, opts: opts) if main