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)
42 # Arguments to the cfail/rfail/rpass/bench tests
44 CTEST_RUNTOOL = --runtool "$(CFG_VALGRIND)"
51 # Arguments to the perf tests
53 CTEST_PERF_RUNTOOL = --runtool "$(CFG_PERF_TOOL)"
56 CTEST_TESTARGS := $(TESTARGS)
59 CTEST_TESTARGS += --verbose
62 # Setting locale ensures that gdb's output remains consistent.
63 # This prevents tests from failing with some locales (fixes #17423).
66 # If we're running perf then set this environment variable
67 # to put the benchmarks into 'hard mode'
68 ifeq ($(MAKECMDGOALS),perf)
72 TEST_LOG_FILE=tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).log
73 TEST_OK_FILE=tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).ok
75 define DEF_TARGET_COMMANDS
78 CFG_RUN_TEST_$(1)=$$(TARGET_RPATH_VAR$$(2)_T_$$(3)_H_$$(4)) \
79 $$(call CFG_RUN_$(1),,$$(CFG_VALGRIND) $$(1))
82 ifdef CFG_WINDOWSY_$(1)
83 CFG_TESTLIB_$(1)=$$(CFG_BUILD_DIR)$$(2)/$$(strip \
84 $$(if $$(findstring stage0,$$(1)), \
85 stage0/$$(CFG_LIBDIR_RELATIVE), \
86 $$(if $$(findstring stage1,$$(1)), \
87 stage1/$$(CFG_LIBDIR_RELATIVE), \
88 $$(if $$(findstring stage2,$$(1)), \
89 stage2/$$(CFG_LIBDIR_RELATIVE), \
90 $$(if $$(findstring stage3,$$(1)), \
91 stage3/$$(CFG_LIBDIR_RELATIVE), \
92 )))))/rustlib/$$(CFG_BUILD)/lib
93 CFG_RUN_TEST_$(1)=$$(call CFG_RUN_$(1),$$(call CFG_TESTLIB_$(1),$$(1),$$(4)),$$(1))
96 # Run the compiletest runner itself under valgrind
98 CFG_RUN_CTEST_$(1)=$$(RPATH_VAR$$(1)_T_$$(3)_H_$$(3)) \
99 $$(call CFG_RUN_TEST_$$(CFG_BUILD),$$(3),$$(4))
101 CFG_RUN_CTEST_$(1)=$$(RPATH_VAR$$(1)_T_$$(3)_H_$$(3)) \
102 $$(call CFG_RUN_$$(CFG_BUILD),$$(TLIB$$(1)_T_$$(3)_H_$$(3)),$$(2))
107 $(foreach target,$(CFG_TARGET), \
108 $(eval $(call DEF_TARGET_COMMANDS,$(target))))
110 # Target platform specific variables
111 # for arm-linux-androidabi
112 define DEF_ADB_DEVICE_STATUS
113 CFG_ADB_DEVICE_STATUS=$(1)
116 $(foreach target,$(CFG_TARGET), \
117 $(if $(findstring $(target),"arm-linux-androideabi"), \
118 $(if $(findstring adb,$(CFG_ADB)), \
119 $(if $(findstring device,$(shell $(CFG_ADB) devices 2>/dev/null | grep -E '^[:_A-Za-z0-9-]+[[:blank:]]+device')), \
120 $(info check: android device attached) \
121 $(eval $(call DEF_ADB_DEVICE_STATUS, true)), \
122 $(info check: android device not attached) \
123 $(eval $(call DEF_ADB_DEVICE_STATUS, false)) \
125 $(info check: adb not found) \
126 $(eval $(call DEF_ADB_DEVICE_STATUS, false)) \
131 ifeq ($(CFG_ADB_DEVICE_STATUS),true)
132 CFG_ADB_TEST_DIR=/data/tmp
134 $(info check: android device test dir $(CFG_ADB_TEST_DIR) ready \
135 $(shell $(CFG_ADB) remount 1>/dev/null) \
136 $(shell $(CFG_ADB) shell rm -r $(CFG_ADB_TEST_DIR) >/dev/null) \
137 $(shell $(CFG_ADB) shell mkdir $(CFG_ADB_TEST_DIR)) \
138 $(shell $(CFG_ADB) shell mkdir $(CFG_ADB_TEST_DIR)/tmp) \
139 $(shell $(CFG_ADB) push $(S)src/etc/adb_run_wrapper.sh $(CFG_ADB_TEST_DIR) 1>/dev/null) \
140 $(foreach crate,$(TARGET_CRATES), \
141 $(shell $(CFG_ADB) push $(TLIB2_T_arm-linux-androideabi_H_$(CFG_BUILD))/$(call CFG_LIB_GLOB_arm-linux-androideabi,$(crate)) \
142 $(CFG_ADB_TEST_DIR))) \
148 # $(1) - name of doc test
149 # $(2) - file of the test
151 DOC_NAMES := $$(DOC_NAMES) $(1)
155 $(foreach doc,$(DOCS), \
156 $(eval $(call DOCTEST,md-$(doc),$(S)src/doc/$(doc).md)))
157 $(foreach file,$(wildcard $(S)src/doc/trpl/*.md), \
158 $(eval $(call DOCTEST,$(file:$(S)src/doc/trpl/%.md=trpl-%),$(file))))
160 ######################################################################
162 ######################################################################
164 # The main testing target. Tests lots of stuff.
165 check: cleantmptestlogs cleantestlibs check-notidy tidy
167 # As above but don't bother running tidy.
168 check-notidy: cleantmptestlogs cleantestlibs all check-stage2
169 $(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
171 # A slightly smaller set of tests for smoke testing.
172 check-lite: cleantestlibs cleantmptestlogs \
173 $(foreach crate,$(TEST_TARGET_CRATES),check-stage2-$(crate)) \
174 check-stage2-rpass check-stage2-rpass-valgrind \
175 check-stage2-rfail check-stage2-cfail check-stage2-rmake
176 $(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
178 # Only check the 'reference' tests: rpass/cfail/rfail/rmake.
179 check-ref: cleantestlibs cleantmptestlogs check-stage2-rpass check-stage2-rpass-valgrind \
180 check-stage2-rfail check-stage2-cfail check-stage2-rmake
181 $(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
183 # Only check the docs.
184 check-docs: cleantestlibs cleantmptestlogs check-stage2-docs
185 $(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
187 # Some less critical tests that are not prone to breakage.
188 # Not run as part of the normal test suite, but tested by bors on checkin.
189 check-secondary: check-build-compiletest check-build-lexer-verifier check-lexer check-pretty
191 # check + check-secondary.
193 # Issue #17883: build check-secondary first so hidden dependencies in
194 # e.g. building compiletest are exercised (resolve those by adding
195 # deps to rules that need them; not by putting `check` first here).
196 check-all: check-secondary check
198 # Pretty-printing tests.
199 check-pretty: check-stage2-T-$(CFG_BUILD)-H-$(CFG_BUILD)-pretty-exec
201 define DEF_CHECK_BUILD_COMPILETEST_FOR_STAGE
202 check-stage$(1)-build-compiletest: $$(HBIN$(1)_H_$(CFG_BUILD))/compiletest$$(X_$(CFG_BUILD))
205 $(foreach stage,$(STAGES), \
206 $(eval $(call DEF_CHECK_BUILD_COMPILETEST_FOR_STAGE,$(stage))))
208 check-build-compiletest: \
209 check-stage1-build-compiletest \
210 check-stage2-build-compiletest
212 .PHONY: cleantmptestlogs cleantestlibs
218 $(Q)find $(CFG_BUILD)/test \
219 -name '*.[odasS]' -o \
226 -name '*.libaux' -o \
229 -name '*.debugger.script' \
233 ######################################################################
235 ######################################################################
241 ALL_CS := $(wildcard $(S)src/rt/*.cpp \
243 $(S)src/rt/*/*/*.cpp \
244 $(S)src/rustllvm/*.cpp)
245 ALL_CS := $(filter-out $(S)src/rt/miniz.cpp \
246 $(wildcard $(S)src/rt/hoedown/src/*.c) \
247 $(wildcard $(S)src/rt/hoedown/bin/*.c) \
249 ALL_HS := $(wildcard $(S)src/rt/*.h \
252 $(S)src/rustllvm/*.h)
253 ALL_HS := $(filter-out $(S)src/rt/valgrind/valgrind.h \
254 $(S)src/rt/valgrind/memcheck.h \
255 $(S)src/rt/msvc/typeof.h \
256 $(S)src/rt/msvc/stdint.h \
257 $(S)src/rt/msvc/inttypes.h \
258 $(wildcard $(S)src/rt/hoedown/src/*.h) \
259 $(wildcard $(S)src/rt/hoedown/bin/*.h) \
262 # Run the tidy script in multiple parts to avoid huge 'echo' commands
264 @$(call E, check: formatting)
265 $(Q)find $(S)src -name '*.r[sc]' \
266 -and -not -regex '^$(S)src/jemalloc.*' \
267 -and -not -regex '^$(S)src/libuv.*' \
268 -and -not -regex '^$(S)src/llvm.*' \
269 -and -not -regex '^$(S)src/gyp.*' \
270 -and -not -regex '^$(S)src/libbacktrace.*' \
272 | xargs -0 -n 10 $(CFG_PYTHON) $(S)src/etc/tidy.py
273 $(Q)find $(S)src/etc -name '*.py' \
274 | xargs -n 10 $(CFG_PYTHON) $(S)src/etc/tidy.py
275 $(Q)find $(S)src/doc -name '*.js' \
276 | xargs -n 10 $(CFG_PYTHON) $(S)src/etc/tidy.py
277 $(Q)find $(S)src/etc -name '*.sh' \
278 | xargs -n 10 $(CFG_PYTHON) $(S)src/etc/tidy.py
279 $(Q)find $(S)src/etc -name '*.pl' \
280 | xargs -n 10 $(CFG_PYTHON) $(S)src/etc/tidy.py
281 $(Q)find $(S)src/etc -name '*.c' \
282 | xargs -n 10 $(CFG_PYTHON) $(S)src/etc/tidy.py
283 $(Q)find $(S)src/etc -name '*.h' \
284 | xargs -n 10 $(CFG_PYTHON) $(S)src/etc/tidy.py
286 | xargs -n 10 $(CFG_PYTHON) $(S)src/etc/tidy.py
288 | xargs -n 10 $(CFG_PYTHON) $(S)src/etc/tidy.py
289 $(Q)find $(S)src -type f -perm +a+x \
290 -not -name '*.rs' -and -not -name '*.py' \
291 -and -not -name '*.sh' \
292 | grep '^$(S)src/jemalloc' -v \
293 | grep '^$(S)src/libuv' -v \
294 | grep '^$(S)src/llvm' -v \
295 | grep '^$(S)src/rt/hoedown' -v \
296 | grep '^$(S)src/gyp' -v \
297 | grep '^$(S)src/etc' -v \
298 | grep '^$(S)src/doc' -v \
299 | grep '^$(S)src/compiler-rt' -v \
300 | grep '^$(S)src/libbacktrace' -v \
301 | grep '^$(S)src/rust-installer' -v \
302 | xargs $(CFG_PYTHON) $(S)src/etc/check-binaries.py
303 $(Q) $(CFG_PYTHON) $(S)src/etc/errorck.py $(S)src/
309 ######################################################################
311 ######################################################################
315 check-stage$(1)-T-$(2)-H-$(3)-exec: \
316 check-stage$(1)-T-$(2)-H-$(3)-rpass-exec \
317 check-stage$(1)-T-$(2)-H-$(3)-rfail-exec \
318 check-stage$(1)-T-$(2)-H-$(3)-cfail-exec \
319 check-stage$(1)-T-$(2)-H-$(3)-rpass-valgrind-exec \
320 check-stage$(1)-T-$(2)-H-$(3)-rpass-full-exec \
321 check-stage$(1)-T-$(2)-H-$(3)-cfail-full-exec \
322 check-stage$(1)-T-$(2)-H-$(3)-rmake-exec \
323 check-stage$(1)-T-$(2)-H-$(3)-crates-exec \
324 check-stage$(1)-T-$(2)-H-$(3)-doc-crates-exec \
325 check-stage$(1)-T-$(2)-H-$(3)-bench-exec \
326 check-stage$(1)-T-$(2)-H-$(3)-debuginfo-gdb-exec \
327 check-stage$(1)-T-$(2)-H-$(3)-debuginfo-lldb-exec \
328 check-stage$(1)-T-$(2)-H-$(3)-codegen-exec \
329 check-stage$(1)-T-$(2)-H-$(3)-doc-exec \
330 check-stage$(1)-T-$(2)-H-$(3)-pretty-exec
332 # Only test the compiler-dependent crates when the target is
333 # able to build a compiler (when the target triple is in the set of host triples)
334 ifneq ($$(findstring $(2),$$(CFG_HOST)),)
336 check-stage$(1)-T-$(2)-H-$(3)-crates-exec: \
337 $$(foreach crate,$$(TEST_CRATES), \
338 check-stage$(1)-T-$(2)-H-$(3)-$$(crate)-exec)
342 check-stage$(1)-T-$(2)-H-$(3)-crates-exec: \
343 $$(foreach crate,$$(TEST_TARGET_CRATES), \
344 check-stage$(1)-T-$(2)-H-$(3)-$$(crate)-exec)
348 check-stage$(1)-T-$(2)-H-$(3)-doc-crates-exec: \
349 $$(foreach crate,$$(TEST_DOC_CRATES), \
350 check-stage$(1)-T-$(2)-H-$(3)-doc-crate-$$(crate)-exec)
352 check-stage$(1)-T-$(2)-H-$(3)-doc-exec: \
353 $$(foreach docname,$$(DOC_NAMES), \
354 check-stage$(1)-T-$(2)-H-$(3)-doc-$$(docname)-exec) \
356 check-stage$(1)-T-$(2)-H-$(3)-pretty-exec: \
357 check-stage$(1)-T-$(2)-H-$(3)-pretty-rpass-exec \
358 check-stage$(1)-T-$(2)-H-$(3)-pretty-rpass-valgrind-exec \
359 check-stage$(1)-T-$(2)-H-$(3)-pretty-rpass-full-exec \
360 check-stage$(1)-T-$(2)-H-$(3)-pretty-rfail-exec \
361 check-stage$(1)-T-$(2)-H-$(3)-pretty-bench-exec \
362 check-stage$(1)-T-$(2)-H-$(3)-pretty-pretty-exec
366 $(foreach host,$(CFG_HOST), \
367 $(foreach target,$(CFG_TARGET), \
368 $(foreach stage,$(STAGES), \
369 $(eval $(call DEF_TEST_SETS,$(stage),$(target),$(host))))))
372 ######################################################################
374 ######################################################################
378 # If NO_REBUILD is set then break the dependencies on everything but
379 # the source files so we can test crates without rebuilding any of the
381 ifeq ($(NO_REBUILD),)
382 TESTDEP_$(1)_$(2)_$(3)_$(4) = $$(SREQ$(1)_T_$(2)_H_$(3)) \
383 $$(foreach crate,$$(TARGET_CRATES), \
384 $$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$$(crate)) \
385 $$(CRATE_FULLDEPS_$(1)_T_$(2)_H_$(3)_$(4))
388 TESTDEP_$(1)_$(2)_$(3)_$(4) = $$(RSINPUTS_$(4))
391 $(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2)): CFG_COMPILER_HOST_TRIPLE = $(2)
392 $(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2)): \
394 $$(TESTDEP_$(1)_$(2)_$(3)_$(4))
395 @$$(call E, rustc: $$@)
396 $(Q)CFG_LLVM_LINKAGE_FILE=$$(LLVM_LINKAGE_PATH_$(3)) \
397 $$(subst @,,$$(STAGE$(1)_T_$(2)_H_$(3))) -o $$@ $$< --test \
398 -L "$$(RT_OUTPUT_DIR_$(2))" \
399 -L "$$(LLVM_LIBDIR_$(2))" \
404 $(foreach host,$(CFG_HOST), \
405 $(eval $(foreach target,$(CFG_TARGET), \
406 $(eval $(foreach stage,$(STAGES), \
407 $(eval $(foreach crate,$(TEST_CRATES), \
408 $(eval $(call TEST_RUNNER,$(stage),$(target),$(host),$(crate))))))))))
410 define DEF_TEST_CRATE_RULES
411 check-stage$(1)-T-$(2)-H-$(3)-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4))
413 $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
414 $(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2))
415 @$$(call E, run: $$<)
416 $$(Q)$$(call CFG_RUN_TEST_$(2),$$<,$(1),$(2),$(3)) $$(TESTARGS) \
417 --logfile $$(call TEST_LOG_FILE,$(1),$(2),$(3),$(4)) \
418 $$(call CRATE_TEST_EXTRA_ARGS,$(1),$(2),$(3),$(4)) \
422 define DEF_TEST_CRATE_RULES_arm-linux-androideabi
423 check-stage$(1)-T-$(2)-H-$(3)-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4))
425 $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
426 $(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2))
427 @$$(call E, run: $$< via adb)
428 $$(Q)$(CFG_ADB) push $$< $(CFG_ADB_TEST_DIR)
429 $$(Q)$(CFG_ADB) shell '(cd $(CFG_ADB_TEST_DIR); LD_LIBRARY_PATH=. \
431 --logfile $(CFG_ADB_TEST_DIR)/check-stage$(1)-T-$(2)-H-$(3)-$(4).log \
432 $$(call CRATE_TEST_EXTRA_ARGS,$(1),$(2),$(3),$(4)) $(TESTARGS))' \
433 > tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).tmp
434 $$(Q)cat tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).tmp
435 $$(Q)touch tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).log
436 $$(Q)$(CFG_ADB) pull $(CFG_ADB_TEST_DIR)/check-stage$(1)-T-$(2)-H-$(3)-$(4).log tmp/
437 $$(Q)$(CFG_ADB) shell rm $(CFG_ADB_TEST_DIR)/check-stage$(1)-T-$(2)-H-$(3)-$(4).log
438 @if grep -q "result: ok" tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).tmp; \
440 rm tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).tmp; \
443 rm tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).tmp; \
448 define DEF_TEST_CRATE_RULES_null
449 check-stage$(1)-T-$(2)-H-$(3)-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4))
451 $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
452 $(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2))
453 @$$(call E, failing: no device for $$< )
457 $(foreach host,$(CFG_HOST), \
458 $(foreach target,$(CFG_TARGET), \
459 $(foreach stage,$(STAGES), \
460 $(foreach crate, $(TEST_CRATES), \
461 $(if $(findstring $(target),$(CFG_BUILD)), \
462 $(eval $(call DEF_TEST_CRATE_RULES,$(stage),$(target),$(host),$(crate))), \
463 $(if $(findstring $(target),"arm-linux-androideabi"), \
464 $(if $(findstring $(CFG_ADB_DEVICE_STATUS),"true"), \
465 $(eval $(call DEF_TEST_CRATE_RULES_arm-linux-androideabi,$(stage),$(target),$(host),$(crate))), \
466 $(eval $(call DEF_TEST_CRATE_RULES_null,$(stage),$(target),$(host),$(crate))) \
468 $(eval $(call DEF_TEST_CRATE_RULES,$(stage),$(target),$(host),$(crate))) \
471 ######################################################################
472 # Rules for the compiletest tests (rpass, rfail, etc.)
473 ######################################################################
475 RPASS_RS := $(wildcard $(S)src/test/run-pass/*.rs)
476 RPASS_VALGRIND_RS := $(wildcard $(S)src/test/run-pass-valgrind/*.rs)
477 RPASS_FULL_RS := $(wildcard $(S)src/test/run-pass-fulldeps/*.rs)
478 CFAIL_FULL_RS := $(wildcard $(S)src/test/compile-fail-fulldeps/*.rs)
479 RFAIL_RS := $(wildcard $(S)src/test/run-fail/*.rs)
480 CFAIL_RS := $(wildcard $(S)src/test/compile-fail/*.rs)
481 BENCH_RS := $(wildcard $(S)src/test/bench/*.rs)
482 PRETTY_RS := $(wildcard $(S)src/test/pretty/*.rs)
483 DEBUGINFO_GDB_RS := $(wildcard $(S)src/test/debuginfo/*.rs)
484 DEBUGINFO_LLDB_RS := $(wildcard $(S)src/test/debuginfo/*.rs)
485 CODEGEN_RS := $(wildcard $(S)src/test/codegen/*.rs)
486 CODEGEN_CC := $(wildcard $(S)src/test/codegen/*.cc)
488 # perf tests are the same as bench tests only they run under
489 # a performance monitor.
490 PERF_RS := $(wildcard $(S)src/test/bench/*.rs)
492 RPASS_TESTS := $(RPASS_RS)
493 RPASS_VALGRIND_TESTS := $(RPASS_VALGRIND_RS)
494 RPASS_FULL_TESTS := $(RPASS_FULL_RS)
495 CFAIL_FULL_TESTS := $(CFAIL_FULL_RS)
496 RFAIL_TESTS := $(RFAIL_RS)
497 CFAIL_TESTS := $(CFAIL_RS)
498 BENCH_TESTS := $(BENCH_RS)
499 PERF_TESTS := $(PERF_RS)
500 PRETTY_TESTS := $(PRETTY_RS)
501 DEBUGINFO_GDB_TESTS := $(DEBUGINFO_GDB_RS)
502 DEBUGINFO_LLDB_TESTS := $(DEBUGINFO_LLDB_RS)
503 CODEGEN_TESTS := $(CODEGEN_RS) $(CODEGEN_CC)
505 CTEST_SRC_BASE_rpass = run-pass
506 CTEST_BUILD_BASE_rpass = run-pass
507 CTEST_MODE_rpass = run-pass
508 CTEST_RUNTOOL_rpass = $(CTEST_RUNTOOL)
510 CTEST_SRC_BASE_rpass-valgrind = run-pass-valgrind
511 CTEST_BUILD_BASE_rpass-valgrind = run-pass-valgrind
512 CTEST_MODE_rpass-valgrind = run-pass-valgrind
513 CTEST_RUNTOOL_rpass-valgrind = $(CTEST_RUNTOOL)
515 CTEST_SRC_BASE_rpass-full = run-pass-fulldeps
516 CTEST_BUILD_BASE_rpass-full = run-pass-fulldeps
517 CTEST_MODE_rpass-full = run-pass
518 CTEST_RUNTOOL_rpass-full = $(CTEST_RUNTOOL)
520 CTEST_SRC_BASE_cfail-full = compile-fail-fulldeps
521 CTEST_BUILD_BASE_cfail-full = compile-fail-fulldeps
522 CTEST_MODE_cfail-full = compile-fail
523 CTEST_RUNTOOL_cfail-full = $(CTEST_RUNTOOL)
525 CTEST_SRC_BASE_rfail = run-fail
526 CTEST_BUILD_BASE_rfail = run-fail
527 CTEST_MODE_rfail = run-fail
528 CTEST_RUNTOOL_rfail = $(CTEST_RUNTOOL)
530 CTEST_SRC_BASE_cfail = compile-fail
531 CTEST_BUILD_BASE_cfail = compile-fail
532 CTEST_MODE_cfail = compile-fail
533 CTEST_RUNTOOL_cfail = $(CTEST_RUNTOOL)
535 CTEST_SRC_BASE_bench = bench
536 CTEST_BUILD_BASE_bench = bench
537 CTEST_MODE_bench = run-pass
538 CTEST_RUNTOOL_bench = $(CTEST_RUNTOOL)
540 CTEST_SRC_BASE_perf = bench
541 CTEST_BUILD_BASE_perf = perf
542 CTEST_MODE_perf = run-pass
543 CTEST_RUNTOOL_perf = $(CTEST_PERF_RUNTOOL)
545 CTEST_SRC_BASE_debuginfo-gdb = debuginfo
546 CTEST_BUILD_BASE_debuginfo-gdb = debuginfo-gdb
547 CTEST_MODE_debuginfo-gdb = debuginfo-gdb
548 CTEST_RUNTOOL_debuginfo-gdb = $(CTEST_RUNTOOL)
550 CTEST_SRC_BASE_debuginfo-lldb = debuginfo
551 CTEST_BUILD_BASE_debuginfo-lldb = debuginfo-lldb
552 CTEST_MODE_debuginfo-lldb = debuginfo-lldb
553 CTEST_RUNTOOL_debuginfo-lldb = $(CTEST_RUNTOOL)
555 CTEST_SRC_BASE_codegen = codegen
556 CTEST_BUILD_BASE_codegen = codegen
557 CTEST_MODE_codegen = codegen
558 CTEST_RUNTOOL_codegen = $(CTEST_RUNTOOL)
560 # CTEST_DISABLE_$(TEST_GROUP), if set, will cause the test group to be
561 # disabled and the associated message to be printed as a warning
562 # during attempts to run those tests.
565 CTEST_DISABLE_debuginfo-gdb = "no gdb found"
569 CTEST_DISABLE_debuginfo-lldb = "no lldb found"
573 CTEST_DISABLE_codegen = "no clang found"
576 ifneq ($(CFG_OSTYPE),apple-darwin)
577 CTEST_DISABLE_debuginfo-lldb = "lldb tests are only run on darwin"
580 ifeq ($(CFG_OSTYPE),apple-darwin)
581 CTEST_DISABLE_debuginfo-gdb = "gdb on darwin needs root"
584 # CTEST_DISABLE_NONSELFHOST_$(TEST_GROUP), if set, will cause that
585 # test group to be disabled *unless* the target is able to build a
586 # compiler (i.e. when the target triple is in the set of of host
587 # triples). The associated message will be printed as a warning
588 # during attempts to run those tests.
590 define DEF_CTEST_VARS
592 # All the per-stage build rules you might want to call from the
595 # $(1) is the stage number
596 # $(2) is the target triple to test
597 # $(3) is the host triple to test
599 # Prerequisites for compiletest tests
600 TEST_SREQ$(1)_T_$(2)_H_$(3) = \
601 $$(HBIN$(1)_H_$(3))/compiletest$$(X_$(3)) \
602 $$(SREQ$(1)_T_$(2)_H_$(3))
604 # Rules for the cfail/rfail/rpass/bench/perf test runner
606 # The tests select when to use debug configuration on their own;
607 # remove directive, if present, from CFG_RUSTC_FLAGS (issue #7898).
608 CTEST_RUSTC_FLAGS := $$(subst --cfg ndebug,,$$(CFG_RUSTC_FLAGS))
610 # The tests cannot be optimized while the rest of the compiler is optimized, so
611 # filter out the optimization (if any) from rustc and then figure out if we need
613 CTEST_RUSTC_FLAGS := $$(subst -O,,$$(CTEST_RUSTC_FLAGS))
614 ifndef CFG_DISABLE_OPTIMIZE_TESTS
615 CTEST_RUSTC_FLAGS += -O
619 CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) := \
620 --compile-lib-path $$(HLIB$(1)_H_$(3)) \
621 --run-lib-path $$(TLIB$(1)_T_$(2)_H_$(3)) \
622 --rustc-path $$(HBIN$(1)_H_$(3))/rustc$$(X_$(3)) \
623 --clang-path $(if $(CFG_CLANG),$(CFG_CLANG),clang) \
624 --llvm-bin-path $(CFG_LLVM_INST_DIR_$(CFG_BUILD))/bin \
625 --aux-base $$(S)src/test/auxiliary/ \
626 --stage-id stage$(1)-$(2) \
629 --gdb-version="$(CFG_GDB_VERSION)" \
630 --lldb-version="$(CFG_LLDB_VERSION)" \
631 --android-cross-path=$(CFG_ANDROID_CROSS_PATH) \
632 --adb-path=$(CFG_ADB) \
633 --adb-test-dir=$(CFG_ADB_TEST_DIR) \
634 --host-rustcflags "$(RUSTC_FLAGS_$(3)) $$(CTEST_RUSTC_FLAGS) -L $$(RT_OUTPUT_DIR_$(3))" \
635 --lldb-python-dir=$(CFG_LLDB_PYTHON_DIR) \
636 --target-rustcflags "$(RUSTC_FLAGS_$(2)) $$(CTEST_RUSTC_FLAGS) -L $$(RT_OUTPUT_DIR_$(2))" \
639 ifdef CFG_VALGRIND_RPASS
640 ifdef GOOD_VALGRIND_$(2)
641 $(info cfg: valgrind-path set to $(CFG_VALGRIND_RPASS))
642 CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) += --valgrind-path "$(CFG_VALGRIND_RPASS)"
646 ifndef CFG_DISABLE_VALGRIND_RPASS
647 ifdef GOOD_VALGRIND_$(2)
648 CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) += --force-valgrind
652 CTEST_DEPS_rpass_$(1)-T-$(2)-H-$(3) = $$(RPASS_TESTS)
653 CTEST_DEPS_rpass-valgrind_$(1)-T-$(2)-H-$(3) = $$(RPASS_VALGRIND_TESTS)
654 CTEST_DEPS_rpass-full_$(1)-T-$(2)-H-$(3) = $$(RPASS_FULL_TESTS) $$(CSREQ$(1)_T_$(3)_H_$(3)) $$(SREQ$(1)_T_$(2)_H_$(3))
655 CTEST_DEPS_cfail-full_$(1)-T-$(2)-H-$(3) = $$(CFAIL_FULL_TESTS) $$(CSREQ$(1)_T_$(3)_H_$(3)) $$(SREQ$(1)_T_$(2)_H_$(3))
656 CTEST_DEPS_rfail_$(1)-T-$(2)-H-$(3) = $$(RFAIL_TESTS)
657 CTEST_DEPS_cfail_$(1)-T-$(2)-H-$(3) = $$(CFAIL_TESTS)
658 CTEST_DEPS_bench_$(1)-T-$(2)-H-$(3) = $$(BENCH_TESTS)
659 CTEST_DEPS_perf_$(1)-T-$(2)-H-$(3) = $$(PERF_TESTS)
660 CTEST_DEPS_debuginfo-gdb_$(1)-T-$(2)-H-$(3) = $$(DEBUGINFO_GDB_TESTS)
661 CTEST_DEPS_debuginfo-lldb_$(1)-T-$(2)-H-$(3) = $$(DEBUGINFO_LLDB_TESTS) \
662 $(S)src/etc/lldb_batchmode.py \
663 $(S)src/etc/lldb_rust_formatters.py
664 CTEST_DEPS_codegen_$(1)-T-$(2)-H-$(3) = $$(CODEGEN_TESTS)
668 $(foreach host,$(CFG_HOST), \
669 $(eval $(foreach target,$(CFG_TARGET), \
670 $(eval $(foreach stage,$(STAGES), \
671 $(eval $(call DEF_CTEST_VARS,$(stage),$(target),$(host))))))))
673 define DEF_RUN_COMPILETEST
675 CTEST_ARGS$(1)-T-$(2)-H-$(3)-$(4) := \
676 $$(CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3)) \
677 --src-base $$(S)src/test/$$(CTEST_SRC_BASE_$(4))/ \
678 --build-base $(3)/test/$$(CTEST_BUILD_BASE_$(4))/ \
679 --mode $$(CTEST_MODE_$(4)) \
680 $$(CTEST_RUNTOOL_$(4))
682 check-stage$(1)-T-$(2)-H-$(3)-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4))
684 # CTEST_DONT_RUN_$(1)-T-$(2)-H-$(3)-$(4)
685 # Goal: leave this variable as empty string if we should run the test.
686 # Otherwise, set it to the reason we are not running the test.
687 # (Encoded as a separate variable because GNU make does not have a
688 # good way to express OR on ifeq commands)
690 ifneq ($$(CTEST_DISABLE_$(4)),)
691 # Test suite is disabled for all configured targets.
692 CTEST_DONT_RUN_$(1)-T-$(2)-H-$(3)-$(4) := $$(CTEST_DISABLE_$(4))
694 # else, check if non-self-hosted target (i.e. target not-in hosts) ...
695 ifeq ($$(findstring $(2),$$(CFG_HOST)),)
696 # ... if so, then check if this test suite is disabled for non-selfhosts.
697 ifneq ($$(CTEST_DISABLE_NONSELFHOST_$(4)),)
698 # Test suite is disabled for this target.
699 CTEST_DONT_RUN_$(1)-T-$(2)-H-$(3)-$(4) := $$(CTEST_DISABLE_NONSELFHOST_$(4))
702 # Neither DISABLE nor DISABLE_NONSELFHOST is set ==> okay, run the test.
705 ifeq ($$(CTEST_DONT_RUN_$(1)-T-$(2)-H-$(3)-$(4)),)
706 $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
707 $$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
708 $$(CTEST_DEPS_$(4)_$(1)-T-$(2)-H-$(3))
709 @$$(call E, run $(4) [$(2)]: $$<)
710 $$(Q)$$(call CFG_RUN_CTEST_$(2),$(1),$$<,$(3)) \
711 $$(CTEST_ARGS$(1)-T-$(2)-H-$(3)-$(4)) \
712 --logfile $$(call TEST_LOG_FILE,$(1),$(2),$(3),$(4)) \
717 $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)):
718 @$$(call E, run $(4) [$(2)]: $$<)
719 @$$(call E, warning: tests disabled: $$(CTEST_DONT_RUN_$(1)-T-$(2)-H-$(3)-$(4)))
726 CTEST_NAMES = rpass rpass-valgrind rpass-full cfail-full rfail cfail bench perf debuginfo-gdb debuginfo-lldb codegen
728 $(foreach host,$(CFG_HOST), \
729 $(eval $(foreach target,$(CFG_TARGET), \
730 $(eval $(foreach stage,$(STAGES), \
731 $(eval $(foreach name,$(CTEST_NAMES), \
732 $(eval $(call DEF_RUN_COMPILETEST,$(stage),$(target),$(host),$(name))))))))))
734 PRETTY_NAMES = pretty-rpass pretty-rpass-valgrind pretty-rpass-full pretty-rfail pretty-bench pretty-pretty
735 PRETTY_DEPS_pretty-rpass = $(RPASS_TESTS)
736 PRETTY_DEPS_pretty-rpass-valgrind = $(RPASS_VALGRIND_TESTS)
737 PRETTY_DEPS_pretty-rpass-full = $(RPASS_FULL_TESTS)
738 PRETTY_DEPS_pretty-rfail = $(RFAIL_TESTS)
739 PRETTY_DEPS_pretty-bench = $(BENCH_TESTS)
740 PRETTY_DEPS_pretty-pretty = $(PRETTY_TESTS)
741 # The stage- and host-specific dependencies are for e.g. macro_crate_test which pulls in
743 PRETTY_DEPS$(1)_H_$(3)_pretty-rpass =
744 PRETTY_DEPS$(1)_H_$(3)_pretty-rpass-full = $$(HLIB$(1)_H_$(3))/stamp.syntax $$(HLIB$(1)_H_$(3))/stamp.rustc
745 PRETTY_DEPS$(1)_H_$(3)_pretty-rfail =
746 PRETTY_DEPS$(1)_H_$(3)_pretty-bench =
747 PRETTY_DEPS$(1)_H_$(3)_pretty-pretty =
748 PRETTY_DIRNAME_pretty-rpass = run-pass
749 PRETTY_DIRNAME_pretty-rpass-valgrind = run-pass-valgrind
750 PRETTY_DIRNAME_pretty-rpass-full = run-pass-fulldeps
751 PRETTY_DIRNAME_pretty-rfail = run-fail
752 PRETTY_DIRNAME_pretty-bench = bench
753 PRETTY_DIRNAME_pretty-pretty = pretty
755 define DEF_RUN_PRETTY_TEST
757 PRETTY_ARGS$(1)-T-$(2)-H-$(3)-$(4) := \
758 $$(CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3)) \
759 --src-base $$(S)src/test/$$(PRETTY_DIRNAME_$(4))/ \
760 --build-base $(3)/test/$$(PRETTY_DIRNAME_$(4))/ \
763 check-stage$(1)-T-$(2)-H-$(3)-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4))
765 $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
766 $$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
767 $$(PRETTY_DEPS_$(4)) \
768 $$(PRETTY_DEPS$(1)_H_$(3)_$(4))
769 @$$(call E, run pretty-rpass [$(2)]: $$<)
770 $$(Q)$$(call CFG_RUN_CTEST_$(2),$(1),$$<,$(3)) \
771 $$(PRETTY_ARGS$(1)-T-$(2)-H-$(3)-$(4)) \
772 --logfile $$(call TEST_LOG_FILE,$(1),$(2),$(3),$(4)) \
777 $(foreach host,$(CFG_HOST), \
778 $(foreach target,$(CFG_TARGET), \
779 $(foreach stage,$(STAGES), \
780 $(foreach pretty-name,$(PRETTY_NAMES), \
781 $(eval $(call DEF_RUN_PRETTY_TEST,$(stage),$(target),$(host),$(pretty-name)))))))
784 ######################################################################
785 # Crate & freestanding documentation tests
786 ######################################################################
789 RUSTDOC_EXE_$(1)_T_$(2)_H_$(3) := $$(HBIN$(1)_H_$(3))/rustdoc$$(X_$(3))
790 RUSTDOC_$(1)_T_$(2)_H_$(3) := $$(RPATH_VAR$(1)_T_$(2)_H_$(3)) $$(RUSTDOC_EXE_$(1)_T_$(2)_H_$(3))
793 $(foreach host,$(CFG_HOST), \
794 $(foreach target,$(CFG_TARGET), \
795 $(foreach stage,$(STAGES), \
796 $(eval $(call DEF_RUSTDOC,$(stage),$(target),$(host))))))
802 check-stage$(1)-T-$(2)-H-$(3)-doc-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),doc-$(4))
804 # If NO_REBUILD is set then break the dependencies on everything but
805 # the source files so we can test documentation without rebuilding
807 ifeq ($(NO_REBUILD),)
808 DOCTESTDEP_$(1)_$(2)_$(3)_$(4) = \
810 $$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
811 $$(RUSTDOC_EXE_$(1)_T_$(2)_H_$(3))
813 DOCTESTDEP_$(1)_$(2)_$(3)_$(4) = $$(DOCFILE_$(4))
816 ifeq ($(2),$$(CFG_BUILD))
817 $$(call TEST_OK_FILE,$(1),$(2),$(3),doc-$(4)): $$(DOCTESTDEP_$(1)_$(2)_$(3)_$(4))
818 @$$(call E, run doc-$(4) [$(2)])
819 $$(Q)$$(RUSTDOC_$(1)_T_$(2)_H_$(3)) --cfg dox --test $$< \
820 --test-args "$$(TESTARGS)" && touch $$@
822 $$(call TEST_OK_FILE,$(1),$(2),$(3),doc-$(4)):
827 $(foreach host,$(CFG_HOST), \
828 $(foreach target,$(CFG_TARGET), \
829 $(foreach stage,$(STAGES), \
830 $(foreach docname,$(DOC_NAMES), \
831 $(eval $(call DEF_DOC_TEST,$(stage),$(target),$(host),$(docname)))))))
835 define DEF_CRATE_DOC_TEST
837 # If NO_REBUILD is set then break the dependencies on everything but
838 # the source files so we can test crate documentation without
839 # rebuilding any of the parent crates.
840 ifeq ($(NO_REBUILD),)
841 CRATEDOCTESTDEP_$(1)_$(2)_$(3)_$(4) = \
842 $$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
843 $$(CRATE_FULLDEPS_$(1)_T_$(2)_H_$(3)_$(4)) \
844 $$(RUSTDOC_EXE_$(1)_T_$(2)_H_$(3))
846 CRATEDOCTESTDEP_$(1)_$(2)_$(3)_$(4) = $$(RSINPUTS_$(4))
849 check-stage$(1)-T-$(2)-H-$(3)-doc-crate-$(4)-exec: \
850 $$(call TEST_OK_FILE,$(1),$(2),$(3),doc-crate-$(4))
852 ifeq ($(2),$$(CFG_BUILD))
853 $$(call TEST_OK_FILE,$(1),$(2),$(3),doc-crate-$(4)): $$(CRATEDOCTESTDEP_$(1)_$(2)_$(3)_$(4))
854 @$$(call E, run doc-crate-$(4) [$(2)])
855 $$(Q)CFG_LLVM_LINKAGE_FILE=$$(LLVM_LINKAGE_PATH_$(3)) \
856 $$(RUSTDOC_$(1)_T_$(2)_H_$(3)) --test --cfg dox \
857 $$(CRATEFILE_$(4)) --test-args "$$(TESTARGS)" && touch $$@
859 $$(call TEST_OK_FILE,$(1),$(2),$(3),doc-crate-$(4)):
865 $(foreach host,$(CFG_HOST), \
866 $(foreach target,$(CFG_TARGET), \
867 $(foreach stage,$(STAGES), \
868 $(foreach crate,$(TEST_DOC_CRATES), \
869 $(eval $(call DEF_CRATE_DOC_TEST,$(stage),$(target),$(host),$(crate)))))))
871 ######################################################################
873 ######################################################################
877 $(foreach crate,$(TEST_CRATES),$(crate)) \
878 $(foreach crate,$(TEST_DOC_CRATES),doc-crate-$(crate)) \
892 $(foreach docname,$(DOC_NAMES),doc-$(docname)) \
895 pretty-rpass-valgrind \
902 define DEF_CHECK_FOR_STAGE_AND_TARGET_AND_HOST
903 check-stage$(1)-T-$(2)-H-$(3): check-stage$(1)-T-$(2)-H-$(3)-exec
906 $(foreach stage,$(STAGES), \
907 $(foreach target,$(CFG_TARGET), \
908 $(foreach host,$(CFG_HOST), \
909 $(eval $(call DEF_CHECK_FOR_STAGE_AND_TARGET_AND_HOST,$(stage),$(target),$(host))))))
911 define DEF_CHECK_FOR_STAGE_AND_TARGET_AND_HOST_AND_GROUP
912 check-stage$(1)-T-$(2)-H-$(3)-$(4): check-stage$(1)-T-$(2)-H-$(3)-$(4)-exec
915 $(foreach stage,$(STAGES), \
916 $(foreach target,$(CFG_TARGET), \
917 $(foreach host,$(CFG_HOST), \
918 $(foreach group,$(TEST_GROUPS), \
919 $(eval $(call DEF_CHECK_FOR_STAGE_AND_TARGET_AND_HOST_AND_GROUP,$(stage),$(target),$(host),$(group)))))))
921 define DEF_CHECK_FOR_STAGE
922 check-stage$(1): check-stage$(1)-H-$$(CFG_BUILD)
923 check-stage$(1)-H-all: $$(foreach target,$$(CFG_TARGET), \
924 check-stage$(1)-H-$$(target))
927 $(foreach stage,$(STAGES), \
928 $(eval $(call DEF_CHECK_FOR_STAGE,$(stage))))
930 define DEF_CHECK_FOR_STAGE_AND_GROUP
931 check-stage$(1)-$(2): check-stage$(1)-H-$$(CFG_BUILD)-$(2)
932 check-stage$(1)-H-all-$(2): $$(foreach target,$$(CFG_TARGET), \
933 check-stage$(1)-H-$$(target)-$(2))
936 $(foreach stage,$(STAGES), \
937 $(foreach group,$(TEST_GROUPS), \
938 $(eval $(call DEF_CHECK_FOR_STAGE_AND_GROUP,$(stage),$(group)))))
941 define DEF_CHECK_FOR_STAGE_AND_HOSTS
942 check-stage$(1)-H-$(2): $$(foreach target,$$(CFG_TARGET), \
943 check-stage$(1)-T-$$(target)-H-$(2))
946 $(foreach stage,$(STAGES), \
947 $(foreach host,$(CFG_HOST), \
948 $(eval $(call DEF_CHECK_FOR_STAGE_AND_HOSTS,$(stage),$(host)))))
950 define DEF_CHECK_FOR_STAGE_AND_HOSTS_AND_GROUP
951 check-stage$(1)-H-$(2)-$(3): $$(foreach target,$$(CFG_TARGET), \
952 check-stage$(1)-T-$$(target)-H-$(2)-$(3))
955 $(foreach stage,$(STAGES), \
956 $(foreach host,$(CFG_HOST), \
957 $(foreach group,$(TEST_GROUPS), \
958 $(eval $(call DEF_CHECK_FOR_STAGE_AND_HOSTS_AND_GROUP,$(stage),$(host),$(group))))))
960 define DEF_CHECK_DOC_FOR_STAGE
961 check-stage$(1)-docs: $$(foreach docname,$$(DOC_NAMES), \
962 check-stage$(1)-T-$$(CFG_BUILD)-H-$$(CFG_BUILD)-doc-$$(docname)) \
963 $$(foreach crate,$$(TEST_DOC_CRATES), \
964 check-stage$(1)-T-$$(CFG_BUILD)-H-$$(CFG_BUILD)-doc-crate-$$(crate))
967 $(foreach stage,$(STAGES), \
968 $(eval $(call DEF_CHECK_DOC_FOR_STAGE,$(stage))))
970 define DEF_CHECK_CRATE
971 check-$(1): check-stage2-T-$$(CFG_BUILD)-H-$$(CFG_BUILD)-$(1)-exec
974 $(foreach crate,$(TEST_CRATES), \
975 $(eval $(call DEF_CHECK_CRATE,$(crate))))
977 ######################################################################
979 ######################################################################
981 RMAKE_TESTS := $(shell ls -d $(S)src/test/run-make/*/)
982 RMAKE_TESTS := $(RMAKE_TESTS:$(S)src/test/run-make/%/=%)
984 define DEF_RMAKE_FOR_T_H
990 ifeq ($(2)$(3),$$(CFG_BUILD)$$(CFG_BUILD))
991 check-stage$(1)-T-$(2)-H-$(3)-rmake-exec: \
992 $$(call TEST_OK_FILE,$(1),$(2),$(3),rmake)
994 $$(call TEST_OK_FILE,$(1),$(2),$(3),rmake): \
995 $$(RMAKE_TESTS:%=$(3)/test/run-make/%-$(1)-T-$(2)-H-$(3).ok)
998 $(3)/test/run-make/%-$(1)-T-$(2)-H-$(3).ok: \
999 $(S)src/test/run-make/%/Makefile \
1000 $$(CSREQ$(1)_T_$(2)_H_$(3))
1001 @rm -rf $(3)/test/run-make/$$*
1002 @mkdir -p $(3)/test/run-make/$$*
1003 $$(Q)$$(CFG_PYTHON) $(S)src/etc/maketest.py $$(dir $$<) \
1005 $$(HBIN$(1)_H_$(3))/rustc$$(X_$(3)) \
1006 $(3)/test/run-make/$$* \
1007 "$$(CC_$(3)) $$(CFG_GCCISH_CFLAGS_$(3))" \
1008 $$(HBIN$(1)_H_$(3))/rustdoc$$(X_$(3)) \
1010 $$(LD_LIBRARY_PATH_ENV_NAME$(1)_T_$(2)_H_$(3)) \
1011 "$$(LD_LIBRARY_PATH_ENV_HOSTDIR$(1)_T_$(2)_H_$(3))" \
1012 "$$(LD_LIBRARY_PATH_ENV_TARGETDIR$(1)_T_$(2)_H_$(3))" \
1017 # FIXME #11094 - The above rule doesn't work right for multiple targets
1018 check-stage$(1)-T-$(2)-H-$(3)-rmake-exec:
1026 $(foreach stage,$(STAGES), \
1027 $(foreach target,$(CFG_TARGET), \
1028 $(foreach host,$(CFG_HOST), \
1029 $(eval $(call DEF_RMAKE_FOR_T_H,$(stage),$(target),$(host))))))