]> git.lizzy.rs Git - rust.git/blob - mk/tests.mk
docs: Make supplemental tutorials testable
[rust.git] / mk / tests.mk
1 ######################################################################
2 # Testing variables
3 ######################################################################
4
5 RPASS_RC := $(wildcard $(S)src/test/run-pass/*.rc)
6 RPASS_RS := $(wildcard $(S)src/test/run-pass/*.rs)
7 RPASS_FULL_RC := $(wildcard $(S)src/test/run-pass-fulldeps/*.rc)
8 RPASS_FULL_RS := $(wildcard $(S)src/test/run-pass-fulldeps/*.rs)
9 RFAIL_RC := $(wildcard $(S)src/test/run-fail/*.rc)
10 RFAIL_RS := $(wildcard $(S)src/test/run-fail/*.rs)
11 CFAIL_RC := $(wildcard $(S)src/test/compile-fail/*.rc)
12 CFAIL_RS := $(wildcard $(S)src/test/compile-fail/*.rs)
13 BENCH_RS := $(wildcard $(S)src/test/bench/*.rs)
14 PRETTY_RS := $(wildcard $(S)src/test/pretty/*.rs)
15
16 # perf tests are the same as bench tests only they run under
17 # a performance monitor.
18 PERF_RS := $(wildcard $(S)src/test/bench/*.rs)
19
20 RPASS_TESTS := $(RPASS_RC) $(RPASS_RS)
21 RPASS_FULL_TESTS := $(RPASS_FULL_RC) $(RPASS_FULL_RS)
22 RFAIL_TESTS := $(RFAIL_RC) $(RFAIL_RS)
23 CFAIL_TESTS := $(CFAIL_RC) $(CFAIL_RS)
24 BENCH_TESTS := $(BENCH_RS)
25 PERF_TESTS := $(PERF_RS)
26 PRETTY_TESTS := $(PRETTY_RS)
27
28 FT := run_pass_stage2
29 FT_LIB := $(call CFG_LIB_NAME,$(FT))
30 FT_DRIVER := $(FT)_driver
31
32 # The arguments to all test runners
33 ifdef TESTNAME
34   TESTARGS += $(TESTNAME)
35 endif
36
37 ifdef CHECK_XFAILS
38   TESTARGS += --ignored
39 endif
40
41 # Arguments to the cfail/rfail/rpass/bench tests
42 ifdef CFG_VALGRIND
43   CTEST_RUNTOOL = --runtool "$(CFG_VALGRIND)"
44 endif
45
46 # Arguments to the perf tests
47 ifdef CFG_PERF_TOOL
48   CTEST_PERF_RUNTOOL = --runtool "$(CFG_PERF_TOOL)"
49 endif
50
51 CTEST_TESTARGS := $(TESTARGS)
52
53 ifdef VERBOSE
54   CTEST_TESTARGS += --verbose
55 endif
56
57 # Run the compiletest runner itself under valgrind
58 ifdef CTEST_VALGRIND
59   CFG_RUN_CTEST=$(call CFG_RUN_TEST,$(2),$(3))
60 else
61   CFG_RUN_CTEST=$(call CFG_RUN,$(TLIB$(1)_T_$(3)_H_$(3)),$(2))
62 endif
63
64 # If we're running perf then set this environment variable
65 # to put the benchmarks into 'hard mode'
66 ifeq ($(MAKECMDGOALS),perf)
67   RUST_BENCH=1
68   export RUST_BENCH
69 endif
70
71
72 ######################################################################
73 # Main test targets
74 ######################################################################
75
76 .PHONY: cleantmptestlogs cleantestlibs
77
78 cleantmptestlogs:
79         $(Q)rm -f tmp/*.log
80
81 cleantestlibs:
82         $(Q)find $(CFG_HOST_TRIPLE)/test \
83          -name '*.[odasS]' -o \
84          -name '*.so' -o      \
85          -name '*.dylib' -o   \
86          -name '*.dll' -o     \
87          -name '*.def' -o     \
88          -name '*.bc' -o      \
89          -name '*.dSYM' -o    \
90          -name '*.libaux' -o      \
91          -name '*.out' -o     \
92          -name '*.err'        \
93          | xargs rm -rf
94
95 check: cleantestlibs cleantmptestlogs tidy all check-stage2
96         $(Q)$(S)src/etc/check-summary.py tmp/*.log
97
98 check-notidy: cleantestlibs cleantmptestlogs all check-stage2
99         $(Q)$(S)src/etc/check-summary.py tmp/*.log
100
101 check-full: cleantestlibs cleantmptestlogs tidy \
102             all check-stage1 check-stage2 check-stage3
103         $(Q)$(S)src/etc/check-summary.py tmp/*.log
104
105 check-test: cleantestlibs cleantmptestlogs all check-stage2-rfail
106         $(Q)$(S)src/etc/check-summary.py tmp/*.log
107
108 check-lite: cleantestlibs cleantmptestlogs rustc-stage2 \
109         check-stage2-core check-stage2-std check-stage2-rpass \
110         check-stage2-rfail check-stage2-cfail
111         $(Q)$(S)src/etc/check-summary.py tmp/*.log
112
113 # Run the tidy script in multiple parts to avoid huge 'echo' commands
114 ifdef CFG_NOTIDY
115 tidy:
116 else
117
118 ALL_CS := $(wildcard $(S)src/rt/*.cpp \
119                      $(S)src/rt/*/*.cpp \
120                      $(S)src/rt/*/*/*.cpp \
121                      $(S)srcrustllvm/*.cpp)
122 ALL_CS := $(filter-out $(S)src/rt/bigint/bigint_ext.cpp \
123                        $(S)src/rt/bigint/bigint_int.cpp \
124                        $(S)src/rt/miniz.cpp \
125         ,$(ALL_CS))
126 ALL_HS := $(wildcard $(S)src/rt/*.h \
127                      $(S)src/rt/*/*.h \
128                      $(S)src/rt/*/*/*.h \
129                      $(S)srcrustllvm/*.h)
130 ALL_HS := $(filter-out $(S)src/rt/vg/valgrind.h \
131                        $(S)src/rt/vg/memcheck.h \
132                        $(S)src/rt/uthash/uthash.h \
133                        $(S)src/rt/uthash/utlist.h \
134                        $(S)src/rt/msvc/typeof.h \
135                        $(S)src/rt/msvc/stdint.h \
136                        $(S)src/rt/msvc/inttypes.h \
137                        $(S)src/rt/bigint/bigint.h \
138         ,$(ALL_HS))
139
140 tidy:
141                 @$(call E, check: formatting)
142                 $(Q)find $(S)src -name '*.r[sc]' \
143                 | grep '^$(S)src/test' -v \
144                 | xargs -n 10 python $(S)src/etc/tidy.py
145                 $(Q)find $(S)src/etc -name '*.py' \
146                 | xargs -n 10 python $(S)src/etc/tidy.py
147                 $(Q)echo $(ALL_CS) \
148                 | xargs -n 10 python $(S)src/etc/tidy.py
149                 $(Q)echo $(ALL_HS) \
150                 | xargs -n 10 python $(S)src/etc/tidy.py
151
152 endif
153
154 ######################################################################
155 # Extracting tests for docs
156 ######################################################################
157
158 EXTRACT_TESTS := "$(CFG_PYTHON)" $(S)src/etc/extract-tests.py
159
160 define DEF_DOC_TEST_HOST
161
162 doc-tutorial-extract$(1):
163         @$$(call E, extract: tutorial tests)
164         $$(Q)rm -f $(1)/test/doc-tutorial/*.rs
165         $$(Q)$$(EXTRACT_TESTS) $$(S)doc/tutorial.md $(1)/test/doc-tutorial
166
167 doc-tutorial-ffi-extract$(1):
168         @$$(call E, extract: tutorial-ffi tests)
169         $$(Q)rm -f $(1)/test/doc-tutorial-ffi/*.rs
170         $$(Q)$$(EXTRACT_TESTS) $$(S)doc/tutorial-ffi.md $(1)/test/doc-tutorial-ffi
171
172 doc-tutorial-macros-extract$(1):
173         @$$(call E, extract: tutorial-macros tests)
174         $$(Q)rm -f $(1)/test/doc-tutorial-macros/*.rs
175         $$(Q)$$(EXTRACT_TESTS) $$(S)doc/tutorial-macros.md $(1)/test/doc-tutorial-macros
176
177 doc-tutorial-borrowed-ptr-extract$(1):
178         @$$(call E, extract: tutorial-borrowed-ptr tests)
179         $$(Q)rm -f $(1)/test/doc-tutorial-borrowed-ptr/*.rs
180         $$(Q)$$(EXTRACT_TESTS) $$(S)doc/tutorial-borrowed-ptr.md $(1)/test/doc-tutorial-borrowed-ptr
181
182 doc-ref-extract$(1):
183         @$$(call E, extract: ref tests)
184         $$(Q)rm -f $(1)/test/doc-ref/*.rs
185         $$(Q)$$(EXTRACT_TESTS) $$(S)doc/rust.md $(1)/test/doc-ref
186
187 endef
188
189 $(foreach host,$(CFG_TARGET_TRIPLES), \
190  $(eval $(call DEF_DOC_TEST_HOST,$(host))))
191
192 ######################################################################
193 # Rules for the test runners
194 ######################################################################
195
196 define TEST_STAGEN
197
198 # All the per-stage build rules you might want to call from the
199 # command line.
200 #
201 # $(1) is the stage number
202 # $(2) is the target triple to test
203 # $(3) is the host triple to test
204
205 # Prerequisites for compiletest tests
206 TEST_SREQ$(1)_T_$(2)_H_$(3) = \
207         $$(HBIN$(1)_H_$(3))/compiletest$$(X) \
208         $$(SREQ$(1)_T_$(2)_H_$(3))
209
210 # Prerequisites for compiletest tests that have deps on librustc, etc
211 FULL_TEST_SREQ$(1)_T_$(2)_H_$(3) = \
212         $$(HBIN$(1)_H_$(3))/compiletest$$(X) \
213         $$(SREQ$(1)_T_$(2)_H_$(3)) \
214         $$(TLIBRUSTC_DEFAULT$(1)_T_$(2)_H_$(3))
215
216 check-stage$(1)-T-$(2)-H-$(3):                                  \
217         check-stage$(1)-T-$(2)-H-$(3)-rustc                     \
218         check-stage$(1)-T-$(2)-H-$(3)-core          \
219         check-stage$(1)-T-$(2)-H-$(3)-std                       \
220         check-stage$(1)-T-$(2)-H-$(3)-rpass                     \
221         check-stage$(1)-T-$(2)-H-$(3)-rpass-full                        \
222         check-stage$(1)-T-$(2)-H-$(3)-rfail                     \
223         check-stage$(1)-T-$(2)-H-$(3)-cfail                     \
224         check-stage$(1)-T-$(2)-H-$(3)-bench                     \
225         check-stage$(1)-T-$(2)-H-$(3)-pretty        \
226     check-stage$(1)-T-$(2)-H-$(3)-rustdoc       \
227     check-stage$(1)-T-$(2)-H-$(3)-cargo       \
228     check-stage$(1)-T-$(2)-H-$(3)-doc-tutorial  \
229     check-stage$(1)-T-$(2)-H-$(3)-doc-tutorial-ffi  \
230     check-stage$(1)-T-$(2)-H-$(3)-doc-tutorial-macros  \
231     check-stage$(1)-T-$(2)-H-$(3)-doc-tutorial-borrowed-ptr  \
232     check-stage$(1)-T-$(2)-H-$(3)-doc-ref
233
234 check-stage$(1)-T-$(2)-H-$(3)-core:                             \
235         check-stage$(1)-T-$(2)-H-$(3)-core-dummy
236
237 check-stage$(1)-T-$(2)-H-$(3)-std:                              \
238         check-stage$(1)-T-$(2)-H-$(3)-std-dummy
239
240 check-stage$(1)-T-$(2)-H-$(3)-rustc:                            \
241         check-stage$(1)-T-$(2)-H-$(3)-rustc-dummy
242
243 check-stage$(1)-T-$(2)-H-$(3)-cfail:                            \
244         check-stage$(1)-T-$(2)-H-$(3)-cfail-dummy
245
246 check-stage$(1)-T-$(2)-H-$(3)-rfail:                            \
247         check-stage$(1)-T-$(2)-H-$(3)-rfail-dummy
248
249 check-stage$(1)-T-$(2)-H-$(3)-rpass:                            \
250         check-stage$(1)-T-$(2)-H-$(3)-rpass-dummy
251
252 check-stage$(1)-T-$(2)-H-$(3)-rpass-full:                               \
253         check-stage$(1)-T-$(2)-H-$(3)-rpass-full-dummy
254
255 check-stage$(1)-T-$(2)-H-$(3)-bench:                            \
256         check-stage$(1)-T-$(2)-H-$(3)-bench-dummy
257
258 check-stage$(1)-T-$(2)-H-$(3)-perf:                             \
259         check-stage$(1)-T-$(2)-H-$(3)-perf-dummy
260
261 check-stage$(1)-T-$(2)-H-$(3)-pretty:                   \
262         check-stage$(1)-T-$(2)-H-$(3)-pretty-rpass      \
263         check-stage$(1)-T-$(2)-H-$(3)-pretty-rpass-full \
264     check-stage$(1)-T-$(2)-H-$(3)-pretty-rfail  \
265     check-stage$(1)-T-$(2)-H-$(3)-pretty-bench  \
266     check-stage$(1)-T-$(2)-H-$(3)-pretty-pretty
267
268 check-stage$(1)-T-$(2)-H-$(3)-pretty-rpass:                     \
269         check-stage$(1)-T-$(2)-H-$(3)-pretty-rpass-dummy
270
271 check-stage$(1)-T-$(2)-H-$(3)-pretty-rpass-full:                        \
272         check-stage$(1)-T-$(2)-H-$(3)-pretty-rpass-full-dummy
273
274 check-stage$(1)-T-$(2)-H-$(3)-pretty-rfail:                     \
275         check-stage$(1)-T-$(2)-H-$(3)-pretty-rfail-dummy
276
277 check-stage$(1)-T-$(2)-H-$(3)-pretty-bench:                     \
278         check-stage$(1)-T-$(2)-H-$(3)-pretty-bench-dummy
279
280 check-stage$(1)-T-$(2)-H-$(3)-pretty-pretty:                            \
281         check-stage$(1)-T-$(2)-H-$(3)-pretty-pretty-dummy
282
283 check-stage$(1)-T-$(2)-H-$(3)-rustdoc:                          \
284         check-stage$(1)-T-$(2)-H-$(3)-rustdoc-dummy
285
286 check-stage$(1)-T-$(2)-H-$(3)-cargo:                            \
287         check-stage$(1)-T-$(2)-H-$(3)-cargo-dummy
288
289 check-stage$(1)-T-$(2)-H-$(3)-doc-tutorial: \
290         check-stage$(1)-T-$(2)-H-$(3)-doc-tutorial-dummy
291
292 check-stage$(1)-T-$(2)-H-$(3)-doc-tutorial-ffi: \
293         check-stage$(1)-T-$(2)-H-$(3)-doc-tutorial-ffi-dummy
294
295 check-stage$(1)-T-$(2)-H-$(3)-doc-tutorial-macros: \
296         check-stage$(1)-T-$(2)-H-$(3)-doc-tutorial-macros-dummy
297
298 check-stage$(1)-T-$(2)-H-$(3)-doc-tutorial-borrowed-ptr: \
299         check-stage$(1)-T-$(2)-H-$(3)-doc-tutorial-borrowed-ptr-dummy
300
301 check-stage$(1)-T-$(2)-H-$(3)-doc-ref: \
302         check-stage$(1)-T-$(2)-H-$(3)-doc-ref-dummy
303
304 # Rules for the core library test runner
305
306 $(3)/test/coretest.stage$(1)-$(2)$$(X):                 \
307                 $$(CORELIB_CRATE) $$(CORELIB_INPUTS)    \
308         $$(SREQ$(1)_T_$(2)_H_$(3))
309         @$$(call E, compile_and_link: $$@)
310         $$(STAGE$(1)_T_$(2)_H_$(3)) -o $$@ $$< --test
311
312 check-stage$(1)-T-$(2)-H-$(3)-core-dummy:                       \
313                 $(3)/test/coretest.stage$(1)-$(2)$$(X)
314         @$$(call E, run: $$<)
315         $$(Q)$$(call CFG_RUN_TEST,$$<,$(2),$(3)) $$(TESTARGS)   \
316         --logfile tmp/check-stage$(1)-T-$(2)-H-$(3)-core.log
317
318 # Rules for the standard library test runner
319
320 $(3)/test/stdtest.stage$(1)-$(2)$$(X):                  \
321                 $$(STDLIB_CRATE) $$(STDLIB_INPUTS)      \
322         $$(SREQ$(1)_T_$(2)_H_$(3))
323         @$$(call E, compile_and_link: $$@)
324         $$(STAGE$(1)_T_$(2)_H_$(3)) -o $$@ $$< --test
325
326 check-stage$(1)-T-$(2)-H-$(3)-std-dummy:                        \
327                 $(3)/test/stdtest.stage$(1)-$(2)$$(X)
328         @$$(call E, run: $$<)
329         $$(Q)$$(call CFG_RUN_TEST,$$<,$(2),$(3)) $$(TESTARGS)   \
330         --logfile tmp/check-stage$(1)-T-$(2)-H-$(3)-std.log
331
332 # Rules for the rustc test runner
333
334 $(3)/test/rustctest.stage$(1)-$(2)$$(X):                                        \
335                 $$(COMPILER_CRATE)                                                                      \
336                 $$(COMPILER_INPUTS)                                                                     \
337                 $$(SREQ$(1)_T_$(2)_H_$(3))                                                      \
338                 $$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_RUSTLLVM)
339         @$$(call E, compile_and_link: $$@)
340         $$(STAGE$(1)_T_$(2)_H_$(3)) -o $$@ $$< --test
341
342 check-stage$(1)-T-$(2)-H-$(3)-rustc-dummy:              \
343                 $(3)/test/rustctest.stage$(1)-$(2)$$(X)
344         @$$(call E, run: $$<)
345         $$(Q)$$(call CFG_RUN_TEST,$$<,$(2),$(3)) $$(TESTARGS)   \
346         --logfile tmp/check-stage$(1)-T-$(2)-H-$(3)-rustc.log
347
348 # Rules for the rustdoc test runner
349
350 $(3)/test/rustdoctest.stage$(1)-$(2)$$(X):                                      \
351                 $$(RUSTDOC_CRATE) $$(RUSTDOC_INPUTS)            \
352                 $$(TSREQ$(1)_T_$(2)_H_$(3))                                     \
353                 $$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_CORELIB)  \
354                 $$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_STDLIB)   \
355                 $$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_LIBRUSTC)
356         @$$(call E, compile_and_link: $$@)
357         $$(STAGE$(1)_T_$(2)_H_$(3)) -o $$@ $$< --test
358
359 check-stage$(1)-T-$(2)-H-$(3)-rustdoc-dummy:            \
360                 $(3)/test/rustdoctest.stage$(1)-$(2)$$(X)
361         @$$(call E, run: $$<)
362         $$(Q)$$(call CFG_RUN_TEST,$$<,$(2),$(3)) $$(TESTARGS)   \
363         --logfile tmp/check-stage$(1)-T-$(2)-H-$(3)-rustdoc.log
364
365 # Rules for the cargo test runner
366
367 $(3)/test/cargotest.stage$(1)-$(2)$$(X):                                        \
368                 $$(CARGO_CRATE) $$(CARGO_INPUTS)                \
369                 $$(TSREQ$(1)_T_$(2)_H_$(3))                                     \
370                 $$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_CORELIB)  \
371                 $$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_STDLIB)   \
372                 $$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_LIBRUSTC)
373         @$$(call E, compile_and_link: $$@)
374         $$(STAGE$(1)_T_$(2)_H_$(3)) -o $$@ $$< --test
375
376 check-stage$(1)-T-$(2)-H-$(3)-cargo-dummy:              \
377                 $(3)/test/cargotest.stage$(1)-$(2)$$(X)
378         @$$(call E, run: $$<)
379         $$(Q)$$(call CFG_RUN_TEST,$$<,$(2),$(3)) $$(TESTARGS)   \
380         --logfile tmp/check-stage$(1)-T-$(2)-H-$(3)-cargo.log
381
382 # Rules for the cfail/rfail/rpass/bench/perf test runner
383
384 CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) :=                                          \
385                 --compile-lib-path $$(HLIB$(1)_H_$(3))                          \
386         --run-lib-path $$(TLIB$(1)_T_$(2)_H_$(3))                       \
387         --rustc-path $$(HBIN$(1)_H_$(3))/rustc$$(X)                     \
388         --aux-base $$(S)src/test/auxiliary/                 \
389         --stage-id stage$(1)-$(2)                                                       \
390         --rustcflags "$$(CFG_RUSTC_FLAGS) --target=$(2)"        \
391         $$(CTEST_TESTARGS)
392
393 CFAIL_ARGS$(1)-T-$(2)-H-$(3) :=                                 \
394                 $$(CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3)) \
395         --src-base $$(S)src/test/compile-fail/  \
396         --build-base $(3)/test/compile-fail/    \
397         --mode compile-fail
398
399 RFAIL_ARGS$(1)-T-$(2)-H-$(3) :=                                 \
400                 $$(CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3)) \
401         --src-base $$(S)src/test/run-fail/              \
402         --build-base $(3)/test/run-fail/                \
403         --mode run-fail                                                 \
404         $$(CTEST_RUNTOOL)
405
406 RPASS_ARGS$(1)-T-$(2)-H-$(3) :=                         \
407                 $$(CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3)) \
408         --src-base $$(S)src/test/run-pass/              \
409         --build-base $(3)/test/run-pass/                \
410         --mode run-pass                                 \
411         $$(CTEST_RUNTOOL)
412
413 RPASS_FULL_ARGS$(1)-T-$(2)-H-$(3) :=                            \
414                 $$(CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3)) \
415         --src-base $$(S)src/test/run-pass-fulldeps/             \
416         --build-base $(3)/test/run-pass-fulldeps/               \
417         --mode run-pass                                 \
418         $$(CTEST_RUNTOOL)
419
420 BENCH_ARGS$(1)-T-$(2)-H-$(3) :=                         \
421                 $$(CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3)) \
422         --src-base $$(S)src/test/bench/                 \
423         --build-base $(3)/test/bench/                   \
424         --mode run-pass                                 \
425         $$(CTEST_RUNTOOL)
426
427 PERF_ARGS$(1)-T-$(2)-H-$(3) :=                                  \
428                 $$(CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3)) \
429         --src-base $$(S)src/test/bench/                 \
430         --build-base $(3)/test/perf/                    \
431         --mode run-pass                                                 \
432         $$(CTEST_PERF_RUNTOOL)
433
434 PRETTY_RPASS_ARGS$(1)-T-$(2)-H-$(3) :=                  \
435                 $$(CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3)) \
436         --src-base $$(S)src/test/run-pass/              \
437         --build-base $(3)/test/run-pass/                \
438         --mode pretty
439
440 PRETTY_RPASS_FULL_ARGS$(1)-T-$(2)-H-$(3) :=                     \
441                 $$(CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3)) \
442         --src-base $$(S)src/test/run-pass-fulldeps/             \
443         --build-base $(3)/test/run-pass-fulldeps/               \
444         --mode pretty
445
446 PRETTY_RFAIL_ARGS$(1)-T-$(2)-H-$(3) :=                  \
447                 $$(CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3)) \
448         --src-base $$(S)src/test/run-fail/              \
449         --build-base $(3)/test/run-fail/                \
450         --mode pretty
451
452 PRETTY_BENCH_ARGS$(1)-T-$(2)-H-$(3) :=                  \
453                 $$(CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3)) \
454         --src-base $$(S)src/test/bench/                 \
455         --build-base $(3)/test/bench/                   \
456         --mode pretty
457
458 PRETTY_PRETTY_ARGS$(1)-T-$(2)-H-$(3) :=                 \
459                 $$(CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3)) \
460         --src-base $$(S)src/test/pretty/                \
461         --build-base $(3)/test/pretty/                  \
462         --mode pretty
463
464 DOC_TUTORIAL_ARGS$(1)-T-$(2)-H-$(3) :=                  \
465                 $$(CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3)) \
466         --src-base $(3)/test/doc-tutorial/              \
467         --build-base $(3)/test/doc-tutorial/            \
468         --mode run-pass
469
470 DOC_TUTORIAL_FFI_ARGS$(1)-T-$(2)-H-$(3) :=              \
471                 $$(CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3)) \
472         --src-base $(3)/test/doc-tutorial-ffi/          \
473         --build-base $(3)/test/doc-tutorial-ffi/        \
474         --mode run-pass
475
476 DOC_TUTORIAL_MACROS_ARGS$(1)-T-$(2)-H-$(3) :=           \
477                 $$(CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3)) \
478         --src-base $(3)/test/doc-tutorial-macros/       \
479         --build-base $(3)/test/doc-tutorial-macros/     \
480         --mode run-pass
481
482 DOC_TUTORIAL_BORROWED_PTR_ARGS$(1)-T-$(2)-H-$(3) :=     \
483                 $$(CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3)) \
484         --src-base $(3)/test/doc-tutorial-borrowed-ptr/ \
485         --build-base $(3)/test/doc-tutorial-borrowed-ptr/ \
486         --mode run-pass
487
488 DOC_REF_ARGS$(1)-T-$(2)-H-$(3) :=                       \
489                 $$(CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3)) \
490         --src-base $(3)/test/doc-ref/                   \
491         --build-base $(3)/test/doc-ref/                 \
492         --mode run-pass
493
494 check-stage$(1)-T-$(2)-H-$(3)-cfail-dummy:              \
495                 $$(TEST_SREQ$(1)_T_$(2)_H_$(3))         \
496                 $$(CFAIL_TESTS)
497         @$$(call E, run cfail: $$<)
498         $$(Q)$$(call CFG_RUN_CTEST,$(1),$$<,$(3)) \
499                 $$(CFAIL_ARGS$(1)-T-$(2)-H-$(3)) \
500                 --logfile tmp/check-stage$(1)-T-$(2)-H-$(3)-cfail.log
501
502 check-stage$(1)-T-$(2)-H-$(3)-rfail-dummy:              \
503                 $$(TEST_SREQ$(1)_T_$(2)_H_$(3))         \
504                 $$(RFAIL_TESTS)
505         @$$(call E, run rfail: $$<)
506         $$(Q)$$(call CFG_RUN_CTEST,$(1),$$<,$(3)) \
507                 $$(RFAIL_ARGS$(1)-T-$(2)-H-$(3)) \
508                 --logfile tmp/check-stage$(1)-T-$(2)-H-$(3)-rfail.log
509
510 check-stage$(1)-T-$(2)-H-$(3)-rpass-dummy:              \
511                 $$(TEST_SREQ$(1)_T_$(2)_H_$(3))         \
512                 $$(RPASS_TESTS)
513         @$$(call E, run rpass-full: $$<)
514         $$(Q)$$(call CFG_RUN_CTEST,$(1),$$<,$(3)) \
515                 $$(RPASS_ARGS$(1)-T-$(2)-H-$(3)) \
516                 --logfile tmp/check-stage$(1)-T-$(2)-H-$(3)-rpass.log
517
518 check-stage$(1)-T-$(2)-H-$(3)-rpass-full-dummy:         \
519                 $$(FULL_TEST_SREQ$(1)_T_$(2)_H_$(3))            \
520                 $$(RPASS_FULL_TESTS)
521         @$$(call E, run rpass: $$<)
522         $$(Q)$$(call CFG_RUN_CTEST,$(1),$$<,$(3)) \
523                 $$(RPASS_FULL_ARGS$(1)-T-$(2)-H-$(3)) \
524                 --logfile tmp/check-stage$(1)-T-$(2)-H-$(3)-rpass-full.log
525
526 check-stage$(1)-T-$(2)-H-$(3)-bench-dummy:              \
527                 $$(TEST_SREQ$(1)_T_$(2)_H_$(3))         \
528                 $$(BENCH_TESTS)
529         @$$(call E, run bench: $$<)
530         $$(Q)$$(call CFG_RUN_CTEST,$(1),$$<,$(3)) \
531                 $$(BENCH_ARGS$(1)-T-$(2)-H-$(3)) \
532                 --logfile tmp/check-stage$(1)-T-$(2)-H-$(3)-bench.log
533
534 check-stage$(1)-T-$(2)-H-$(3)-perf-dummy:               \
535                 $$(TEST_SREQ$(1)_T_$(2)_H_$(3))         \
536                 $$(BENCH_TESTS)
537         @$$(call E, perf: $$<)
538         $$(Q)$$(call CFG_RUN_CTEST,$(1),$$<,$(3)) \
539                 $$(PERF_ARGS$(1)-T-$(2)-H-$(3)) \
540                 --logfile tmp/check-stage$(1)-T-$(2)-H-$(3)-perf.log
541
542 check-stage$(1)-T-$(2)-H-$(3)-pretty-rpass-dummy:       \
543                 $$(TEST_SREQ$(1)_T_$(2)_H_$(3))         \
544                 $$(RPASS_TESTS)
545         @$$(call E, run pretty-rpass: $$<)
546         $$(Q)$$(call CFG_RUN_CTEST,$(1),$$<,$(3)) \
547                 $$(PRETTY_RPASS_ARGS$(1)-T-$(2)-H-$(3)) \
548                 --logfile tmp/check-stage$(1)-T-$(2)-H-$(3)-pretty-rpass.log
549
550 check-stage$(1)-T-$(2)-H-$(3)-pretty-rpass-full-dummy:  \
551                 $$(FULL_TEST_SREQ$(1)_T_$(2)_H_$(3))            \
552                 $$(RPASS_FULL_TESTS)
553         @$$(call E, run pretty-rpass-full: $$<)
554         $$(Q)$$(call CFG_RUN_CTEST,$(1),$$<,$(3)) \
555                 $$(PRETTY_RPASS_FULL_ARGS$(1)-T-$(2)-H-$(3)) \
556                 --logfile tmp/check-stage$(1)-T-$(2)-H-$(3)-pretty-rpass-full.log
557
558 check-stage$(1)-T-$(2)-H-$(3)-pretty-rfail-dummy:       \
559                 $$(TEST_SREQ$(1)_T_$(2)_H_$(3))         \
560                 $$(RFAIL_TESTS)
561         @$$(call E, run pretty-rfail: $$<)
562         $$(Q)$$(call CFG_RUN_CTEST,$(1),$$<,$(3)) \
563                 $$(PRETTY_RFAIL_ARGS$(1)-T-$(2)-H-$(3)) \
564                 --logfile tmp/check-stage$(1)-T-$(2)-H-$(3)-pretty-rfail.log
565
566 check-stage$(1)-T-$(2)-H-$(3)-pretty-bench-dummy:       \
567                 $$(TEST_SREQ$(1)_T_$(2)_H_$(3))         \
568                 $$(BENCH_TESTS)
569         @$$(call E, run pretty-bench: $$<)
570         $$(Q)$$(call CFG_RUN_CTEST,$(1),$$<,$(3)) \
571                 $$(PRETTY_BENCH_ARGS$(1)-T-$(2)-H-$(3)) \
572                 --logfile tmp/check-stage$(1)-T-$(2)-H-$(3)-pretty-bench.log
573
574 check-stage$(1)-T-$(2)-H-$(3)-pretty-pretty-dummy:      \
575                 $$(TEST_SREQ$(1)_T_$(2)_H_$(3))         \
576                 $$(PRETTY_TESTS)
577         @$$(call E, run pretty-pretty: $$<)
578         $$(Q)$$(call CFG_RUN_CTEST,$(1),$$<,$(3)) \
579                 $$(PRETTY_PRETTY_ARGS$(1)-T-$(2)-H-$(3)) \
580                 --logfile tmp/check-stage$(1)-T-$(2)-H-$(3)-pretty-pretty.log
581
582 check-stage$(1)-T-$(2)-H-$(3)-doc-tutorial-dummy:       \
583                 $$(TEST_SREQ$(1)_T_$(2)_H_$(3))         \
584                 doc-tutorial-extract$(3)
585         @$$(call E, run doc-tutorial: $$<)
586         $$(Q)$$(call CFG_RUN_CTEST,$(1),$$<,$(3)) \
587                 $$(DOC_TUTORIAL_ARGS$(1)-T-$(2)-H-$(3)) \
588                 --logfile tmp/check-stage$(1)-T-$(2)-H-$(3)-doc-tutorial.log
589
590 check-stage$(1)-T-$(2)-H-$(3)-doc-tutorial-ffi-dummy:       \
591                 $$(TEST_SREQ$(1)_T_$(2)_H_$(3))         \
592                 doc-tutorial-ffi-extract$(3)
593         @$$(call E, run doc-tutorial-ffi: $$<)
594         $$(Q)$$(call CFG_RUN_CTEST,$(1),$$<,$(3)) \
595                 $$(DOC_TUTORIAL_FFI_ARGS$(1)-T-$(2)-H-$(3)) \
596                 --logfile tmp/check-stage$(1)-T-$(2)-H-$(3)-doc-tutorial-ffi.log
597
598 check-stage$(1)-T-$(2)-H-$(3)-doc-tutorial-macros-dummy:       \
599                 $$(TEST_SREQ$(1)_T_$(2)_H_$(3))         \
600                 doc-tutorial-macros-extract$(3)
601         @$$(call E, run doc-tutorial-macros: $$<)
602         $$(Q)$$(call CFG_RUN_CTEST,$(1),$$<,$(3)) \
603                 $$(DOC_TUTORIAL_MACROS_ARGS$(1)-T-$(2)-H-$(3)) \
604                 --logfile tmp/check-stage$(1)-T-$(2)-H-$(3)-doc-tutorial-macros.log
605
606 check-stage$(1)-T-$(2)-H-$(3)-doc-tutorial-borrowed-ptr-dummy:       \
607                 $$(TEST_SREQ$(1)_T_$(2)_H_$(3))         \
608                 doc-tutorial-borrowed-ptr-extract$(3)
609         @$$(call E, run doc-tutorial-borrowed-ptr: $$<)
610         $$(Q)$$(call CFG_RUN_CTEST,$(1),$$<,$(3)) \
611                 $$(DOC_TUTORIAL_BORROWED_PTR_ARGS$(1)-T-$(2)-H-$(3)) \
612                 --logfile tmp/check-stage$(1)-T-$(2)-H-$(3)-doc-tutorial-borrowed-ptr.log
613
614 check-stage$(1)-T-$(2)-H-$(3)-doc-ref-dummy:            \
615                 $$(TEST_SREQ$(1)_T_$(2)_H_$(3))         \
616                 doc-ref-extract$(3)
617         @$$(call E, run doc-ref: $$<)
618         $$(Q)$$(call CFG_RUN_CTEST,$(1),$$<,$(3)) \
619                 $$(DOC_REF_ARGS$(1)-T-$(2)-H-$(3)) \
620                 --logfile tmp/check-stage$(1)-T-$(2)-H-$(3)-doc-ref.log
621
622 endef
623
624 # Instantiate the template for stage 0, 1, 2, 3
625
626 $(foreach host,$(CFG_TARGET_TRIPLES), \
627  $(eval $(foreach target,$(CFG_TARGET_TRIPLES), \
628   $(eval $(foreach stage,$(STAGES), \
629    $(eval $(call TEST_STAGEN,$(stage),$(target),$(host))))))))
630
631 ######################################################################
632 # Fast-test rules
633 ######################################################################
634
635 GENERATED += tmp/$(FT).rc tmp/$(FT_DRIVER).rs
636
637 tmp/$(FT).rc tmp/$(FT_DRIVER).rs: \
638                 $(RPASS_TESTS) \
639                 $(S)src/etc/combine-tests.py
640         @$(call E, check: building combined stage2 test runner)
641         $(Q)$(S)src/etc/combine-tests.py
642
643 define DEF_CHECK_FAST_FOR_T_H
644 # $(1) unused
645 # $(2) target triple
646 # $(3) host triple
647
648 $$(TLIB2_T_$(2)_H_$(3))/$$(FT_LIB): \
649                 tmp/$$(FT).rc \
650                 $$(SREQ2_T_$(2)_H_$(3))
651         @$$(call E, compile_and_link: $$@)
652         $$(STAGE2_T_$(2)_H_$(3)) --lib -o $$@ $$<
653
654 $(3)/test/$$(FT_DRIVER)-$(2)$$(X): \
655                 tmp/$$(FT_DRIVER).rs \
656                 $$(TLIB2_T_$(2)_H_$(3))/$$(FT_LIB) \
657                 $$(SREQ2_T_$(2)_H_$(3))
658         @$$(call E, compile_and_link: $$@ $$<)
659         $$(STAGE2_T_$(2)_H_$(3)) -o $$@ $$<
660
661 $(3)/test/$$(FT_DRIVER)-$(2).out: \
662                 $(3)/test/$$(FT_DRIVER)-$(2)$$(X) \
663                 $$(SREQ2_T_$(2)_H_$(3))
664         $$(Q)$$(call CFG_RUN_TEST,$$<,$(2),$(3)) \
665         --logfile tmp/$$(FT_DRIVER)-$(2).log
666
667 check-fast-T-$(2)-H-$(3):                       \
668         check-stage2-T-$(2)-H-$(3)-rustc        \
669         check-stage2-T-$(2)-H-$(3)-core         \
670         check-stage2-T-$(2)-H-$(3)-std          \
671         $(3)/test/$$(FT_DRIVER)-$(2).out
672
673 endef
674
675 $(foreach host,$(CFG_TARGET_TRIPLES), \
676  $(eval $(foreach target,$(CFG_TARGET_TRIPLES), \
677    $(eval $(call DEF_CHECK_FAST_FOR_T_H,,$(target),$(host))))))
678
679 ######################################################################
680 # Shortcut rules
681 ######################################################################
682
683 define DEF_CHECK_FOR_STAGE_H
684
685 check-stage$(1)-H-$(2):                                 \
686         $$(foreach target,$$(CFG_TARGET_TRIPLES),       \
687          check-stage$(1)-T-$$(target)-H-$(2))
688 check-stage$(1)-H-$(2)-perf:                                    \
689         $$(foreach target,$$(CFG_TARGET_TRIPLES),       \
690          check-stage$(1)-T-$$(target)-H-$(2)-perf)
691 check-stage$(1)-H-$(2)-rustc:                                   \
692         $$(foreach target,$$(CFG_TARGET_TRIPLES),       \
693          check-stage$(1)-T-$$(target)-H-$(2)-rustc)
694 check-stage$(1)-H-$(2)-core:                                    \
695         $$(foreach target,$$(CFG_TARGET_TRIPLES),       \
696          check-stage$(1)-T-$$(target)-H-$(2)-core)
697 check-stage$(1)-H-$(2)-std:                                     \
698         $$(foreach target,$$(CFG_TARGET_TRIPLES),       \
699          check-stage$(1)-T-$$(target)-H-$(2)-std)
700 check-stage$(1)-H-$(2)-rpass:                                   \
701         $$(foreach target,$$(CFG_TARGET_TRIPLES),       \
702          check-stage$(1)-T-$$(target)-H-$(2)-rpass)
703 check-stage$(1)-H-$(2)-rpass-full:                                      \
704         $$(foreach target,$$(CFG_TARGET_TRIPLES),       \
705          check-stage$(1)-T-$$(target)-H-$(2)-rpass-full)
706 check-stage$(1)-H-$(2)-rfail:                                   \
707         $$(foreach target,$$(CFG_TARGET_TRIPLES),       \
708          check-stage$(1)-T-$$(target)-H-$(2)-rfail)
709 check-stage$(1)-H-$(2)-cfail:                                   \
710         $$(foreach target,$$(CFG_TARGET_TRIPLES),       \
711          check-stage$(1)-T-$$(target)-H-$(2)-cfail)
712 check-stage$(1)-H-$(2)-bench:                                   \
713         $$(foreach target,$$(CFG_TARGET_TRIPLES),       \
714          check-stage$(1)-T-$$(target)-H-$(2)-bench)
715 check-stage$(1)-H-$(2)-pretty:                                  \
716         $$(foreach target,$$(CFG_TARGET_TRIPLES),       \
717          check-stage$(1)-T-$$(target)-H-$(2)-pretty)
718 check-stage$(1)-H-$(2)-pretty-rpass:                            \
719         $$(foreach target,$$(CFG_TARGET_TRIPLES),       \
720          check-stage$(1)-T-$$(target)-H-$(2)-pretty-rpass)
721 check-stage$(1)-H-$(2)-pretty-rpass-full:                               \
722         $$(foreach target,$$(CFG_TARGET_TRIPLES),       \
723          check-stage$(1)-T-$$(target)-H-$(2)-pretty-rpass-full)
724 check-stage$(1)-H-$(2)-pretty-rfail:                            \
725         $$(foreach target,$$(CFG_TARGET_TRIPLES),       \
726          check-stage$(1)-T-$$(target)-H-$(2)-pretty-rfail)
727 check-stage$(1)-H-$(2)-pretty-bench:                            \
728         $$(foreach target,$$(CFG_TARGET_TRIPLES),       \
729          check-stage$(1)-T-$$(target)-H-$(2)-pretty-bench)
730 check-stage$(1)-H-$(2)-pretty-pretty:                           \
731         $$(foreach target,$$(CFG_TARGET_TRIPLES),       \
732          check-stage$(1)-T-$$(target)-H-$(2)-pretty-pretty)
733 check-stage$(1)-H-$(2)-rustdoc:                                 \
734         $$(foreach target,$$(CFG_TARGET_TRIPLES),       \
735          check-stage$(1)-T-$$(target)-H-$(2)-rustdoc)
736 check-stage$(1)-H-$(2)-cargo:                                   \
737         $$(foreach target,$$(CFG_TARGET_TRIPLES),       \
738          check-stage$(1)-T-$$(target)-H-$(2)-cargo)
739 check-stage$(1)-H-$(2)-doc-tutorial:                            \
740         $$(foreach target,$$(CFG_TARGET_TRIPLES),       \
741          check-stage$(1)-T-$$(target)-H-$(2)-doc-tutorial)
742 check-stage$(1)-H-$(2)-doc-tutorial-ffi:                        \
743         $$(foreach target,$$(CFG_TARGET_TRIPLES),       \
744          check-stage$(1)-T-$$(target)-H-$(2)-doc-tutorial-ffi)
745 check-stage$(1)-H-$(2)-doc-tutorial-macros:                     \
746         $$(foreach target,$$(CFG_TARGET_TRIPLES),       \
747          check-stage$(1)-T-$$(target)-H-$(2)-doc-tutorial-macros)
748 check-stage$(1)-H-$(2)-doc-tutorial-borrowed-ptr:               \
749         $$(foreach target,$$(CFG_TARGET_TRIPLES),       \
750          check-stage$(1)-T-$$(target)-H-$(2)-doc-tutorial-borrowed-ptr)
751 check-stage$(1)-H-$(2)-doc-ref:                         \
752         $$(foreach target,$$(CFG_TARGET_TRIPLES),       \
753          check-stage$(1)-T-$$(target)-H-$(2)-doc-ref)
754
755 endef
756
757 $(foreach stage,$(STAGES),                                      \
758  $(eval $(foreach target,$(CFG_TARGET_TRIPLES),                 \
759   $(eval $(call DEF_CHECK_FOR_STAGE_H,$(stage),$(target))))))
760
761 define DEF_CHECK_FAST_FOR_H
762
763 check-fast-H-$(1):              check-fast-T-$(1)-H-$(1)
764
765 endef
766
767 $(foreach target,$(CFG_TARGET_TRIPLES),                 \
768  $(eval $(call DEF_CHECK_FAST_FOR_H,$(target))))
769
770 define DEF_CHECK_ALL_FOR_STAGE
771
772 check-stage$(1)-H-all: \
773         $$(foreach target,$$(CFG_TARGET_TRIPLES),       \
774          check-stage$(1)-H-$$(target))
775 check-stage$(1)-H-all-perf: \
776         $$(foreach target,$$(CFG_TARGET_TRIPLES),       \
777          check-stage$(1)-H-$$(target)-perf)
778 check-stage$(1)-H-all-rustc: \
779         $$(foreach target,$$(CFG_TARGET_TRIPLES),       \
780          check-stage$(1)-H-$$(target)-rustc)
781 check-stage$(1)-H-all-core: \
782         $$(foreach target,$$(CFG_TARGET_TRIPLES),       \
783          check-stage$(1)-H-$$(target)-core)
784 check-stage$(1)-H-all-std: \
785         $$(foreach target,$$(CFG_TARGET_TRIPLES),       \
786          check-stage$(1)-H-$$(target)-std)
787 check-stage$(1)-H-all-rpass: \
788         $$(foreach target,$$(CFG_TARGET_TRIPLES),       \
789          check-stage$(1)-H-$$(target)-rpass)
790 check-stage$(1)-H-all-rpass-full: \
791         $$(foreach target,$$(CFG_TARGET_TRIPLES),       \
792          check-stage$(1)-H-$$(target)-rpass-full)
793 check-stage$(1)-H-all-rfail: \
794         $$(foreach target,$$(CFG_TARGET_TRIPLES),       \
795          check-stage$(1)-H-$$(target)-rfail)
796 check-stage$(1)-H-all-cfail: \
797         $$(foreach target,$$(CFG_TARGET_TRIPLES),       \
798          check-stage$(1)-H-$$(target)-cfail)
799 check-stage$(1)-H-all-bench: \
800         $$(foreach target,$$(CFG_TARGET_TRIPLES),       \
801          check-stage$(1)-H-$$(target)-bench)
802 check-stage$(1)-H-all-pretty: \
803         $$(foreach target,$$(CFG_TARGET_TRIPLES),       \
804          check-stage$(1)-H-$$(target)-pretty)
805 check-stage$(1)-H-all-pretty-rpass: \
806         $$(foreach target,$$(CFG_TARGET_TRIPLES),       \
807          check-stage$(1)-H-$$(target)-pretty-rpass)
808 check-stage$(1)-H-all-pretty-rpass-full: \
809         $$(foreach target,$$(CFG_TARGET_TRIPLES),       \
810          check-stage$(1)-H-$$(target)-pretty-rpass-full)
811 check-stage$(1)-H-all-pretty-rfail: \
812         $$(foreach target,$$(CFG_TARGET_TRIPLES),       \
813          check-stage$(1)-H-$$(target)-pretty-rfail)
814 check-stage$(1)-H-all-pretty-bench: \
815         $$(foreach target,$$(CFG_TARGET_TRIPLES),       \
816          check-stage$(1)-H-$$(target)-pretty-bench)
817 check-stage$(1)-H-all-pretty-pretty: \
818         $$(foreach target,$$(CFG_TARGET_TRIPLES),       \
819          check-stage$(1)-H-$$(target)-pretty-pretty)
820 check-stage$(1)-H-all-rustdoc: \
821         $$(foreach target,$$(CFG_TARGET_TRIPLES),       \
822          check-stage$(1)-H-$$(target)-rustdoc)
823 check-stage$(1)-H-all-cargo: \
824         $$(foreach target,$$(CFG_TARGET_TRIPLES),       \
825          check-stage$(1)-H-$$(target)-cargo)
826 check-stage$(1)-H-all-doc-tutorial: \
827         $$(foreach target,$$(CFG_TARGET_TRIPLES),       \
828          check-stage$(1)-H-$$(target)-doc-tutorial)
829 check-stage$(1)-H-all-doc-ref: \
830         $$(foreach target,$$(CFG_TARGET_TRIPLES),       \
831          check-stage$(1)-H-$$(target)-doc-ref)
832
833 endef
834
835 $(foreach stage,$(STAGES),                                              \
836  $(eval $(call DEF_CHECK_ALL_FOR_STAGE,$(stage))))
837
838 define DEF_CHECK_FOR_STAGE
839
840 check-stage$(1): check-stage$(1)-H-$$(CFG_HOST_TRIPLE)
841 check-stage$(1)-perf: check-stage$(1)-H-$$(CFG_HOST_TRIPLE)-perf
842 check-stage$(1)-rustc: check-stage$(1)-H-$$(CFG_HOST_TRIPLE)-rustc
843 check-stage$(1)-core: check-stage$(1)-H-$$(CFG_HOST_TRIPLE)-core
844 check-stage$(1)-std: check-stage$(1)-H-$$(CFG_HOST_TRIPLE)-std
845 check-stage$(1)-rpass: check-stage$(1)-H-$$(CFG_HOST_TRIPLE)-rpass
846 check-stage$(1)-rpass-full: check-stage$(1)-H-$$(CFG_HOST_TRIPLE)-rpass-full
847 check-stage$(1)-rfail: check-stage$(1)-H-$$(CFG_HOST_TRIPLE)-rfail
848 check-stage$(1)-cfail: check-stage$(1)-H-$$(CFG_HOST_TRIPLE)-cfail
849 check-stage$(1)-bench: check-stage$(1)-H-$$(CFG_HOST_TRIPLE)-bench
850 check-stage$(1)-pretty: check-stage$(1)-H-$$(CFG_HOST_TRIPLE)-pretty
851 check-stage$(1)-pretty-rpass: check-stage$(1)-H-$$(CFG_HOST_TRIPLE)-pretty-rpass
852 check-stage$(1)-pretty-rpass-full: check-stage$(1)-H-$$(CFG_HOST_TRIPLE)-pretty-rpass-full
853 check-stage$(1)-pretty-rfail: check-stage$(1)-H-$$(CFG_HOST_TRIPLE)-pretty-rfail
854 check-stage$(1)-pretty-bench: check-stage$(1)-H-$$(CFG_HOST_TRIPLE)-pretty-bench
855 check-stage$(1)-pretty-pretty: check-stage$(1)-H-$$(CFG_HOST_TRIPLE)-pretty-pretty
856 check-stage$(1)-rustdoc: check-stage$(1)-H-$$(CFG_HOST_TRIPLE)-rustdoc
857 check-stage$(1)-cargo: check-stage$(1)-H-$$(CFG_HOST_TRIPLE)-cargo
858 check-stage$(1)-doc-tutorial: check-stage$(1)-H-$$(CFG_HOST_TRIPLE)-doc-tutorial
859 check-stage$(1)-doc-tutorial-ffi: check-stage$(1)-H-$$(CFG_HOST_TRIPLE)-doc-tutorial-ffi
860 check-stage$(1)-doc-tutorial-macros: check-stage$(1)-H-$$(CFG_HOST_TRIPLE)-doc-tutorial-macros
861 check-stage$(1)-doc-tutorial-borrowed-ptr: check-stage$(1)-H-$$(CFG_HOST_TRIPLE)-doc-tutorial-borrowed-ptr
862 check-stage$(1)-doc-ref: check-stage$(1)-H-$$(CFG_HOST_TRIPLE)-doc-ref
863
864 endef
865
866 $(foreach stage,$(STAGES),                                              \
867  $(eval $(call DEF_CHECK_FOR_STAGE,$(stage))))
868
869 check-fast: tidy check-fast-H-$(CFG_HOST_TRIPLE)