1 ######################################################################
3 ######################################################################
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)
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)
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)
29 FT_LIB := $(call CFG_LIB_NAME,$(FT))
30 FT_DRIVER := $(FT)_driver
32 # The arguments to all test runners
34 TESTARGS += $(TESTNAME)
41 # Arguments to the cfail/rfail/rpass/bench tests
43 CTEST_RUNTOOL = --runtool "$(CFG_VALGRIND)"
46 # Arguments to the perf tests
48 CTEST_PERF_RUNTOOL = --runtool "$(CFG_PERF_TOOL)"
51 CTEST_TESTARGS := $(TESTARGS)
54 CTEST_TESTARGS += --verbose
57 # Run the compiletest runner itself under valgrind
59 CFG_RUN_CTEST=$(call CFG_RUN_TEST,$(2),$(3))
61 CFG_RUN_CTEST=$(call CFG_RUN,$(TLIB$(1)_T_$(3)_H_$(3)),$(2))
64 # If we're running perf then set this environment variable
65 # to put the benchmarks into 'hard mode'
66 ifeq ($(MAKECMDGOALS),perf)
72 ######################################################################
74 ######################################################################
76 .PHONY: cleantmptestlogs cleantestlibs
82 $(Q)find $(CFG_HOST_TRIPLE)/test \
83 -name '*.[odasS]' -o \
95 check: cleantestlibs cleantmptestlogs tidy all check-stage2
96 $(Q)$(S)src/etc/check-summary.py tmp/*.log
98 check-notidy: cleantestlibs cleantmptestlogs all check-stage2
99 $(Q)$(S)src/etc/check-summary.py tmp/*.log
101 check-full: cleantestlibs cleantmptestlogs tidy \
102 all check-stage1 check-stage2 check-stage3
103 $(Q)$(S)src/etc/check-summary.py tmp/*.log
105 check-test: cleantestlibs cleantmptestlogs all check-stage2-rfail
106 $(Q)$(S)src/etc/check-summary.py tmp/*.log
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
113 # Run the tidy script in multiple parts to avoid huge 'echo' commands
118 ALL_CS := $(wildcard $(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 \
126 ALL_HS := $(wildcard $(S)src/rt/*.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 \
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
148 | xargs -n 10 python $(S)src/etc/tidy.py
150 | xargs -n 10 python $(S)src/etc/tidy.py
154 ######################################################################
155 # Extracting tests for docs
156 ######################################################################
158 EXTRACT_TESTS := "$(CFG_PYTHON)" $(S)src/etc/extract-tests.py
160 define DEF_DOC_TEST_HOST
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
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
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
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
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
189 $(foreach host,$(CFG_TARGET_TRIPLES), \
190 $(eval $(call DEF_DOC_TEST_HOST,$(host))))
192 ######################################################################
193 # Rules for the test runners
194 ######################################################################
198 # All the per-stage build rules you might want to call from the
201 # $(1) is the stage number
202 # $(2) is the target triple to test
203 # $(3) is the host triple to test
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))
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))
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
234 check-stage$(1)-T-$(2)-H-$(3)-core: \
235 check-stage$(1)-T-$(2)-H-$(3)-core-dummy
237 check-stage$(1)-T-$(2)-H-$(3)-std: \
238 check-stage$(1)-T-$(2)-H-$(3)-std-dummy
240 check-stage$(1)-T-$(2)-H-$(3)-rustc: \
241 check-stage$(1)-T-$(2)-H-$(3)-rustc-dummy
243 check-stage$(1)-T-$(2)-H-$(3)-cfail: \
244 check-stage$(1)-T-$(2)-H-$(3)-cfail-dummy
246 check-stage$(1)-T-$(2)-H-$(3)-rfail: \
247 check-stage$(1)-T-$(2)-H-$(3)-rfail-dummy
249 check-stage$(1)-T-$(2)-H-$(3)-rpass: \
250 check-stage$(1)-T-$(2)-H-$(3)-rpass-dummy
252 check-stage$(1)-T-$(2)-H-$(3)-rpass-full: \
253 check-stage$(1)-T-$(2)-H-$(3)-rpass-full-dummy
255 check-stage$(1)-T-$(2)-H-$(3)-bench: \
256 check-stage$(1)-T-$(2)-H-$(3)-bench-dummy
258 check-stage$(1)-T-$(2)-H-$(3)-perf: \
259 check-stage$(1)-T-$(2)-H-$(3)-perf-dummy
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
268 check-stage$(1)-T-$(2)-H-$(3)-pretty-rpass: \
269 check-stage$(1)-T-$(2)-H-$(3)-pretty-rpass-dummy
271 check-stage$(1)-T-$(2)-H-$(3)-pretty-rpass-full: \
272 check-stage$(1)-T-$(2)-H-$(3)-pretty-rpass-full-dummy
274 check-stage$(1)-T-$(2)-H-$(3)-pretty-rfail: \
275 check-stage$(1)-T-$(2)-H-$(3)-pretty-rfail-dummy
277 check-stage$(1)-T-$(2)-H-$(3)-pretty-bench: \
278 check-stage$(1)-T-$(2)-H-$(3)-pretty-bench-dummy
280 check-stage$(1)-T-$(2)-H-$(3)-pretty-pretty: \
281 check-stage$(1)-T-$(2)-H-$(3)-pretty-pretty-dummy
283 check-stage$(1)-T-$(2)-H-$(3)-rustdoc: \
284 check-stage$(1)-T-$(2)-H-$(3)-rustdoc-dummy
286 check-stage$(1)-T-$(2)-H-$(3)-cargo: \
287 check-stage$(1)-T-$(2)-H-$(3)-cargo-dummy
289 check-stage$(1)-T-$(2)-H-$(3)-doc-tutorial: \
290 check-stage$(1)-T-$(2)-H-$(3)-doc-tutorial-dummy
292 check-stage$(1)-T-$(2)-H-$(3)-doc-tutorial-ffi: \
293 check-stage$(1)-T-$(2)-H-$(3)-doc-tutorial-ffi-dummy
295 check-stage$(1)-T-$(2)-H-$(3)-doc-tutorial-macros: \
296 check-stage$(1)-T-$(2)-H-$(3)-doc-tutorial-macros-dummy
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
301 check-stage$(1)-T-$(2)-H-$(3)-doc-ref: \
302 check-stage$(1)-T-$(2)-H-$(3)-doc-ref-dummy
304 # Rules for the core library test runner
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
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
318 # Rules for the standard library test runner
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
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
332 # Rules for the rustc test runner
334 $(3)/test/rustctest.stage$(1)-$(2)$$(X): \
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
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
348 # Rules for the rustdoc test runner
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
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
365 # Rules for the cargo test runner
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
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
382 # Rules for the cfail/rfail/rpass/bench/perf test runner
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)" \
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/ \
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/ \
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/ \
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/ \
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/ \
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/ \
432 $$(CTEST_PERF_RUNTOOL)
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/ \
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/ \
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/ \
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/ \
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/ \
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/ \
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/ \
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/ \
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/ \
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/ \
494 check-stage$(1)-T-$(2)-H-$(3)-cfail-dummy: \
495 $$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
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
502 check-stage$(1)-T-$(2)-H-$(3)-rfail-dummy: \
503 $$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
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
510 check-stage$(1)-T-$(2)-H-$(3)-rpass-dummy: \
511 $$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
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
518 check-stage$(1)-T-$(2)-H-$(3)-rpass-full-dummy: \
519 $$(FULL_TEST_SREQ$(1)_T_$(2)_H_$(3)) \
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
526 check-stage$(1)-T-$(2)-H-$(3)-bench-dummy: \
527 $$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
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
534 check-stage$(1)-T-$(2)-H-$(3)-perf-dummy: \
535 $$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
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
542 check-stage$(1)-T-$(2)-H-$(3)-pretty-rpass-dummy: \
543 $$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
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
550 check-stage$(1)-T-$(2)-H-$(3)-pretty-rpass-full-dummy: \
551 $$(FULL_TEST_SREQ$(1)_T_$(2)_H_$(3)) \
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
558 check-stage$(1)-T-$(2)-H-$(3)-pretty-rfail-dummy: \
559 $$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
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
566 check-stage$(1)-T-$(2)-H-$(3)-pretty-bench-dummy: \
567 $$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
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
574 check-stage$(1)-T-$(2)-H-$(3)-pretty-pretty-dummy: \
575 $$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
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
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
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
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
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
614 check-stage$(1)-T-$(2)-H-$(3)-doc-ref-dummy: \
615 $$(TEST_SREQ$(1)_T_$(2)_H_$(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
624 # Instantiate the template for stage 0, 1, 2, 3
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))))))))
631 ######################################################################
633 ######################################################################
635 GENERATED += tmp/$(FT).rc tmp/$(FT_DRIVER).rs
637 tmp/$(FT).rc tmp/$(FT_DRIVER).rs: \
639 $(S)src/etc/combine-tests.py
640 @$(call E, check: building combined stage2 test runner)
641 $(Q)$(S)src/etc/combine-tests.py
643 define DEF_CHECK_FAST_FOR_T_H
648 $$(TLIB2_T_$(2)_H_$(3))/$$(FT_LIB): \
650 $$(SREQ2_T_$(2)_H_$(3))
651 @$$(call E, compile_and_link: $$@)
652 $$(STAGE2_T_$(2)_H_$(3)) --lib -o $$@ $$<
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 $$@ $$<
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
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
675 $(foreach host,$(CFG_TARGET_TRIPLES), \
676 $(eval $(foreach target,$(CFG_TARGET_TRIPLES), \
677 $(eval $(call DEF_CHECK_FAST_FOR_T_H,,$(target),$(host))))))
679 ######################################################################
681 ######################################################################
683 define DEF_CHECK_FOR_STAGE_H
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)
757 $(foreach stage,$(STAGES), \
758 $(eval $(foreach target,$(CFG_TARGET_TRIPLES), \
759 $(eval $(call DEF_CHECK_FOR_STAGE_H,$(stage),$(target))))))
761 define DEF_CHECK_FAST_FOR_H
763 check-fast-H-$(1): check-fast-T-$(1)-H-$(1)
767 $(foreach target,$(CFG_TARGET_TRIPLES), \
768 $(eval $(call DEF_CHECK_FAST_FOR_H,$(target))))
770 define DEF_CHECK_ALL_FOR_STAGE
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)
835 $(foreach stage,$(STAGES), \
836 $(eval $(call DEF_CHECK_ALL_FOR_STAGE,$(stage))))
838 define DEF_CHECK_FOR_STAGE
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
866 $(foreach stage,$(STAGES), \
867 $(eval $(call DEF_CHECK_FOR_STAGE,$(stage))))
869 check-fast: tidy check-fast-H-$(CFG_HOST_TRIPLE)