Skip to content

Commit 44e6883

Browse files
huonwalexcrichton
authored andcommittedFeb 13, 2014
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.
1 parent 065e121 commit 44e6883

File tree

1 file changed

+22
-12
lines changed

1 file changed

+22
-12
lines changed
 

‎mk/tests.mk

+22-12
Original file line numberDiff line numberDiff line change
@@ -333,21 +333,22 @@ $(foreach host,$(CFG_HOST), \
333333

334334
define TEST_RUNNER
335335

336-
# If NO_REBUILD is set then break the dependencies on extra so we can
337-
# test crates without rebuilding std and extra first
336+
# If NO_REBUILD is set then break the dependencies on everything but
337+
# the source files so we can test crates without rebuilding any of the
338+
# parent crates.
338339
ifeq ($(NO_REBUILD),)
339-
STDTESTDEP_$(1)_$(2)_$(3)_$(4) = $$(SREQ$(1)_T_$(2)_H_$(3)) \
340+
TESTDEP_$(1)_$(2)_$(3)_$(4) = $$(SREQ$(1)_T_$(2)_H_$(3)) \
340341
$$(foreach crate,$$(TARGET_CRATES),\
341-
$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$$(crate))
342+
$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$$(crate)) \
343+
$$(CRATE_FULLDEPS_$(1)_T_$(2)_H_$(3)_$(4))
342344
else
343-
STDTESTDEP_$(1)_$(2)_$(3)_$(4) =
345+
TESTDEP_$(1)_$(2)_$(3)_$(4) = $$(RSINPUTS_$(4))
344346
endif
345347

346348
$(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2)): CFG_COMPILER = $(2)
347349
$(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2)): \
348-
$$(CRATEFILE_$(4)) \
349-
$$(CRATE_FULLDEPS_$(1)_T_$(2)_H_$(3)_$(4)) \
350-
$$(STDTESTDEP_$(1)_$(2)_$(3)_$(4))
350+
$$(CRATEFILE_$(4)) \
351+
$$(TESTDEP_$(1)_$(2)_$(3)_$(4))
351352
@$$(call E, oxidize: $$@)
352353
$$(STAGE$(1)_T_$(2)_H_$(3)) -o $$@ $$< --test \
353354
-L "$$(RT_OUTPUT_DIR_$(2))" \
@@ -684,13 +685,22 @@ $(foreach host,$(CFG_HOST), \
684685

685686
define DEF_CRATE_DOC_TEST
686687

688+
# If NO_REBUILD is set then break the dependencies on everything but
689+
# the source files so we can test crate documentation without
690+
# rebuilding any of the parent crates.
691+
ifeq ($(NO_REBUILD),)
692+
DOCTESTDEP_$(1)_$(2)_$(3)_$(4) = \
693+
$$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
694+
$$(CRATE_FULLDEPS_$(1)_T_$(2)_H_$(3)_$(4)) \
695+
$$(HBIN$(1)_H_$(3))/rustdoc$$(X_$(3))
696+
else
697+
DOCTESTDEP_$(1)_$(2)_$(3)_$(4) = $$(RSINPUTS_$(4))
698+
endif
699+
687700
check-stage$(1)-T-$(2)-H-$(3)-doc-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),doc-$(4))
688701

689702
ifeq ($(2),$$(CFG_BUILD))
690-
$$(call TEST_OK_FILE,$(1),$(2),$(3),doc-$(4)): \
691-
$$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
692-
$$(CRATE_FULLDEPS_$(1)_T_$(2)_H_$(3)_$(4)) \
693-
$$(HBIN$(1)_H_$(3))/rustdoc$$(X_$(3))
703+
$$(call TEST_OK_FILE,$(1),$(2),$(3),doc-$(4)): $$(DOCTESTDEP_$(1)_$(2)_$(3)_$(4))
694704
@$$(call E, run doc-$(4) [$(2)])
695705
$$(Q)$$(HBIN$(1)_H_$(3))/rustdoc$$(X_$(3)) --test \
696706
$$(CRATEFILE_$(4)) --test-args "$$(TESTARGS)" && touch $$@

0 commit comments

Comments
 (0)
Please sign in to comment.