Skip to content

mk: Fix doc tests for multiple targets #11139

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 16 additions & 10 deletions mk/tests.mk
Original file line number Diff line number Diff line change
Expand Up @@ -745,21 +745,27 @@ CRATE_DOC_LIB-extra = $(EXTRALIB_CRATE)

define DEF_CRATE_DOC_TEST

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

$$(call TEST_OK_FILE,$(1),$(2),$(2),doc-$(3)): \
$$(TEST_SREQ$(1)_T_$(2)_H_$(2)) \
$$(HBIN$(1)_H_$(2))/rustdoc$$(X_$(2))
@$$(call E, run doc-$(3) [$(2)])
$$(Q)$$(HBIN$(1)_H_$(2))/rustdoc$$(X_$(2)) --test \
$$(CRATE_DOC_LIB-$(3)) && touch $$@
ifeq ($(2),$$(CFG_BUILD))
$$(call TEST_OK_FILE,$(1),$(2),$(3),doc-$(4)): \
$$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
$$(HBIN$(1)_H_$(3))/rustdoc$$(X_$(3))
@$$(call E, run doc-$(4) [$(2)])
$$(Q)$$(HBIN$(1)_H_$(3))/rustdoc$$(X_$(3)) --test \
$$(CRATE_DOC_LIB-$(4)) && touch $$@
else
$$(call TEST_OK_FILE,$(1),$(2),$(3),doc-$(4)):
touch $$@
endif

endef

$(foreach host,$(CFG_HOST), \
$(foreach stage,$(STAGES), \
$(foreach crate,$(TEST_DOC_CRATES), \
$(eval $(call DEF_CRATE_DOC_TEST,$(stage),$(host),$(crate))))))
$(foreach target,$(CFG_TARGET), \
$(foreach stage,$(STAGES), \
$(foreach crate,$(TEST_DOC_CRATES), \
$(eval $(call DEF_CRATE_DOC_TEST,$(stage),$(target),$(host),$(crate)))))))

######################################################################
# Extracting tests for docs
Expand Down