[前][次][番号順一覧][スレッド一覧]

ruby-changes:45440

From: nobu <ko1@a...>
Date: Fri, 3 Feb 2017 21:52:13 +0900 (JST)
Subject: [ruby-changes:45440] nobu:r57513 (trunk): test/unit.rb: job testing flag

nobu	2017-02-03 21:52:08 +0900 (Fri, 03 Feb 2017)

  New Revision: 57513

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=57513

  Log:
    test/unit.rb: job testing flag
    
    * test/lib/test/unit.rb (Parallel#non_options): split testing flag
      and job count by OptionParser.

  Modified files:
    trunk/test/lib/test/unit.rb
Index: test/lib/test/unit.rb
===================================================================
--- test/lib/test/unit.rb	(revision 57512)
+++ test/lib/test/unit.rb	(revision 57513)
@@ -148,13 +148,9 @@ module Test https://github.com/ruby/ruby/blob/trunk/test/lib/test/unit.rb#L148
 
         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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]