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

ruby-changes:45543

From: nobu <ko1@a...>
Date: Mon, 13 Feb 2017 14:11:19 +0900 (JST)
Subject: [ruby-changes:45543] nobu:r57616 (trunk): gmake.mk: tests step

nobu	2017-02-13 14:11:14 +0900 (Mon, 13 Feb 2017)

  New Revision: 57616

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

  Log:
    gmake.mk: tests step
    
    * defs/gmake.mk (TEST_TARGETS): run tests step by step.

  Modified files:
    trunk/common.mk
    trunk/defs/gmake.mk
Index: common.mk
===================================================================
--- common.mk	(revision 57615)
+++ common.mk	(revision 57616)
@@ -671,9 +671,9 @@ $(RBCONFIG): $(srcdir)/tool/mkconfig.rb https://github.com/ruby/ruby/blob/trunk/common.mk#L671
 	> rbconfig.tmp
 	$(IFCHANGE) "--timestamp=$@" rbconfig.rb rbconfig.tmp
 
-test-rubyspec-precheck:
+test-rubyspec-precheck: $(arch)-fake.rb
 
-test-rubyspec: test-rubyspec-precheck $(arch)-fake.rb
+test-rubyspec: test-rubyspec-precheck
 	$(RUNRUBY) -r./$(arch)-fake $(srcdir)/spec/mspec/bin/mspec run -B $(srcdir)/spec/default.mspec $(MSPECOPT)
 
 RUNNABLE = $(LIBRUBY_RELATIVE:no=un)-runnable
Index: defs/gmake.mk
===================================================================
--- defs/gmake.mk	(revision 57615)
+++ defs/gmake.mk	(revision 57616)
@@ -4,12 +4,18 @@ override gnumake_recursive := $(if $(fin https://github.com/ruby/ruby/blob/trunk/defs/gmake.mk#L4
 mflags := $(filter-out -j%,$(MFLAGS))
 
 CHECK_TARGETS := exam love check%
-TEST_TARGETS := $(filter check test check% test% btest%,$(MAKECMDGOALS))
-TEST_TARGETS += $(subst check,test-all,$(patsubst check-%,test-%,$(TEST_TARGETS)))
-TEST_TARGETS := $(patsubst test-%,yes-test-%,$(patsubst btest-%,yes-btest-%,$(TEST_TARGETS)))
-TEST_DEPENDS := $(if $(TEST_TARGETS),$(filter all main exts,$(MAKECMDGOALS)))
-TEST_DEPENDS += $(if $(filter $(CHECK_TARGETS),$(MAKECMDGOALS)),main)
-TEST_DEPENDS += $(if $(filter main,$(TEST_DEPENDS)),$(if $(filter all,$(INSTALLDOC)),docs))
+# expand test targets, and those dependents
+TEST_TARGETS := $(filter exam check test check% test% btest%,$(MAKECMDGOALS))
+TEST_DEPENDS := $(filter-out $(TEST_TARGETS),$(MAKECMDGOALS))
+TEST_TARGETS := $(patsubst exam,check test-rubyspec,$(TEST_TARGETS))
+TEST_DEPENDS := $(filter-out $(TEST_TARGETS),$(TEST_DEPENDS))
+TEST_TARGETS := $(patsubst love,check,$(TEST_TARGETS))
+TEST_DEPENDS := $(filter-out $(TEST_TARGETS),$(TEST_DEPENDS))
+TEST_TARGETS := $(patsubst check,test test-testframework test-almost,$(patsubst check-%,test test-%,$(TEST_TARGETS)))
+TEST_DEPENDS := $(filter-out $(TEST_TARGETS),$(TEST_DEPENDS))
+TEST_TARGETS := $(patsubst test,btest-ruby test-knownbug test-basic,$(TEST_TARGETS))
+TEST_DEPENDS := $(filter-out $(TEST_TARGETS),$(TEST_DEPENDS))
+TEST_DEPENDS += $(if $(filter-out btest%,$(TEST_TARGETS)),all exts)
 
 ifneq ($(filter -O0 -Od,$(optflags)),)
 override XCFLAGS := $(filter-out -D_FORTIFY_SOURCE=%,$(XCFLAGS))
@@ -42,21 +48,21 @@ $(foreach arch,$(filter -arch=%,$(subst https://github.com/ruby/ruby/blob/trunk/defs/gmake.mk#L48
 	$(eval $(call archcmd,$(patsubst -arch=%,%,$(value arch)),$(patsubst -arch=%,-arch %,$(value arch)))))
 endif
 
-ifneq ($(filter $(CHECK_TARGETS) test,$(MAKECMDGOALS)),)
-yes-test-basic: $(TEST_DEPENDS) yes-test-knownbug
-yes-test-knownbug: $(TEST_DEPENDS) yes-btest-ruby
-yes-btest-ruby: $(TEST_DEPENDS)
-endif
-ifneq ($(filter $(CHECK_TARGETS),$(MAKECMDGOALS)) $(filter yes-test-all,$(TEST_TARGETS)),)
-yes-test-testframework yes-test-almost yes-test-ruby: $(filter-out %test-all %test-ruby check%,$(TEST_TARGETS)) \
-	yes-test-basic
-endif
-ifneq ($(filter $(CHECK_TARGETS),$(MAKECMDGOALS))$(if $(filter test-all,$(MAKECMDGOALS)),$(filter test-knownbug,$(MAKECMDGOALS))),)
-yes-test-testframework yes-test-almost yes-test-ruby: yes-test-knownbug
-yes-test-almost: yes-test-testframework
+.PHONY: $(addprefix yes-,$(TEST_TARGETS))
+
+ifneq ($(filter-out btest%,$(TEST_TARGETS)),)
+$(addprefix yes-,$(TEST_TARGETS)): $(TEST_DEPENDS)
 endif
 
-$(TEST_TARGETS): $(TEST_DEPENDS)
+ORDERED_TEST_TARGETS := $(filter $(TEST_TARGETS), \
+	btest-ruby test-knownbug test-basic \
+	test-testframework test-almost test-all \
+	test-rubyspec \
+	)
+prev_test := $(if $(filter test-rubyspec,$(ORDERED_TEST_TARGETS)),test-rubyspec-precheck)
+$(foreach test,$(addprefix yes-,$(ORDERED_TEST_TARGETS)), \
+	$(eval $(value test): $(value prev_test)); \
+	$(eval prev_test := $(value test)))
 
 ifneq ($(if $(filter install,$(MAKECMDGOALS)),$(filter uninstall,$(MAKECMDGOALS))),)
 install-targets := $(filter install uninstall,$(MAKECMDGOALS))

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

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