summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-07-22 12:31:40 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-07-22 13:07:03 +0900
commitf6461fa890fa12501fe1696a36ab2cca036477ff (patch)
tree3fd59d50158aa75117430d7c363843fd6737ae2f
parent463092b84da7933f307cc8747f948f68ef19f5fd (diff)
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.
-rw-r--r--common.mk10
-rw-r--r--tool/test/runner.rb14
2 files changed, 11 insertions, 13 deletions
diff --git a/common.mk b/common.mk
index 74f77519b4..f795df874a 100644
--- a/common.mk
+++ b/common.mk
@@ -753,12 +753,12 @@ yes-test-knownbug: prog PHONY
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
# 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
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 db23ae2d33..b3cdba6f17 100644
--- a/tool/test/runner.rb
+++ b/tool/test/runner.rb
@@ -4,14 +4,12 @@ require 'rbconfig'
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