Skip to content

Commit fe8b360

Browse files
committed
mk: Run doc tests as part of 'make check'
Don't run doc tests during make check-fast because it involves spawning lots of processes.
1 parent d882b1d commit fe8b360

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

mk/tests.mk

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
# The names of crates that must be tested
1717
TEST_TARGET_CRATES = std extra rustuv
18+
TEST_DOC_CRATES = std extra
1819
TEST_HOST_CRATES = rustpkg rustc rustdoc syntax
1920
TEST_CRATES = $(TEST_TARGET_CRATES) $(TEST_HOST_CRATES)
2021

@@ -281,6 +282,7 @@ check-stage$(1)-T-$(2)-H-$(3)-exec: \
281282
check-stage$(1)-T-$(2)-H-$(3)-rpass-full-exec \
282283
check-stage$(1)-T-$(2)-H-$(3)-rmake-exec \
283284
check-stage$(1)-T-$(2)-H-$(3)-crates-exec \
285+
check-stage$(1)-T-$(2)-H-$(3)-doc-crates-exec \
284286
check-stage$(1)-T-$(2)-H-$(3)-bench-exec \
285287
check-stage$(1)-T-$(2)-H-$(3)-debuginfo-exec \
286288
check-stage$(1)-T-$(2)-H-$(3)-codegen-exec \
@@ -303,6 +305,10 @@ check-stage$(1)-T-$(2)-H-$(3)-crates-exec: \
303305

304306
endif
305307

308+
check-stage$(1)-T-$(2)-H-$(3)-doc-crates-exec: \
309+
$$(foreach crate,$$(TEST_DOC_CRATES), \
310+
check-stage$(1)-T-$(2)-H-$(3)-doc-$$(crate)-exec)
311+
306312
check-stage$(1)-T-$(2)-H-$(3)-doc-exec: \
307313
$$(foreach docname,$$(DOC_TEST_NAMES), \
308314
check-stage$(1)-T-$(2)-H-$(3)-doc-$$(docname)-exec)
@@ -734,6 +740,26 @@ $(foreach host,$(CFG_HOST), \
734740
$(foreach docname,$(DOC_TEST_NAMES), \
735741
$(eval $(call DEF_RUN_DOC_TEST,$(stage),$(target),$(host),$(docname)))))))
736742

743+
CRATE_DOC_LIB-std = $(STDLIB_CRATE)
744+
CRATE_DOC_LIB-extra = $(EXTRALIB_CRATE)
745+
746+
define DEF_CRATE_DOC_TEST
747+
748+
check-stage$(1)-T-$(2)-H-$(2)-doc-$(3)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(2),doc-$(3))
749+
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 $$@
756+
757+
endef
758+
759+
$(foreach host,$(CFG_HOST), \
760+
$(foreach stage,$(STAGES), \
761+
$(foreach crate,$(TEST_DOC_CRATES), \
762+
$(eval $(call DEF_CRATE_DOC_TEST,$(stage),$(host),$(crate))))))
737763

738764
######################################################################
739765
# Extracting tests for docs
@@ -762,6 +788,7 @@ $(foreach host,$(CFG_HOST), \
762788
TEST_GROUPS = \
763789
crates \
764790
$(foreach crate,$(TEST_CRATES),$(crate)) \
791+
$(foreach crate,$(TEST_DOC_CRATES),doc-$(crate)) \
765792
rpass \
766793
rpass-full \
767794
rfail \

0 commit comments

Comments
 (0)