PageRenderTime 71ms CodeModel.GetById 30ms RepoModel.GetById 1ms app.codeStats 0ms

/mk/tests.mk

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