# Environment configuration
######################################################################
-TESTARGS :=
-
# The arguments to all test runners
ifdef TESTNAME
TESTARGS += $(TESTNAME)
# Arguments to the cfail/rfail/rpass tests
ifdef CFG_VALGRIND
CTEST_RUNTOOL = --runtool "$(CFG_VALGRIND)"
-else
- CTEST_RUNTOOL =
endif
CTEST_TESTARGS := $(TESTARGS)
CFG_ADB_TEST_DIR=
endif
-DOC_NAMES :=
# $(1) - name of doc test
# $(2) - file of the test
define DOCTEST
-DOC_NAMES += $(1)
+DOC_NAMES := $$(DOC_NAMES) $(1)
DOCFILE_$(1) := $(2)
endef
check-stage$(1)-T-$(2)-H-$(3)-rfail-exec \
check-stage$(1)-T-$(2)-H-$(3)-cfail-exec \
check-stage$(1)-T-$(2)-H-$(3)-pfail-exec \
- check-stage$(1)-T-$(2)-H-$(3)-rpass-valgrind-exec \
- check-stage$(1)-T-$(2)-H-$(3)-rpass-full-exec \
- check-stage$(1)-T-$(2)-H-$(3)-rfail-full-exec \
+ check-stage$(1)-T-$(2)-H-$(3)-rpass-valgrind-exec \
+ check-stage$(1)-T-$(2)-H-$(3)-rpass-full-exec \
+ check-stage$(1)-T-$(2)-H-$(3)-rfail-full-exec \
check-stage$(1)-T-$(2)-H-$(3)-cfail-full-exec \
check-stage$(1)-T-$(2)-H-$(3)-rmake-exec \
check-stage$(1)-T-$(2)-H-$(3)-rustdocck-exec \
- check-stage$(1)-T-$(2)-H-$(3)-crates-exec \
- check-stage$(1)-T-$(2)-H-$(3)-doc-crates-exec \
+ check-stage$(1)-T-$(2)-H-$(3)-crates-exec \
+ check-stage$(1)-T-$(2)-H-$(3)-doc-crates-exec \
check-stage$(1)-T-$(2)-H-$(3)-debuginfo-gdb-exec \
check-stage$(1)-T-$(2)-H-$(3)-debuginfo-lldb-exec \
check-stage$(1)-T-$(2)-H-$(3)-codegen-exec \
# 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.
-ifndef NO_REBUILD
+ifeq ($(NO_REBUILD),)
TESTDEP_$(1)_$(2)_$(3)_$(4) = $$(SREQ$(1)_T_$(2)_H_$(3)) \
$$(foreach crate,$$(TARGET_CRATES), \
$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$$(crate)) \
$(if $(findstring $(target),$(CFG_BUILD)), \
$(eval $(call DEF_TEST_CRATE_RULES,$(stage),$(target),$(host),$(crate))), \
$(if $(findstring android, $(target)), \
- $(if $(findstring $(CFG_ADB_DEVICE_STATUS),true), \
+ $(if $(findstring $(CFG_ADB_DEVICE_STATUS),"true"), \
$(eval $(call DEF_TEST_CRATE_RULES_android,$(stage),$(target),$(host),$(crate))), \
$(eval $(call DEF_TEST_CRATE_RULES_null,$(stage),$(target),$(host),$(crate))) \
), \
CTEST_DEPS_codegen_$(1)-T-$(2)-H-$(3) = $$(CODEGEN_TESTS)
CTEST_DEPS_codegen-units_$(1)-T-$(2)-H-$(3) = $$(CODEGEN_UNITS_TESTS)
CTEST_DEPS_rustdocck_$(1)-T-$(2)-H-$(3) = $$(RUSTDOCCK_TESTS) \
- $$(HBIN$(1)_H_$(3))/rustdoc$$(X_$(3)) \
- $(S)src/etc/htmldocck.py
+ $$(HBIN$(1)_H_$(3))/rustdoc$$(X_$(3)) \
+ $(S)src/etc/htmldocck.py
endef
# (Encoded as a separate variable because GNU make does not have a
# good way to express OR on ifeq commands)
-ifdef CTEST_DISABLE_$(4)
+ifneq ($$(CTEST_DISABLE_$(4)),)
# Test suite is disabled for all configured targets.
CTEST_DONT_RUN_$(1)-T-$(2)-H-$(3)-$(4) := $$(CTEST_DISABLE_$(4))
else
# else, check if non-self-hosted target (i.e. target not-in hosts) ...
ifeq ($$(findstring $(2),$$(CFG_HOST)),)
# ... if so, then check if this test suite is disabled for non-selfhosts.
-ifdef CTEST_DISABLE_NONSELFHOST_$(4)
+ifneq ($$(CTEST_DISABLE_NONSELFHOST_$(4)),)
# Test suite is disabled for this target.
CTEST_DONT_RUN_$(1)-T-$(2)-H-$(3)-$(4) := $$(CTEST_DISABLE_NONSELFHOST_$(4))
endif
# Neither DISABLE nor DISABLE_NONSELFHOST is set ==> okay, run the test.
endif
-ifndef CTEST_DONT_RUN_$(1)-T-$(2)-H-$(3)-$(4)
+ifeq ($$(CTEST_DONT_RUN_$(1)-T-$(2)-H-$(3)-$(4)),)
$$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
$$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
$$(CTEST_DEPS_$(4)_$(1)-T-$(2)-H-$(3))
# If NO_REBUILD is set then break the dependencies on everything but
# the source files so we can test documentation without rebuilding
# rustdoc etc.
-ifndef NO_REBUILD
+ifeq ($(NO_REBUILD),)
DOCTESTDEP_$(1)_$(2)_$(3)_$(4) = \
$$(DOCFILE_$(4)) \
$$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
# 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.
-ifndef NO_REBUILD
+ifeq ($(NO_REBUILD),)
CRATEDOCTESTDEP_$(1)_$(2)_$(3)_$(4) = \
$$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
$$(CRATE_FULLDEPS_$(1)_T_$(2)_H_$(3)_$(4)) \
$(foreach crate,$(TEST_DOC_CRATES), \
$(eval $(call DEF_CRATE_DOC_TEST,$(stage),$(target),$(host),$(crate)))))))
+define DEF_DOC_TEST_ERROR_INDEX
+
+check-stage$(1)-T-$(2)-H-$(3)-doc-error-index-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),doc-error-index)
+
+ifeq ($(2),$$(CFG_BUILD))
+$$(call TEST_OK_FILE,$(1),$(2),$(3),doc-error-index): \
+ $$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
+ doc/error-index.md
+ $$(Q)touch $$@.start_time
+ $$(RUSTDOC_$(1)_T_$(2)_H_$(3)) --test doc/error-index.md
+ $$(Q)touch -r $$@.start_time $$@ && rm $$@.start_time
+else
+$$(call TEST_OK_FILE,$(1),$(2),$(3),doc-error-index):
+ $$(Q)touch $$@
+endif
+endef
+
+$(foreach host,$(CFG_HOST), \
+ $(foreach target,$(CFG_TARGET), \
+ $(foreach stage,$(STAGES), \
+ $(eval $(call DEF_DOC_TEST_ERROR_INDEX,$(stage),$(target),$(host))))))
+
######################################################################
# Shortcut rules
######################################################################
$(foreach crate,$(TEST_CRATES),$(crate)) \
$(foreach crate,$(TEST_DOC_CRATES),doc-crate-$(crate)) \
rpass \
- rpass-valgrind \
+ rpass-valgrind \
rpass-full \
rfail-full \
cfail-full \
$(foreach docname,$(DOC_NAMES),doc-$(docname)) \
pretty \
pretty-rpass \
- pretty-rpass-valgrind \
+ pretty-rpass-valgrind \
pretty-rpass-full \
pretty-rfail-full \
pretty-rfail \
- pretty-pretty
+ pretty-pretty \
+ $(NULL)
define DEF_CHECK_FOR_STAGE_AND_TARGET_AND_HOST
check-stage$(1)-T-$(2)-H-$(3): check-stage$(1)-T-$(2)-H-$(3)-exec
check-stage$(1)-docs: $$(foreach docname,$$(DOC_NAMES), \
check-stage$(1)-T-$$(CFG_BUILD)-H-$$(CFG_BUILD)-doc-$$(docname)) \
$$(foreach crate,$$(TEST_DOC_CRATES), \
- check-stage$(1)-T-$$(CFG_BUILD)-H-$$(CFG_BUILD)-doc-crate-$$(crate))
+ check-stage$(1)-T-$$(CFG_BUILD)-H-$$(CFG_BUILD)-doc-crate-$$(crate)) \
+ check-stage$(1)-T-$$(CFG_BUILD)-H-$$(CFG_BUILD)-doc-error-index-exec
endef
$(foreach stage,$(STAGES), \
$$(S) \
$(3) \
"$$(LLVM_LIBDIR_RUSTFLAGS_$(3))" \
- "$$(LLVM_ALL_COMPONENTS_$(3))"
+ "$$(LLVM_ALL_COMPONENTS_$(3))" \
+ "$$(LLVM_CXXFLAGS_$(3))" \
+ '$$(CXX_$(3))'
@touch -r $$@.start_time $$@ && rm $$@.start_time
else
# FIXME #11094 - The above rule doesn't work right for multiple targets