diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-02-03 12:52:08 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-02-03 12:52:08 +0000 |
commit | 953093e2a4c41370332906e8ee0a0bba2f867b20 (patch) | |
tree | 740cdd9616cbdc7703948db5063875d842f7d88c | |
parent | 367acdaa30e7979c5009f1769a982a16a40019eb (diff) | |
download | ruby-953093e2a4c41370332906e8ee0a0bba2f867b20.tar.gz |
test/unit.rb: job testing flag
* test/lib/test/unit.rb (Parallel#non_options): split testing flag
and job count by OptionParser.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57513 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | test/lib/test/unit.rb | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/test/lib/test/unit.rb b/test/lib/test/unit.rb index 78fa490871..ad7620313d 100644 --- a/test/lib/test/unit.rb +++ b/test/lib/test/unit.rb @@ -148,13 +148,9 @@ module Test options[:retry] = true - opts.on '-j N', '--jobs N', "Allow run tests with N jobs at once" do |a| - if /^t/ =~ a - options[:testing] = true # For testing - options[:parallel] = a[1..-1].to_i - else - options[:parallel] = a.to_i - end + opts.on '-j N', '--jobs N', /\A(t)?(\d+)\z/, "Allow run tests with N jobs at once" do |_, t, a| + options[:testing] = true & t # For testing + options[:parallel] = a.to_i end opts.on '--separate', "Restart job process after one testcase has done" do |