summaryrefslogtreecommitdiff
path: root/test/lib
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-02-03 12:52:08 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-02-03 12:52:08 +0000
commit953093e2a4c41370332906e8ee0a0bba2f867b20 (patch)
tree740cdd9616cbdc7703948db5063875d842f7d88c /test/lib
parent367acdaa30e7979c5009f1769a982a16a40019eb (diff)
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
Diffstat (limited to 'test/lib')
-rw-r--r--test/lib/test/unit.rb10
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