Skip to content

Commit cab6af5

Browse files
committed
auto merge of #11139 : alexcrichton/rust/fix-snapshots, r=luqmana
It only really makes sense to run tests for the build target anyway because it's not guaranteed that you can execute other targets. This is blocking the next snapshot
2 parents a1e68de + 70ff5f7 commit cab6af5

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

mk/tests.mk

+16-10
Original file line numberDiff line numberDiff line change
@@ -745,21 +745,27 @@ CRATE_DOC_LIB-extra = $(EXTRALIB_CRATE)
745745

746746
define DEF_CRATE_DOC_TEST
747747

748-
check-stage$(1)-T-$(2)-H-$(2)-doc-$(3)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(2),doc-$(3))
748+
check-stage$(1)-T-$(2)-H-$(3)-doc-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),doc-$(4))
749749

750-
$$(call TEST_OK_FILE,$(1),$(2),$(2),doc-$(3)): \
751-
$$(TEST_SREQ$(1)_T_$(2)_H_$(2)) \
752-
$$(HBIN$(1)_H_$(2))/rustdoc$$(X_$(2))
753-
@$$(call E, run doc-$(3) [$(2)])
754-
$$(Q)$$(HBIN$(1)_H_$(2))/rustdoc$$(X_$(2)) --test \
755-
$$(CRATE_DOC_LIB-$(3)) && touch $$@
750+
ifeq ($(2),$$(CFG_BUILD))
751+
$$(call TEST_OK_FILE,$(1),$(2),$(3),doc-$(4)): \
752+
$$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
753+
$$(HBIN$(1)_H_$(3))/rustdoc$$(X_$(3))
754+
@$$(call E, run doc-$(4) [$(2)])
755+
$$(Q)$$(HBIN$(1)_H_$(3))/rustdoc$$(X_$(3)) --test \
756+
$$(CRATE_DOC_LIB-$(4)) && touch $$@
757+
else
758+
$$(call TEST_OK_FILE,$(1),$(2),$(3),doc-$(4)):
759+
touch $$@
760+
endif
756761

757762
endef
758763

759764
$(foreach host,$(CFG_HOST), \
760-
$(foreach stage,$(STAGES), \
761-
$(foreach crate,$(TEST_DOC_CRATES), \
762-
$(eval $(call DEF_CRATE_DOC_TEST,$(stage),$(host),$(crate))))))
765+
$(foreach target,$(CFG_TARGET), \
766+
$(foreach stage,$(STAGES), \
767+
$(foreach crate,$(TEST_DOC_CRATES), \
768+
$(eval $(call DEF_CRATE_DOC_TEST,$(stage),$(target),$(host),$(crate)))))))
763769

764770
######################################################################
765771
# Extracting tests for docs

0 commit comments

Comments
 (0)