From d6e3722ee1660c3634110d41df02947355bd12ba Mon Sep 17 00:00:00 2001 From: Huon Wilson Date: Thu, 13 Feb 2014 19:35:43 +1100 Subject: [PATCH] mk: make NO_REBUILD more forceful and more general. Previously crates like `green` and `native` would still depend on their parents when running `make check-stage2-green NO_REBUILD=1`, this ensures that they only depend on their source files. Also, apply NO_REBUILD to the crate doc tests, so, for example, `check-stage2-doc-std` will use an already compiled `rustdoc` directly. --- mk/tests.mk | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/mk/tests.mk b/mk/tests.mk index c2b298dbb9c20..a8ad51409d916 100644 --- a/mk/tests.mk +++ b/mk/tests.mk @@ -333,21 +333,22 @@ $(foreach host,$(CFG_HOST), \ define TEST_RUNNER -# If NO_REBUILD is set then break the dependencies on extra so we can -# test crates without rebuilding std and extra first +# If NO_REBUILD is set then break the dependencies on everything but +# the source files so we can test crates without rebuilding any of the +# parent crates. ifeq ($(NO_REBUILD),) -STDTESTDEP_$(1)_$(2)_$(3)_$(4) = $$(SREQ$(1)_T_$(2)_H_$(3)) \ +TESTDEP_$(1)_$(2)_$(3)_$(4) = $$(SREQ$(1)_T_$(2)_H_$(3)) \ $$(foreach crate,$$(TARGET_CRATES),\ - $$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$$(crate)) + $$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$$(crate)) \ + $$(CRATE_FULLDEPS_$(1)_T_$(2)_H_$(3)_$(4)) else -STDTESTDEP_$(1)_$(2)_$(3)_$(4) = +TESTDEP_$(1)_$(2)_$(3)_$(4) = $$(RSINPUTS_$(4)) endif $(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2)): CFG_COMPILER = $(2) $(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2)): \ - $$(CRATEFILE_$(4)) \ - $$(CRATE_FULLDEPS_$(1)_T_$(2)_H_$(3)_$(4)) \ - $$(STDTESTDEP_$(1)_$(2)_$(3)_$(4)) + $$(CRATEFILE_$(4)) \ + $$(TESTDEP_$(1)_$(2)_$(3)_$(4)) @$$(call E, oxidize: $$@) $$(STAGE$(1)_T_$(2)_H_$(3)) -o $$@ $$< --test \ -L "$$(RT_OUTPUT_DIR_$(2))" \ @@ -684,13 +685,22 @@ $(foreach host,$(CFG_HOST), \ define DEF_CRATE_DOC_TEST +# If NO_REBUILD is set then break the dependencies on everything but +# the source files so we can test crate documentation without +# rebuilding any of the parent crates. +ifeq ($(NO_REBUILD),) +DOCTESTDEP_$(1)_$(2)_$(3)_$(4) = \ + $$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \ + $$(CRATE_FULLDEPS_$(1)_T_$(2)_H_$(3)_$(4)) \ + $$(HBIN$(1)_H_$(3))/rustdoc$$(X_$(3)) +else +DOCTESTDEP_$(1)_$(2)_$(3)_$(4) = $$(RSINPUTS_$(4)) +endif + check-stage$(1)-T-$(2)-H-$(3)-doc-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),doc-$(4)) ifeq ($(2),$$(CFG_BUILD)) -$$(call TEST_OK_FILE,$(1),$(2),$(3),doc-$(4)): \ - $$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \ - $$(CRATE_FULLDEPS_$(1)_T_$(2)_H_$(3)_$(4)) \ - $$(HBIN$(1)_H_$(3))/rustdoc$$(X_$(3)) +$$(call TEST_OK_FILE,$(1),$(2),$(3),doc-$(4)): $$(DOCTESTDEP_$(1)_$(2)_$(3)_$(4)) @$$(call E, run doc-$(4) [$(2)]) $$(Q)$$(HBIN$(1)_H_$(3))/rustdoc$$(X_$(3)) --test \ $$(CRATEFILE_$(4)) --test-args "$$(TESTARGS)" && touch $$@