From 953093e2a4c41370332906e8ee0a0bba2f867b20 Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 3 Feb 2017 12:52:08 +0000 Subject: 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 --- test/lib/test/unit.rb | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'test') 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 -- cgit v1.2.3