1 # Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
2 # file at the top-level directory of this distribution and at
3 # http://rust-lang.org/COPYRIGHT.
5 # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 # <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 # option. This file may not be copied, modified, or distributed
9 # except according to those terms.
12 ######################################################################
14 ######################################################################
16 # The names of crates that must be tested
18 # libcore/libunicode tests are in a separate crate
20 $(eval $(call RUST_CRATE,coretest))
22 TEST_TARGET_CRATES = $(filter-out core unicode,$(TARGET_CRATES)) coretest
23 TEST_DOC_CRATES = $(DOC_CRATES)
24 TEST_HOST_CRATES = $(filter-out rustc_typeck rustc_borrowck rustc_resolve rustc_trans,\
26 TEST_CRATES = $(TEST_TARGET_CRATES) $(TEST_HOST_CRATES)
28 ######################################################################
29 # Environment configuration
30 ######################################################################
32 # The arguments to all test runners
34 TESTARGS += $(TESTNAME)
43 # Arguments to the cfail/rfail/rpass/bench tests
45 CTEST_RUNTOOL = --runtool "$(CFG_VALGRIND)"
53 # Arguments to the perf tests
55 CTEST_PERF_RUNTOOL = --runtool "$(CFG_PERF_TOOL)"
58 CTEST_TESTARGS := $(TESTARGS)
61 CTEST_TESTARGS += --verbose
64 # Setting locale ensures that gdb's output remains consistent.
65 # This prevents tests from failing with some locales (fixes #17423).
68 # If we're running perf then set this environment variable
69 # to put the benchmarks into 'hard mode'
70 ifeq ($(MAKECMDGOALS),perf)
74 TEST_LOG_FILE=tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).log
75 TEST_OK_FILE=tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).ok
77 define DEF_TARGET_COMMANDS
80 CFG_RUN_TEST_$(1)=$$(TARGET_RPATH_VAR$$(2)_T_$$(3)_H_$$(4)) \
81 $$(call CFG_RUN_$(1),,$$(CFG_VALGRIND) $$(1))
84 ifdef CFG_WINDOWSY_$(1)
85 CFG_TESTLIB_$(1)=$$(CFG_BUILD_DIR)$$(2)/$$(strip \
86 $$(if $$(findstring stage0,$$(1)), \
87 stage0/$$(CFG_LIBDIR_RELATIVE), \
88 $$(if $$(findstring stage1,$$(1)), \
89 stage1/$$(CFG_LIBDIR_RELATIVE), \
90 $$(if $$(findstring stage2,$$(1)), \
91 stage2/$$(CFG_LIBDIR_RELATIVE), \
92 $$(if $$(findstring stage3,$$(1)), \
93 stage3/$$(CFG_LIBDIR_RELATIVE), \
94 )))))/rustlib/$$(CFG_BUILD)/lib
95 CFG_RUN_TEST_$(1)=$$(call CFG_RUN_$(1),$$(call CFG_TESTLIB_$(1),$$(1),$$(4)),$$(1))
98 # Run the compiletest runner itself under valgrind
100 CFG_RUN_CTEST_$(1)=$$(RPATH_VAR$$(1)_T_$$(3)_H_$$(3)) \
101 $$(call CFG_RUN_TEST_$$(CFG_BUILD),$$(3),$$(4))
103 CFG_RUN_CTEST_$(1)=$$(RPATH_VAR$$(1)_T_$$(3)_H_$$(3)) \
104 $$(call CFG_RUN_$$(CFG_BUILD),$$(TLIB$$(1)_T_$$(3)_H_$$(3)),$$(2))
109 $(foreach target,$(CFG_TARGET), \
110 $(eval $(call DEF_TARGET_COMMANDS,$(target))))
112 # Target platform specific variables
113 # for arm-linux-androidabi
114 define DEF_ADB_DEVICE_STATUS
115 CFG_ADB_DEVICE_STATUS=$(1)
118 $(foreach target,$(CFG_TARGET), \
119 $(if $(findstring $(target),"arm-linux-androideabi"), \
120 $(if $(findstring adb,$(CFG_ADB)), \
121 $(if $(findstring device,$(shell $(CFG_ADB) devices 2>/dev/null | grep -E '^[:_A-Za-z0-9-]+[[:blank:]]+device')), \
122 $(info check: android device attached) \
123 $(eval $(call DEF_ADB_DEVICE_STATUS, true)), \
124 $(info check: android device not attached) \
125 $(eval $(call DEF_ADB_DEVICE_STATUS, false)) \
127 $(info check: adb not found) \
128 $(eval $(call DEF_ADB_DEVICE_STATUS, false)) \
133 ifeq ($(CFG_ADB_DEVICE_STATUS),true)
134 CFG_ADB_TEST_DIR=/data/tmp
136 $(info check: android device test dir $(CFG_ADB_TEST_DIR) ready \
137 $(shell $(CFG_ADB) remount 1>/dev/null) \
138 $(shell $(CFG_ADB) shell rm -r $(CFG_ADB_TEST_DIR) >/dev/null) \
139 $(shell $(CFG_ADB) shell mkdir $(CFG_ADB_TEST_DIR)) \
140 $(shell $(CFG_ADB) shell mkdir $(CFG_ADB_TEST_DIR)/tmp) \
141 $(shell $(CFG_ADB) push $(S)src/etc/adb_run_wrapper.sh $(CFG_ADB_TEST_DIR) 1>/dev/null) \
142 $(foreach crate,$(TARGET_CRATES), \
143 $(shell $(CFG_ADB) push $(TLIB2_T_arm-linux-androideabi_H_$(CFG_BUILD))/$(call CFG_LIB_GLOB_arm-linux-androideabi,$(crate)) \
144 $(CFG_ADB_TEST_DIR))) \
151 ######################################################################
153 ######################################################################
155 # The main testing target. Tests lots of stuff.
156 check: cleantmptestlogs cleantestlibs check-notidy tidy
158 # As above but don't bother running tidy.
159 check-notidy: cleantmptestlogs cleantestlibs all check-stage2
160 $(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
162 # A slightly smaller set of tests for smoke testing.
163 check-lite: cleantestlibs cleantmptestlogs \
164 $(foreach crate,$(TEST_TARGET_CRATES),check-stage2-$(crate)) \
165 check-stage2-rpass check-stage2-rpass-valgrind \
166 check-stage2-rfail check-stage2-cfail check-stage2-rmake
167 $(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
169 # Only check the 'reference' tests: rpass/cfail/rfail/rmake.
170 check-ref: cleantestlibs cleantmptestlogs check-stage2-rpass check-stage2-rpass-valgrind \
171 check-stage2-rfail check-stage2-cfail check-stage2-rmake
172 $(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
174 # Only check the docs.
175 check-docs: cleantestlibs cleantmptestlogs check-stage2-docs
176 $(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
178 # Some less critical tests that are not prone to breakage.
179 # Not run as part of the normal test suite, but tested by bors on checkin.
180 check-secondary: check-build-compiletest check-build-lexer-verifier check-lexer check-pretty
182 # check + check-secondary.
184 # Issue #17883: build check-secondary first so hidden dependencies in
185 # e.g. building compiletest are exercised (resolve those by adding
186 # deps to rules that need them; not by putting `check` first here).
187 check-all: check-secondary check
189 # Pretty-printing tests.
190 check-pretty: check-stage2-T-$(CFG_BUILD)-H-$(CFG_BUILD)-pretty-exec
192 define DEF_CHECK_BUILD_COMPILETEST_FOR_STAGE
193 check-stage$(1)-build-compiletest: $$(HBIN$(1)_H_$(CFG_BUILD))/compiletest$$(X_$(CFG_BUILD))
196 $(foreach stage,$(STAGES), \
197 $(eval $(call DEF_CHECK_BUILD_COMPILETEST_FOR_STAGE,$(stage))))
199 check-build-compiletest: \
200 check-stage1-build-compiletest \
201 check-stage2-build-compiletest
203 .PHONY: cleantmptestlogs cleantestlibs
209 $(Q)find $(CFG_BUILD)/test \
210 -name '*.[odasS]' -o \
217 -name '*.libaux' -o \
220 -name '*.debugger.script' \
224 ######################################################################
226 ######################################################################
232 ALL_CS := $(wildcard $(S)src/rt/*.cpp \
234 $(S)src/rt/*/*/*.cpp \
235 $(S)src/rustllvm/*.cpp)
236 ALL_CS := $(filter-out $(S)src/rt/miniz.cpp \
237 $(wildcard $(S)src/rt/hoedown/src/*.c) \
238 $(wildcard $(S)src/rt/hoedown/bin/*.c) \
240 ALL_HS := $(wildcard $(S)src/rt/*.h \
243 $(S)src/rustllvm/*.h)
244 ALL_HS := $(filter-out $(S)src/rt/valgrind/valgrind.h \
245 $(S)src/rt/valgrind/memcheck.h \
246 $(S)src/rt/msvc/typeof.h \
247 $(S)src/rt/msvc/stdint.h \
248 $(S)src/rt/msvc/inttypes.h \
249 $(wildcard $(S)src/rt/hoedown/src/*.h) \
250 $(wildcard $(S)src/rt/hoedown/bin/*.h) \
253 # Run the tidy script in multiple parts to avoid huge 'echo' commands
255 @$(call E, check: formatting)
256 $(Q)find $(S)src -name '*.r[sc]' \
257 -and -not -regex '^$(S)src/jemalloc.*' \
258 -and -not -regex '^$(S)src/libuv.*' \
259 -and -not -regex '^$(S)src/llvm.*' \
260 -and -not -regex '^$(S)src/gyp.*' \
261 -and -not -regex '^$(S)src/libbacktrace.*' \
263 | xargs -0 -n 10 $(CFG_PYTHON) $(S)src/etc/tidy.py
264 $(Q)find $(S)src/etc -name '*.py' \
265 | xargs -n 10 $(CFG_PYTHON) $(S)src/etc/tidy.py
266 $(Q)find $(S)src/doc -name '*.js' \
267 | xargs -n 10 $(CFG_PYTHON) $(S)src/etc/tidy.py
268 $(Q)find $(S)src/etc -name '*.sh' \
269 | xargs -n 10 $(CFG_PYTHON) $(S)src/etc/tidy.py
270 $(Q)find $(S)src/etc -name '*.pl' \
271 | xargs -n 10 $(CFG_PYTHON) $(S)src/etc/tidy.py
272 $(Q)find $(S)src/etc -name '*.c' \
273 | xargs -n 10 $(CFG_PYTHON) $(S)src/etc/tidy.py
274 $(Q)find $(S)src/etc -name '*.h' \
275 | xargs -n 10 $(CFG_PYTHON) $(S)src/etc/tidy.py
277 | xargs -n 10 $(CFG_PYTHON) $(S)src/etc/tidy.py
279 | xargs -n 10 $(CFG_PYTHON) $(S)src/etc/tidy.py
280 $(Q)find $(S)src -type f -perm +a+x \
281 -not -name '*.rs' -and -not -name '*.py' \
282 -and -not -name '*.sh' \
283 | grep '^$(S)src/jemalloc' -v \
284 | grep '^$(S)src/libuv' -v \
285 | grep '^$(S)src/llvm' -v \
286 | grep '^$(S)src/rt/hoedown' -v \
287 | grep '^$(S)src/gyp' -v \
288 | grep '^$(S)src/etc' -v \
289 | grep '^$(S)src/doc' -v \
290 | grep '^$(S)src/compiler-rt' -v \
291 | grep '^$(S)src/libbacktrace' -v \
292 | grep '^$(S)src/rust-installer' -v \
293 | xargs $(CFG_PYTHON) $(S)src/etc/check-binaries.py
298 ######################################################################
300 ######################################################################
304 check-stage$(1)-T-$(2)-H-$(3)-exec: \
305 check-stage$(1)-T-$(2)-H-$(3)-rpass-exec \
306 check-stage$(1)-T-$(2)-H-$(3)-rfail-exec \
307 check-stage$(1)-T-$(2)-H-$(3)-cfail-exec \
308 check-stage$(1)-T-$(2)-H-$(3)-rpass-valgrind-exec \
309 check-stage$(1)-T-$(2)-H-$(3)-rpass-full-exec \
310 check-stage$(1)-T-$(2)-H-$(3)-cfail-full-exec \
311 check-stage$(1)-T-$(2)-H-$(3)-rmake-exec \
312 check-stage$(1)-T-$(2)-H-$(3)-crates-exec \
313 check-stage$(1)-T-$(2)-H-$(3)-doc-crates-exec \
314 check-stage$(1)-T-$(2)-H-$(3)-bench-exec \
315 check-stage$(1)-T-$(2)-H-$(3)-debuginfo-gdb-exec \
316 check-stage$(1)-T-$(2)-H-$(3)-debuginfo-lldb-exec \
317 check-stage$(1)-T-$(2)-H-$(3)-codegen-exec \
318 check-stage$(1)-T-$(2)-H-$(3)-doc-exec \
319 check-stage$(1)-T-$(2)-H-$(3)-pretty-exec
321 # Only test the compiler-dependent crates when the target is
322 # able to build a compiler (when the target triple is in the set of host triples)
323 ifneq ($$(findstring $(2),$$(CFG_HOST)),)
325 check-stage$(1)-T-$(2)-H-$(3)-crates-exec: \
326 $$(foreach crate,$$(TEST_CRATES), \
327 check-stage$(1)-T-$(2)-H-$(3)-$$(crate)-exec)
331 check-stage$(1)-T-$(2)-H-$(3)-crates-exec: \
332 $$(foreach crate,$$(TEST_TARGET_CRATES), \
333 check-stage$(1)-T-$(2)-H-$(3)-$$(crate)-exec)
337 check-stage$(1)-T-$(2)-H-$(3)-doc-crates-exec: \
338 $$(foreach crate,$$(TEST_DOC_CRATES), \
339 check-stage$(1)-T-$(2)-H-$(3)-doc-crate-$$(crate)-exec)
341 check-stage$(1)-T-$(2)-H-$(3)-doc-exec: \
342 $$(foreach docname,$$(DOCS), \
343 check-stage$(1)-T-$(2)-H-$(3)-doc-$$(docname)-exec)
345 check-stage$(1)-T-$(2)-H-$(3)-pretty-exec: \
346 check-stage$(1)-T-$(2)-H-$(3)-pretty-rpass-exec \
347 check-stage$(1)-T-$(2)-H-$(3)-pretty-rpass-valgrind-exec \
348 check-stage$(1)-T-$(2)-H-$(3)-pretty-rpass-full-exec \
349 check-stage$(1)-T-$(2)-H-$(3)-pretty-rfail-exec \
350 check-stage$(1)-T-$(2)-H-$(3)-pretty-bench-exec \
351 check-stage$(1)-T-$(2)-H-$(3)-pretty-pretty-exec
355 $(foreach host,$(CFG_HOST), \
356 $(foreach target,$(CFG_TARGET), \
357 $(foreach stage,$(STAGES), \
358 $(eval $(call DEF_TEST_SETS,$(stage),$(target),$(host))))))
361 ######################################################################
363 ######################################################################
367 # If NO_REBUILD is set then break the dependencies on everything but
368 # the source files so we can test crates without rebuilding any of the
370 ifeq ($(NO_REBUILD),)
371 TESTDEP_$(1)_$(2)_$(3)_$(4) = $$(SREQ$(1)_T_$(2)_H_$(3)) \
372 $$(foreach crate,$$(TARGET_CRATES), \
373 $$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$$(crate)) \
374 $$(CRATE_FULLDEPS_$(1)_T_$(2)_H_$(3)_$(4))
376 # The regex crate depends on the regex_macros crate during testing, but it
377 # notably depend on the *host* regex_macros crate, not the target version.
378 # Additionally, this is not a dependency in stage1, only in stage2.
381 TESTDEP_$(1)_$(2)_$(3)_$(4) += $$(TLIB$(1)_T_$(3)_H_$(3))/stamp.regex_macros
386 TESTDEP_$(1)_$(2)_$(3)_$(4) = $$(RSINPUTS_$(4))
389 $(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2)): CFG_COMPILER_HOST_TRIPLE = $(2)
390 $(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2)): \
392 $$(TESTDEP_$(1)_$(2)_$(3)_$(4))
393 @$$(call E, rustc: $$@)
394 $(Q)CFG_LLVM_LINKAGE_FILE=$$(LLVM_LINKAGE_PATH_$(3)) \
395 $$(subst @,,$$(STAGE$(1)_T_$(2)_H_$(3))) -o $$@ $$< --test \
396 -L "$$(RT_OUTPUT_DIR_$(2))" \
397 -L "$$(LLVM_LIBDIR_$(2))" \
402 $(foreach host,$(CFG_HOST), \
403 $(eval $(foreach target,$(CFG_TARGET), \
404 $(eval $(foreach stage,$(STAGES), \
405 $(eval $(foreach crate,$(TEST_CRATES), \
406 $(eval $(call TEST_RUNNER,$(stage),$(target),$(host),$(crate))))))))))
408 define DEF_TEST_CRATE_RULES
409 check-stage$(1)-T-$(2)-H-$(3)-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4))
411 $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
412 $(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2))
413 @$$(call E, run: $$<)
414 $$(Q)$$(call CFG_RUN_TEST_$(2),$$<,$(1),$(2),$(3)) $$(TESTARGS) \
415 --logfile $$(call TEST_LOG_FILE,$(1),$(2),$(3),$(4)) \
416 $$(call CRATE_TEST_EXTRA_ARGS,$(1),$(2),$(3),$(4)) \
420 define DEF_TEST_CRATE_RULES_arm-linux-androideabi
421 check-stage$(1)-T-$(2)-H-$(3)-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4))
423 $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
424 $(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2))
425 @$$(call E, run: $$< via adb)
426 $$(Q)$(CFG_ADB) push $$< $(CFG_ADB_TEST_DIR)
427 $$(Q)$(CFG_ADB) shell '(cd $(CFG_ADB_TEST_DIR); LD_LIBRARY_PATH=. \
429 --logfile $(CFG_ADB_TEST_DIR)/check-stage$(1)-T-$(2)-H-$(3)-$(4).log \
430 $$(call CRATE_TEST_EXTRA_ARGS,$(1),$(2),$(3),$(4)) $(TESTARGS))' \
431 > tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).tmp
432 $$(Q)cat tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).tmp
433 $$(Q)touch tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).log
434 $$(Q)$(CFG_ADB) pull $(CFG_ADB_TEST_DIR)/check-stage$(1)-T-$(2)-H-$(3)-$(4).log tmp/
435 $$(Q)$(CFG_ADB) shell rm $(CFG_ADB_TEST_DIR)/check-stage$(1)-T-$(2)-H-$(3)-$(4).log
436 @if grep -q "result: ok" tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).tmp; \
438 rm tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).tmp; \
441 rm tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).tmp; \
446 define DEF_TEST_CRATE_RULES_null
447 check-stage$(1)-T-$(2)-H-$(3)-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4))
449 $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
450 $(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2))
451 @$$(call E, failing: no device for $$< )
455 $(foreach host,$(CFG_HOST), \
456 $(foreach target,$(CFG_TARGET), \
457 $(foreach stage,$(STAGES), \
458 $(foreach crate, $(TEST_CRATES), \
459 $(if $(findstring $(target),$(CFG_BUILD)), \
460 $(eval $(call DEF_TEST_CRATE_RULES,$(stage),$(target),$(host),$(crate))), \
461 $(if $(findstring $(target),"arm-linux-androideabi"), \
462 $(if $(findstring $(CFG_ADB_DEVICE_STATUS),"true"), \
463 $(eval $(call DEF_TEST_CRATE_RULES_arm-linux-androideabi,$(stage),$(target),$(host),$(crate))), \
464 $(eval $(call DEF_TEST_CRATE_RULES_null,$(stage),$(target),$(host),$(crate))) \
466 $(eval $(call DEF_TEST_CRATE_RULES,$(stage),$(target),$(host),$(crate))) \
469 ######################################################################
470 # Rules for the compiletest tests (rpass, rfail, etc.)
471 ######################################################################
473 RPASS_RS := $(wildcard $(S)src/test/run-pass/*.rs)
474 RPASS_VALGRIND_RS := $(wildcard $(S)src/test/run-pass-valgrind/*.rs)
475 RPASS_FULL_RS := $(wildcard $(S)src/test/run-pass-fulldeps/*.rs)
476 CFAIL_FULL_RS := $(wildcard $(S)src/test/compile-fail-fulldeps/*.rs)
477 RFAIL_RS := $(wildcard $(S)src/test/run-fail/*.rs)
478 CFAIL_RS := $(wildcard $(S)src/test/compile-fail/*.rs)
479 BENCH_RS := $(wildcard $(S)src/test/bench/*.rs)
480 PRETTY_RS := $(wildcard $(S)src/test/pretty/*.rs)
481 DEBUGINFO_GDB_RS := $(wildcard $(S)src/test/debuginfo/*.rs)
482 DEBUGINFO_LLDB_RS := $(wildcard $(S)src/test/debuginfo/*.rs)
483 CODEGEN_RS := $(wildcard $(S)src/test/codegen/*.rs)
484 CODEGEN_CC := $(wildcard $(S)src/test/codegen/*.cc)
486 # perf tests are the same as bench tests only they run under
487 # a performance monitor.
488 PERF_RS := $(wildcard $(S)src/test/bench/*.rs)
490 RPASS_TESTS := $(RPASS_RS)
491 RPASS_VALGRIND_TESTS := $(RPASS_VALGRIND_RS)
492 RPASS_FULL_TESTS := $(RPASS_FULL_RS)
493 CFAIL_FULL_TESTS := $(CFAIL_FULL_RS)
494 RFAIL_TESTS := $(RFAIL_RS)
495 CFAIL_TESTS := $(CFAIL_RS)
496 BENCH_TESTS := $(BENCH_RS)
497 PERF_TESTS := $(PERF_RS)
498 PRETTY_TESTS := $(PRETTY_RS)
499 DEBUGINFO_GDB_TESTS := $(DEBUGINFO_GDB_RS)
500 DEBUGINFO_LLDB_TESTS := $(DEBUGINFO_LLDB_RS)
501 CODEGEN_TESTS := $(CODEGEN_RS) $(CODEGEN_CC)
503 CTEST_SRC_BASE_rpass = run-pass
504 CTEST_BUILD_BASE_rpass = run-pass
505 CTEST_MODE_rpass = run-pass
506 CTEST_RUNTOOL_rpass = $(CTEST_RUNTOOL)
508 CTEST_SRC_BASE_rpass-valgrind = run-pass-valgrind
509 CTEST_BUILD_BASE_rpass-valgrind = run-pass-valgrind
510 CTEST_MODE_rpass-valgrind = run-pass-valgrind
511 CTEST_RUNTOOL_rpass-valgrind = $(CTEST_RUNTOOL)
513 CTEST_SRC_BASE_rpass-full = run-pass-fulldeps
514 CTEST_BUILD_BASE_rpass-full = run-pass-fulldeps
515 CTEST_MODE_rpass-full = run-pass
516 CTEST_RUNTOOL_rpass-full = $(CTEST_RUNTOOL)
518 CTEST_SRC_BASE_cfail-full = compile-fail-fulldeps
519 CTEST_BUILD_BASE_cfail-full = compile-fail-fulldeps
520 CTEST_MODE_cfail-full = compile-fail
521 CTEST_RUNTOOL_cfail-full = $(CTEST_RUNTOOL)
523 CTEST_SRC_BASE_rfail = run-fail
524 CTEST_BUILD_BASE_rfail = run-fail
525 CTEST_MODE_rfail = run-fail
526 CTEST_RUNTOOL_rfail = $(CTEST_RUNTOOL)
528 CTEST_SRC_BASE_cfail = compile-fail
529 CTEST_BUILD_BASE_cfail = compile-fail
530 CTEST_MODE_cfail = compile-fail
531 CTEST_RUNTOOL_cfail = $(CTEST_RUNTOOL)
533 CTEST_SRC_BASE_bench = bench
534 CTEST_BUILD_BASE_bench = bench
535 CTEST_MODE_bench = run-pass
536 CTEST_RUNTOOL_bench = $(CTEST_RUNTOOL)
538 CTEST_SRC_BASE_perf = bench
539 CTEST_BUILD_BASE_perf = perf
540 CTEST_MODE_perf = run-pass
541 CTEST_RUNTOOL_perf = $(CTEST_PERF_RUNTOOL)
543 CTEST_SRC_BASE_debuginfo-gdb = debuginfo
544 CTEST_BUILD_BASE_debuginfo-gdb = debuginfo-gdb
545 CTEST_MODE_debuginfo-gdb = debuginfo-gdb
546 CTEST_RUNTOOL_debuginfo-gdb = $(CTEST_RUNTOOL)
548 CTEST_SRC_BASE_debuginfo-lldb = debuginfo
549 CTEST_BUILD_BASE_debuginfo-lldb = debuginfo-lldb
550 CTEST_MODE_debuginfo-lldb = debuginfo-lldb
551 CTEST_RUNTOOL_debuginfo-lldb = $(CTEST_RUNTOOL)
553 CTEST_SRC_BASE_codegen = codegen
554 CTEST_BUILD_BASE_codegen = codegen
555 CTEST_MODE_codegen = codegen
556 CTEST_RUNTOOL_codegen = $(CTEST_RUNTOOL)
558 # CTEST_DISABLE_$(TEST_GROUP), if set, will cause the test group to be
559 # disabled and the associated message to be printed as a warning
560 # during attempts to run those tests.
563 CTEST_DISABLE_debuginfo-gdb = "no gdb found"
567 CTEST_DISABLE_debuginfo-lldb = "no lldb found"
571 CTEST_DISABLE_codegen = "no clang found"
574 ifneq ($(CFG_OSTYPE),apple-darwin)
575 CTEST_DISABLE_debuginfo-lldb = "lldb tests are only run on darwin"
578 ifeq ($(CFG_OSTYPE),apple-darwin)
579 CTEST_DISABLE_debuginfo-gdb = "gdb on darwin needs root"
582 # CTEST_DISABLE_NONSELFHOST_$(TEST_GROUP), if set, will cause that
583 # test group to be disabled *unless* the target is able to build a
584 # compiler (i.e. when the target triple is in the set of of host
585 # triples). The associated message will be printed as a warning
586 # during attempts to run those tests.
588 define DEF_CTEST_VARS
590 # All the per-stage build rules you might want to call from the
593 # $(1) is the stage number
594 # $(2) is the target triple to test
595 # $(3) is the host triple to test
597 # Prerequisites for compiletest tests
598 TEST_SREQ$(1)_T_$(2)_H_$(3) = \
599 $$(HBIN$(1)_H_$(3))/compiletest$$(X_$(3)) \
600 $$(SREQ$(1)_T_$(2)_H_$(3))
602 # Rules for the cfail/rfail/rpass/bench/perf test runner
604 # The tests select when to use debug configuration on their own;
605 # remove directive, if present, from CFG_RUSTC_FLAGS (issue #7898).
606 CTEST_RUSTC_FLAGS := $$(subst --cfg ndebug,,$$(CFG_RUSTC_FLAGS))
608 # The tests cannot be optimized while the rest of the compiler is optimized, so
609 # filter out the optimization (if any) from rustc and then figure out if we need
611 CTEST_RUSTC_FLAGS := $$(subst -O,,$$(CTEST_RUSTC_FLAGS))
612 ifndef CFG_DISABLE_OPTIMIZE_TESTS
613 CTEST_RUSTC_FLAGS += -O
617 CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) := \
618 --compile-lib-path $$(HLIB$(1)_H_$(3)) \
619 --run-lib-path $$(TLIB$(1)_T_$(2)_H_$(3)) \
620 --rustc-path $$(HBIN$(1)_H_$(3))/rustc$$(X_$(3)) \
621 --clang-path $(if $(CFG_CLANG),$(CFG_CLANG),clang) \
622 --llvm-bin-path $(CFG_LLVM_INST_DIR_$(CFG_BUILD))/bin \
623 --aux-base $$(S)src/test/auxiliary/ \
624 --stage-id stage$(1)-$(2) \
627 --gdb-version="$(CFG_GDB_VERSION)" \
628 --lldb-version="$(CFG_LLDB_VERSION)" \
629 --android-cross-path=$(CFG_ANDROID_CROSS_PATH) \
630 --adb-path=$(CFG_ADB) \
631 --adb-test-dir=$(CFG_ADB_TEST_DIR) \
632 --host-rustcflags "$(RUSTC_FLAGS_$(3)) $$(CTEST_RUSTC_FLAGS) -L $$(RT_OUTPUT_DIR_$(3))" \
633 --lldb-python-dir=$(CFG_LLDB_PYTHON_DIR) \
634 --target-rustcflags "$(RUSTC_FLAGS_$(2)) $$(CTEST_RUSTC_FLAGS) -L $$(RT_OUTPUT_DIR_$(2))" \
637 ifdef CFG_VALGRIND_RPASS
638 ifdef GOOD_VALGRIND_$(2)
639 $(info cfg: valgrind-path set to $(CFG_VALGRIND_RPASS))
640 CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) += --valgrind-path "$(CFG_VALGRIND_RPASS)"
644 ifndef CFG_DISABLE_VALGRIND_RPASS
645 ifdef GOOD_VALGRIND_$(2)
646 CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) += --force-valgrind
650 CTEST_DEPS_rpass_$(1)-T-$(2)-H-$(3) = $$(RPASS_TESTS)
651 CTEST_DEPS_rpass-valgrind_$(1)-T-$(2)-H-$(3) = $$(RPASS_VALGRIND_TESTS)
652 CTEST_DEPS_rpass-full_$(1)-T-$(2)-H-$(3) = $$(RPASS_FULL_TESTS) $$(CSREQ$(1)_T_$(3)_H_$(3)) $$(SREQ$(1)_T_$(2)_H_$(3))
653 CTEST_DEPS_cfail-full_$(1)-T-$(2)-H-$(3) = $$(CFAIL_FULL_TESTS) $$(CSREQ$(1)_T_$(3)_H_$(3)) $$(SREQ$(1)_T_$(2)_H_$(3))
654 CTEST_DEPS_rfail_$(1)-T-$(2)-H-$(3) = $$(RFAIL_TESTS)
655 CTEST_DEPS_cfail_$(1)-T-$(2)-H-$(3) = $$(CFAIL_TESTS)
656 CTEST_DEPS_bench_$(1)-T-$(2)-H-$(3) = $$(BENCH_TESTS)
657 CTEST_DEPS_perf_$(1)-T-$(2)-H-$(3) = $$(PERF_TESTS)
658 CTEST_DEPS_debuginfo-gdb_$(1)-T-$(2)-H-$(3) = $$(DEBUGINFO_GDB_TESTS)
659 CTEST_DEPS_debuginfo-lldb_$(1)-T-$(2)-H-$(3) = $$(DEBUGINFO_LLDB_TESTS) \
660 $(S)src/etc/lldb_batchmode.py \
661 $(S)src/etc/lldb_rust_formatters.py
662 CTEST_DEPS_codegen_$(1)-T-$(2)-H-$(3) = $$(CODEGEN_TESTS)
666 $(foreach host,$(CFG_HOST), \
667 $(eval $(foreach target,$(CFG_TARGET), \
668 $(eval $(foreach stage,$(STAGES), \
669 $(eval $(call DEF_CTEST_VARS,$(stage),$(target),$(host))))))))
671 define DEF_RUN_COMPILETEST
673 CTEST_ARGS$(1)-T-$(2)-H-$(3)-$(4) := \
674 $$(CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3)) \
675 --src-base $$(S)src/test/$$(CTEST_SRC_BASE_$(4))/ \
676 --build-base $(3)/test/$$(CTEST_BUILD_BASE_$(4))/ \
677 --mode $$(CTEST_MODE_$(4)) \
678 $$(CTEST_RUNTOOL_$(4))
680 check-stage$(1)-T-$(2)-H-$(3)-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4))
682 # CTEST_DONT_RUN_$(1)-T-$(2)-H-$(3)-$(4)
683 # Goal: leave this variable as empty string if we should run the test.
684 # Otherwise, set it to the reason we are not running the test.
685 # (Encoded as a separate variable because GNU make does not have a
686 # good way to express OR on ifeq commands)
688 ifneq ($$(CTEST_DISABLE_$(4)),)
689 # Test suite is disabled for all configured targets.
690 CTEST_DONT_RUN_$(1)-T-$(2)-H-$(3)-$(4) := $$(CTEST_DISABLE_$(4))
692 # else, check if non-self-hosted target (i.e. target not-in hosts) ...
693 ifeq ($$(findstring $(2),$$(CFG_HOST)),)
694 # ... if so, then check if this test suite is disabled for non-selfhosts.
695 ifneq ($$(CTEST_DISABLE_NONSELFHOST_$(4)),)
696 # Test suite is disabled for this target.
697 CTEST_DONT_RUN_$(1)-T-$(2)-H-$(3)-$(4) := $$(CTEST_DISABLE_NONSELFHOST_$(4))
700 # Neither DISABLE nor DISABLE_NONSELFHOST is set ==> okay, run the test.
703 ifeq ($$(CTEST_DONT_RUN_$(1)-T-$(2)-H-$(3)-$(4)),)
704 $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
705 $$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
706 $$(CTEST_DEPS_$(4)_$(1)-T-$(2)-H-$(3))
707 @$$(call E, run $(4) [$(2)]: $$<)
708 $$(Q)$$(call CFG_RUN_CTEST_$(2),$(1),$$<,$(3)) \
709 $$(CTEST_ARGS$(1)-T-$(2)-H-$(3)-$(4)) \
710 --logfile $$(call TEST_LOG_FILE,$(1),$(2),$(3),$(4)) \
715 $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)):
716 @$$(call E, run $(4) [$(2)]: $$<)
717 @$$(call E, warning: tests disabled: $$(CTEST_DONT_RUN_$(1)-T-$(2)-H-$(3)-$(4)))
724 CTEST_NAMES = rpass rpass-valgrind rpass-full cfail-full rfail cfail bench perf debuginfo-gdb debuginfo-lldb codegen
726 $(foreach host,$(CFG_HOST), \
727 $(eval $(foreach target,$(CFG_TARGET), \
728 $(eval $(foreach stage,$(STAGES), \
729 $(eval $(foreach name,$(CTEST_NAMES), \
730 $(eval $(call DEF_RUN_COMPILETEST,$(stage),$(target),$(host),$(name))))))))))
732 PRETTY_NAMES = pretty-rpass pretty-rpass-valgrind pretty-rpass-full pretty-rfail pretty-bench pretty-pretty
733 PRETTY_DEPS_pretty-rpass = $(RPASS_TESTS)
734 PRETTY_DEPS_pretty-rpass-valgrind = $(RPASS_VALGRIND_TESTS)
735 PRETTY_DEPS_pretty-rpass-full = $(RPASS_FULL_TESTS)
736 PRETTY_DEPS_pretty-rfail = $(RFAIL_TESTS)
737 PRETTY_DEPS_pretty-bench = $(BENCH_TESTS)
738 PRETTY_DEPS_pretty-pretty = $(PRETTY_TESTS)
739 # The stage- and host-specific dependencies are for e.g. macro_crate_test which pulls in
741 PRETTY_DEPS$(1)_H_$(3)_pretty-rpass =
742 PRETTY_DEPS$(1)_H_$(3)_pretty-rpass-full = $$(HLIB$(1)_H_$(3))/stamp.syntax $$(HLIB$(1)_H_$(3))/stamp.rustc
743 PRETTY_DEPS$(1)_H_$(3)_pretty-rfail =
744 PRETTY_DEPS$(1)_H_$(3)_pretty-bench =
745 PRETTY_DEPS$(1)_H_$(3)_pretty-pretty =
746 PRETTY_DIRNAME_pretty-rpass = run-pass
747 PRETTY_DIRNAME_pretty-rpass-valgrind = run-pass-valgrind
748 PRETTY_DIRNAME_pretty-rpass-full = run-pass-fulldeps
749 PRETTY_DIRNAME_pretty-rfail = run-fail
750 PRETTY_DIRNAME_pretty-bench = bench
751 PRETTY_DIRNAME_pretty-pretty = pretty
753 define DEF_RUN_PRETTY_TEST
755 PRETTY_ARGS$(1)-T-$(2)-H-$(3)-$(4) := \
756 $$(CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3)) \
757 --src-base $$(S)src/test/$$(PRETTY_DIRNAME_$(4))/ \
758 --build-base $(3)/test/$$(PRETTY_DIRNAME_$(4))/ \
761 check-stage$(1)-T-$(2)-H-$(3)-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4))
763 $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
764 $$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
765 $$(PRETTY_DEPS_$(4)) \
766 $$(PRETTY_DEPS$(1)_H_$(3)_$(4))
767 @$$(call E, run pretty-rpass [$(2)]: $$<)
768 $$(Q)$$(call CFG_RUN_CTEST_$(2),$(1),$$<,$(3)) \
769 $$(PRETTY_ARGS$(1)-T-$(2)-H-$(3)-$(4)) \
770 --logfile $$(call TEST_LOG_FILE,$(1),$(2),$(3),$(4)) \
775 $(foreach host,$(CFG_HOST), \
776 $(foreach target,$(CFG_TARGET), \
777 $(foreach stage,$(STAGES), \
778 $(foreach pretty-name,$(PRETTY_NAMES), \
779 $(eval $(call DEF_RUN_PRETTY_TEST,$(stage),$(target),$(host),$(pretty-name)))))))
782 ######################################################################
783 # Crate & freestanding documentation tests
784 ######################################################################
787 RUSTDOC_EXE_$(1)_T_$(2)_H_$(3) := $$(HBIN$(1)_H_$(3))/rustdoc$$(X_$(3))
788 RUSTDOC_$(1)_T_$(2)_H_$(3) := $$(RPATH_VAR$(1)_T_$(2)_H_$(3)) $$(RUSTDOC_EXE_$(1)_T_$(2)_H_$(3))
791 $(foreach host,$(CFG_HOST), \
792 $(foreach target,$(CFG_TARGET), \
793 $(foreach stage,$(STAGES), \
794 $(eval $(call DEF_RUSTDOC,$(stage),$(target),$(host))))))
800 check-stage$(1)-T-$(2)-H-$(3)-doc-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),doc-$(4))
802 # If NO_REBUILD is set then break the dependencies on everything but
803 # the source files so we can test documentation without rebuilding
805 ifeq ($(NO_REBUILD),)
806 DOCTESTDEP_$(1)_$(2)_$(3)_$(4) = \
808 $$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
809 $$(RUSTDOC_EXE_$(1)_T_$(2)_H_$(3))
811 DOCTESTDEP_$(1)_$(2)_$(3)_$(4) = $$(D)/$(4).md
814 ifeq ($(2),$$(CFG_BUILD))
815 $$(call TEST_OK_FILE,$(1),$(2),$(3),doc-$(4)): $$(DOCTESTDEP_$(1)_$(2)_$(3)_$(4))
816 @$$(call E, run doc-$(4) [$(2)])
817 $$(Q)$$(RUSTDOC_$(1)_T_$(2)_H_$(3)) --cfg dox --test $$< --test-args "$$(TESTARGS)" && touch $$@
819 $$(call TEST_OK_FILE,$(1),$(2),$(3),doc-$(4)):
824 $(foreach host,$(CFG_HOST), \
825 $(foreach target,$(CFG_TARGET), \
826 $(foreach stage,$(STAGES), \
827 $(foreach docname,$(DOCS), \
828 $(eval $(call DEF_DOC_TEST,$(stage),$(target),$(host),$(docname)))))))
832 define DEF_CRATE_DOC_TEST
834 # If NO_REBUILD is set then break the dependencies on everything but
835 # the source files so we can test crate documentation without
836 # rebuilding any of the parent crates.
837 ifeq ($(NO_REBUILD),)
838 CRATEDOCTESTDEP_$(1)_$(2)_$(3)_$(4) = \
839 $$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
840 $$(CRATE_FULLDEPS_$(1)_T_$(2)_H_$(3)_$(4)) \
841 $$(RUSTDOC_EXE_$(1)_T_$(2)_H_$(3))
843 CRATEDOCTESTDEP_$(1)_$(2)_$(3)_$(4) = $$(RSINPUTS_$(4))
846 # (Issues #13732, #13983, #14000) The doc for the regex crate includes
847 # uses of the `regex!` macro from the regex_macros crate. There is
848 # normally a dependence injected that makes the target's regex depend
849 # upon the host's regex_macros (see #13845), but that dependency
850 # injection is currently skipped for stage1 as a special case.
852 # Therefore, as a further special case, this conditional skips
853 # attempting to run the doc tests for the regex crate atop stage1,
854 # (since there is no regex_macros crate for the stage1 rustc to load).
856 # (Another approach for solving this would be to inject the desired
857 # dependence for stage1 as well, by setting things up to generate a
858 # regex_macros crate that was compatible with the stage1 rustc and
859 # thus re-enable our ability to run this test.)
860 ifeq (stage$(1)-crate-$(4),stage1-crate-regex)
861 check-stage$(1)-T-$(2)-H-$(3)-doc-crate-$(4)-exec:
862 @$$(call E, skipping doc-crate-$(4) as it uses macros and cannot run at stage$(1))
864 check-stage$(1)-T-$(2)-H-$(3)-doc-crate-$(4)-exec: \
865 $$(call TEST_OK_FILE,$(1),$(2),$(3),doc-crate-$(4))
868 ifeq ($(2),$$(CFG_BUILD))
869 $$(call TEST_OK_FILE,$(1),$(2),$(3),doc-crate-$(4)): $$(CRATEDOCTESTDEP_$(1)_$(2)_$(3)_$(4))
870 @$$(call E, run doc-crate-$(4) [$(2)])
871 $$(Q)CFG_LLVM_LINKAGE_FILE=$$(LLVM_LINKAGE_PATH_$(3)) \
872 $$(RUSTDOC_$(1)_T_$(2)_H_$(3)) --test --cfg dox \
873 $$(CRATEFILE_$(4)) --test-args "$$(TESTARGS)" && touch $$@
875 $$(call TEST_OK_FILE,$(1),$(2),$(3),doc-crate-$(4)):
881 $(foreach host,$(CFG_HOST), \
882 $(foreach target,$(CFG_TARGET), \
883 $(foreach stage,$(STAGES), \
884 $(foreach crate,$(TEST_DOC_CRATES), \
885 $(eval $(call DEF_CRATE_DOC_TEST,$(stage),$(target),$(host),$(crate)))))))
887 ######################################################################
889 ######################################################################
893 $(foreach crate,$(TEST_CRATES),$(crate)) \
894 $(foreach crate,$(TEST_DOC_CRATES),doc-crate-$(crate)) \
908 $(foreach docname,$(DOCS),doc-$(docname)) \
911 pretty-rpass-valgrind \
918 define DEF_CHECK_FOR_STAGE_AND_TARGET_AND_HOST
919 check-stage$(1)-T-$(2)-H-$(3): check-stage$(1)-T-$(2)-H-$(3)-exec
922 $(foreach stage,$(STAGES), \
923 $(foreach target,$(CFG_TARGET), \
924 $(foreach host,$(CFG_HOST), \
925 $(eval $(call DEF_CHECK_FOR_STAGE_AND_TARGET_AND_HOST,$(stage),$(target),$(host))))))
927 define DEF_CHECK_FOR_STAGE_AND_TARGET_AND_HOST_AND_GROUP
928 check-stage$(1)-T-$(2)-H-$(3)-$(4): check-stage$(1)-T-$(2)-H-$(3)-$(4)-exec
931 $(foreach stage,$(STAGES), \
932 $(foreach target,$(CFG_TARGET), \
933 $(foreach host,$(CFG_HOST), \
934 $(foreach group,$(TEST_GROUPS), \
935 $(eval $(call DEF_CHECK_FOR_STAGE_AND_TARGET_AND_HOST_AND_GROUP,$(stage),$(target),$(host),$(group)))))))
937 define DEF_CHECK_FOR_STAGE
938 check-stage$(1): check-stage$(1)-H-$$(CFG_BUILD)
939 check-stage$(1)-H-all: $$(foreach target,$$(CFG_TARGET), \
940 check-stage$(1)-H-$$(target))
943 $(foreach stage,$(STAGES), \
944 $(eval $(call DEF_CHECK_FOR_STAGE,$(stage))))
946 define DEF_CHECK_FOR_STAGE_AND_GROUP
947 check-stage$(1)-$(2): check-stage$(1)-H-$$(CFG_BUILD)-$(2)
948 check-stage$(1)-H-all-$(2): $$(foreach target,$$(CFG_TARGET), \
949 check-stage$(1)-H-$$(target)-$(2))
952 $(foreach stage,$(STAGES), \
953 $(foreach group,$(TEST_GROUPS), \
954 $(eval $(call DEF_CHECK_FOR_STAGE_AND_GROUP,$(stage),$(group)))))
957 define DEF_CHECK_FOR_STAGE_AND_HOSTS
958 check-stage$(1)-H-$(2): $$(foreach target,$$(CFG_TARGET), \
959 check-stage$(1)-T-$$(target)-H-$(2))
962 $(foreach stage,$(STAGES), \
963 $(foreach host,$(CFG_HOST), \
964 $(eval $(call DEF_CHECK_FOR_STAGE_AND_HOSTS,$(stage),$(host)))))
966 define DEF_CHECK_FOR_STAGE_AND_HOSTS_AND_GROUP
967 check-stage$(1)-H-$(2)-$(3): $$(foreach target,$$(CFG_TARGET), \
968 check-stage$(1)-T-$$(target)-H-$(2)-$(3))
971 $(foreach stage,$(STAGES), \
972 $(foreach host,$(CFG_HOST), \
973 $(foreach group,$(TEST_GROUPS), \
974 $(eval $(call DEF_CHECK_FOR_STAGE_AND_HOSTS_AND_GROUP,$(stage),$(host),$(group))))))
976 define DEF_CHECK_DOC_FOR_STAGE
977 check-stage$(1)-docs: $$(foreach docname,$$(DOCS), \
978 check-stage$(1)-T-$$(CFG_BUILD)-H-$$(CFG_BUILD)-doc-$$(docname)) \
979 $$(foreach crate,$$(TEST_DOC_CRATES), \
980 check-stage$(1)-T-$$(CFG_BUILD)-H-$$(CFG_BUILD)-doc-crate-$$(crate))
983 $(foreach stage,$(STAGES), \
984 $(eval $(call DEF_CHECK_DOC_FOR_STAGE,$(stage))))
986 define DEF_CHECK_CRATE
987 check-$(1): check-stage2-T-$$(CFG_BUILD)-H-$$(CFG_BUILD)-$(1)-exec
990 $(foreach crate,$(TEST_CRATES), \
991 $(eval $(call DEF_CHECK_CRATE,$(crate))))
993 ######################################################################
995 ######################################################################
997 RMAKE_TESTS := $(shell ls -d $(S)src/test/run-make/*/)
998 RMAKE_TESTS := $(RMAKE_TESTS:$(S)src/test/run-make/%/=%)
1000 define DEF_RMAKE_FOR_T_H
1002 # $(2) target triple
1006 ifeq ($(2)$(3),$$(CFG_BUILD)$$(CFG_BUILD))
1007 check-stage$(1)-T-$(2)-H-$(3)-rmake-exec: \
1008 $$(call TEST_OK_FILE,$(1),$(2),$(3),rmake)
1010 $$(call TEST_OK_FILE,$(1),$(2),$(3),rmake): \
1011 $$(RMAKE_TESTS:%=$(3)/test/run-make/%-$(1)-T-$(2)-H-$(3).ok)
1014 $(3)/test/run-make/%-$(1)-T-$(2)-H-$(3).ok: \
1015 $(S)src/test/run-make/%/Makefile \
1016 $$(CSREQ$(1)_T_$(2)_H_$(3))
1017 @rm -rf $(3)/test/run-make/$$*
1018 @mkdir -p $(3)/test/run-make/$$*
1019 $$(Q)$$(CFG_PYTHON) $(S)src/etc/maketest.py $$(dir $$<) \
1021 $$(HBIN$(1)_H_$(3))/rustc$$(X_$(3)) \
1022 $(3)/test/run-make/$$* \
1023 "$$(CC_$(3)) $$(CFG_GCCISH_CFLAGS_$(3))" \
1024 $$(HBIN$(1)_H_$(3))/rustdoc$$(X_$(3)) \
1026 $$(LD_LIBRARY_PATH_ENV_NAME$(1)_T_$(2)_H_$(3)) \
1027 "$$(LD_LIBRARY_PATH_ENV_HOSTDIR$(1)_T_$(2)_H_$(3))" \
1028 "$$(LD_LIBRARY_PATH_ENV_TARGETDIR$(1)_T_$(2)_H_$(3))" \
1032 # FIXME #11094 - The above rule doesn't work right for multiple targets
1033 check-stage$(1)-T-$(2)-H-$(3)-rmake-exec:
1041 $(foreach stage,$(STAGES), \
1042 $(foreach target,$(CFG_TARGET), \
1043 $(foreach host,$(CFG_HOST), \
1044 $(eval $(call DEF_RMAKE_FOR_T_H,$(stage),$(target),$(host))))))