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

ruby-changes:56616

From: Nobuyoshi <ko1@a...>
Date: Mon, 22 Jul 2019 13:44:59 +0900 (JST)
Subject: [ruby-changes:56616] Nobuyoshi Nakada: f6461fa890 (master): Only the first argument can be --test-target-dir option

https://git.ruby-lang.org/ruby.git/commit/?id=f6461fa890

From f6461fa890fa12501fe1696a36ab2cca036477ff Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Mon, 22 Jul 2019 12:31:40 +0900
Subject: Only the first argument can be --test-target-dir option

Raise the proper exception when that option is not given but
non-option argument is.

diff --git a/common.mk b/common.mk
index 74f7751..f795df8 100644
--- a/common.mk
+++ b/common.mk
@@ -753,12 +753,12 @@ yes-test-knownbug: prog PHONY https://github.com/ruby/ruby/blob/trunk/common.mk#L753
 
 test-testframework: $(TEST_RUNNABLE)-test-testframework
 yes-test-testframework: prog PHONY
-	$(gnumake_recursive)$(Q)$(exec) $(RUNRUBY) "$(TOOL_TESTSDIR)/runner.rb" --test-target-dir="$(TOOL_TESTSDIR)" -- --ruby="$(RUNRUBY)" $(TESTOPTS) testunit minitest
+	$(gnumake_recursive)$(Q)$(exec) $(RUNRUBY) "$(TOOL_TESTSDIR)/runner.rb" --test-target-dir="$(TOOL_TESTSDIR)" --ruby="$(RUNRUBY)" $(TESTOPTS) testunit minitest
 no-test-testframework: PHONY
 
 test-tool: $(TEST_RUNNABLE)-test-tool
 yes-test-tool: prog PHONY
-	$(gnumake_recursive)$(Q)$(exec) $(RUNRUBY) "$(TOOL_TESTSDIR)/runner.rb" --test-target-dir="$(TOOL_TESTSDIR)" -- --ruby="$(RUNRUBY)" $(TESTOPTS)
+	$(gnumake_recursive)$(Q)$(exec) $(RUNRUBY) "$(TOOL_TESTSDIR)/runner.rb" --test-target-dir="$(TOOL_TESTSDIR)" --ruby="$(RUNRUBY)" $(TESTOPTS)
 no-test-tool: PHONY
 
 test-sample: test-basic # backward compatibility for mswin-build
@@ -769,10 +769,10 @@ test: test-short https://github.com/ruby/ruby/blob/trunk/common.mk#L769
 # for example, make test-all TESTOPTS="-j2 -v -n test-name -- test-file-name"
 test-all: $(TEST_RUNNABLE)-test-all
 yes-test-all: programs PHONY
-	$(gnumake_recursive)$(Q)$(exec) $(RUNRUBY) "$(TOOL_TESTSDIR)/runner.rb" --test-target-dir="$(TESTSDIR)" -- --ruby="$(RUNRUBY)" $(TEST_EXCLUDES) $(TESTOPTS) $(TESTS)
+	$(gnumake_recursive)$(Q)$(exec) $(RUNRUBY) "$(TOOL_TESTSDIR)/runner.rb" --test-target-dir="$(TESTSDIR)" --ruby="$(RUNRUBY)" $(TEST_EXCLUDES) $(TESTOPTS) $(TESTS)
 TESTS_BUILD = mkmf
 no-test-all: PHONY
-	$(gnumake_recursive)$(MINIRUBY) -I"$(srcdir)/lib" "$(TOOL_TESTSDIR)/runner.rb" --test-target-dir="$(TESTSDIR)" -- $(TESTOPTS) $(TESTS_BUILD)
+	$(gnumake_recursive)$(MINIRUBY) -I"$(srcdir)/lib" "$(TOOL_TESTSDIR)/runner.rb" --test-target-dir="$(TESTSDIR)" $(TESTOPTS) $(TESTS_BUILD)
 
 test-almost: test-all
 yes-test-almost: yes-test-all
@@ -781,7 +781,7 @@ no-test-almost: no-test-all https://github.com/ruby/ruby/blob/trunk/common.mk#L781
 test-ruby: $(TEST_RUNNABLE)-test-ruby
 no-test-ruby: PHONY
 yes-test-ruby: prog encs PHONY
-	$(gnumake_recursive)$(RUNRUBY) "$(TOOL_TESTSDIR)/runner.rb" --test-target-dir="$(TESTSDIR)" -- $(TEST_EXCLUDES) $(TESTOPTS) -- ruby -ext-
+	$(gnumake_recursive)$(RUNRUBY) "$(TOOL_TESTSDIR)/runner.rb" --test-target-dir="$(TESTSDIR)" $(TEST_EXCLUDES) $(TESTOPTS) -- ruby -ext-
 
 extconf: $(PREP)
 	$(Q) $(MAKEDIRS) "$(EXTCONFDIR)"
diff --git a/tool/test/runner.rb b/tool/test/runner.rb
index db23ae2..b3cdba6 100644
--- a/tool/test/runner.rb
+++ b/tool/test/runner.rb
@@ -4,14 +4,12 @@ require 'rbconfig' https://github.com/ruby/ruby/blob/trunk/tool/test/runner.rb#L4
 tool_dir = File.dirname(File.dirname(File.realpath(__FILE__)))
 src_testdir = nil
 
-while opt = ARGV.shift
-  break if opt == "--"
-  case opt
-  when /\A--test-target-dir=(.*?)\z/
-    src_testdir = File.realpath($1)
-  else
-    raise "unknown runner option: #{ opt }"
-  end
+case ARGV.first
+when /\A--test-target-dir=(.*?)\z/
+  ARGV.shift
+  src_testdir = File.realpath($1)
+else
+  raise "unknown runner option: #{ opt }"
 end
 
 raise "#$0: specify --test-target-dir" if !src_testdir
-- 
cgit v0.10.2


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

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