PageRenderTime 55ms CodeModel.GetById 28ms RepoModel.GetById 1ms app.codeStats 0ms

/mk/tests.mk

https://github.com/veddan/rust
Makefile | 920 lines | 662 code | 176 blank | 82 comment | 7 complexity | dcbf8eb115cca982349e79b061bf6f07 MD5 | raw file
Possible License(s): JSON, Apache-2.0, MIT, AGPL-1.0
  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. # Test variables
  12. ######################################################################
  13. # The names of crates that must be tested
  14. TEST_TARGET_CRATES = $(TARGET_CRATES)
  15. TEST_DOC_CRATES = $(DOC_CRATES)
  16. TEST_HOST_CRATES = $(HOST_CRATES)
  17. TEST_CRATES = $(TEST_TARGET_CRATES) $(TEST_HOST_CRATES)
  18. # Markdown files under doc/ that should have their code extracted and run
  19. DOC_TEST_NAMES = tutorial guide-ffi guide-macros guide-lifetimes \
  20. guide-tasks guide-container guide-pointers \
  21. complement-cheatsheet guide-runtime \
  22. rust
  23. ######################################################################
  24. # Environment configuration
  25. ######################################################################
  26. # The arguments to all test runners
  27. ifdef TESTNAME
  28. TESTARGS += $(TESTNAME)
  29. endif
  30. ifdef CHECK_XFAILS
  31. TESTARGS += --ignored
  32. endif
  33. TEST_BENCH = --bench
  34. # Arguments to the cfail/rfail/rpass/bench tests
  35. ifdef CFG_VALGRIND
  36. CTEST_RUNTOOL = --runtool "$(CFG_VALGRIND)"
  37. TEST_BENCH =
  38. endif
  39. ifdef NO_BENCH
  40. TEST_BENCH =
  41. endif
  42. # Arguments to the perf tests
  43. ifdef CFG_PERF_TOOL
  44. CTEST_PERF_RUNTOOL = --runtool "$(CFG_PERF_TOOL)"
  45. endif
  46. CTEST_TESTARGS := $(TESTARGS)
  47. ifdef VERBOSE
  48. CTEST_TESTARGS += --verbose
  49. endif
  50. # If we're running perf then set this environment variable
  51. # to put the benchmarks into 'hard mode'
  52. ifeq ($(MAKECMDGOALS),perf)
  53. RUST_BENCH=1
  54. export RUST_BENCH
  55. endif
  56. TEST_LOG_FILE=tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).log
  57. TEST_OK_FILE=tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).ok
  58. TEST_RATCHET_FILE=tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4)-metrics.json
  59. TEST_RATCHET_NOISE_PERCENT=10.0
  60. # Whether to ratchet or merely save benchmarks
  61. ifdef CFG_RATCHET_BENCH
  62. CRATE_TEST_EXTRA_ARGS=\
  63. --test $(TEST_BENCH) \
  64. --ratchet-metrics $(call TEST_RATCHET_FILE,$(1),$(2),$(3),$(4)) \
  65. --ratchet-noise-percent $(TEST_RATCHET_NOISE_PERCENT)
  66. else
  67. CRATE_TEST_EXTRA_ARGS=\
  68. --test $(TEST_BENCH) \
  69. --save-metrics $(call TEST_RATCHET_FILE,$(1),$(2),$(3),$(4))
  70. endif
  71. # If we're sharding the testsuite between parallel testers,
  72. # pass this argument along to the compiletest and crate test
  73. # invocations.
  74. ifdef TEST_SHARD
  75. CTEST_TESTARGS += --test-shard=$(TEST_SHARD)
  76. CRATE_TEST_EXTRA_ARGS += --test-shard=$(TEST_SHARD)
  77. endif
  78. define DEF_TARGET_COMMANDS
  79. ifdef CFG_UNIXY_$(1)
  80. CFG_RUN_TEST_$(1)=$$(call CFG_RUN_$(1),,$$(CFG_VALGRIND) $$(1))
  81. endif
  82. ifdef CFG_WINDOWSY_$(1)
  83. CFG_TESTLIB_$(1)=$$(CFG_BUILD_DIR)$$(2)/$$(strip \
  84. $$(if $$(findstring stage0,$$(1)), \
  85. stage0/$$(CFG_LIBDIR_RELATIVE), \
  86. $$(if $$(findstring stage1,$$(1)), \
  87. stage1/$$(CFG_LIBDIR_RELATIVE), \
  88. $$(if $$(findstring stage2,$$(1)), \
  89. stage2/$$(CFG_LIBDIR_RELATIVE), \
  90. $$(if $$(findstring stage3,$$(1)), \
  91. stage3/$$(CFG_LIBDIR_RELATIVE), \
  92. )))))/$$(CFG_RUSTLIBDIR)/$$(CFG_BUILD)/lib
  93. CFG_RUN_TEST_$(1)=$$(call CFG_RUN_$(1),$$(call CFG_TESTLIB_$(1),$$(1),$$(3)),$$(1))
  94. endif
  95. # Run the compiletest runner itself under valgrind
  96. ifdef CTEST_VALGRIND
  97. CFG_RUN_CTEST_$(1)=$$(RPATH_VAR$$(1)_T_$$(3)_H_$$(3)) \
  98. $$(call CFG_RUN_TEST_$$(CFG_BUILD),$$(2),$$(3))
  99. else
  100. CFG_RUN_CTEST_$(1)=$$(RPATH_VAR$$(1)_T_$$(3)_H_$$(3)) \
  101. $$(call CFG_RUN_$$(CFG_BUILD),$$(TLIB$$(1)_T_$$(3)_H_$$(3)),$$(2))
  102. endif
  103. endef
  104. $(foreach target,$(CFG_TARGET), \
  105. $(eval $(call DEF_TARGET_COMMANDS,$(target))))
  106. # Target platform specific variables
  107. # for arm-linux-androidabi
  108. define DEF_ADB_DEVICE_STATUS
  109. CFG_ADB_DEVICE_STATUS=$(1)
  110. endef
  111. $(foreach target,$(CFG_TARGET), \
  112. $(if $(findstring $(target),"arm-linux-androideabi"), \
  113. $(if $(findstring adb,$(CFG_ADB)), \
  114. $(if $(findstring device,$(shell $(CFG_ADB) devices 2>/dev/null | grep -E '^[:_A-Za-z0-9-]+[[:blank:]]+device')), \
  115. $(info check: android device attached) \
  116. $(eval $(call DEF_ADB_DEVICE_STATUS, true)), \
  117. $(info check: android device not attached) \
  118. $(eval $(call DEF_ADB_DEVICE_STATUS, false)) \
  119. ), \
  120. $(info check: adb not found) \
  121. $(eval $(call DEF_ADB_DEVICE_STATUS, false)) \
  122. ), \
  123. ) \
  124. )
  125. ifeq ($(CFG_ADB_DEVICE_STATUS),true)
  126. CFG_ADB_TEST_DIR=/data/tmp
  127. $(info check: android device test dir $(CFG_ADB_TEST_DIR) ready \
  128. $(shell $(CFG_ADB) remount 1>/dev/null) \
  129. $(shell $(CFG_ADB) shell rm -r $(CFG_ADB_TEST_DIR) >/dev/null) \
  130. $(shell $(CFG_ADB) shell mkdir $(CFG_ADB_TEST_DIR)) \
  131. $(shell $(CFG_ADB) shell mkdir $(CFG_ADB_TEST_DIR)/tmp) \
  132. $(shell $(CFG_ADB) push $(S)src/etc/adb_run_wrapper.sh $(CFG_ADB_TEST_DIR) 1>/dev/null) \
  133. $(foreach crate,$(TARGET_CRATES),\
  134. $(shell $(CFG_ADB) push $(TLIB2_T_arm-linux-androideabi_H_$(CFG_BUILD))/$(call CFG_LIB_GLOB_arm-linux-androideabi,$(crate)) \
  135. $(CFG_ADB_TEST_DIR)))\
  136. )
  137. else
  138. CFG_ADB_TEST_DIR=
  139. endif
  140. ######################################################################
  141. # Main test targets
  142. ######################################################################
  143. check: cleantestlibs cleantmptestlogs tidy all check-stage2
  144. $(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
  145. check-notidy: cleantestlibs cleantmptestlogs all check-stage2
  146. $(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
  147. check-full: cleantestlibs cleantmptestlogs tidy \
  148. all check-stage1 check-stage2 check-stage3
  149. $(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
  150. check-test: cleantestlibs cleantmptestlogs all check-stage2-rfail
  151. $(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
  152. check-lite: cleantestlibs cleantmptestlogs \
  153. $(foreach crate,$(TARGET_CRATES),check-stage2-$(crate)) \
  154. check-stage2-rpass \
  155. check-stage2-rfail check-stage2-cfail check-stage2-rmake
  156. $(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
  157. .PHONY: cleantmptestlogs cleantestlibs
  158. cleantmptestlogs:
  159. $(Q)rm -f tmp/*.log
  160. cleantestlibs:
  161. $(Q)find $(CFG_BUILD)/test \
  162. -name '*.[odasS]' -o \
  163. -name '*.so' -o \
  164. -name '*.dylib' -o \
  165. -name '*.dll' -o \
  166. -name '*.def' -o \
  167. -name '*.bc' -o \
  168. -name '*.dSYM' -o \
  169. -name '*.libaux' -o \
  170. -name '*.out' -o \
  171. -name '*.err' -o \
  172. -name '*.debugger.script' \
  173. | xargs rm -rf
  174. ######################################################################
  175. # Tidy
  176. ######################################################################
  177. ifdef CFG_NOTIDY
  178. tidy:
  179. else
  180. ALL_CS := $(wildcard $(S)src/rt/*.cpp \
  181. $(S)src/rt/*/*.cpp \
  182. $(S)src/rt/*/*/*.cpp \
  183. $(S)src/rustllvm/*.cpp)
  184. ALL_CS := $(filter-out $(S)src/rt/miniz.cpp \
  185. $(wildcard $(S)src/rt/sundown/src/*.c) \
  186. $(wildcard $(S)src/rt/sundown/html/*.c) \
  187. ,$(ALL_CS))
  188. ALL_HS := $(wildcard $(S)src/rt/*.h \
  189. $(S)src/rt/*/*.h \
  190. $(S)src/rt/*/*/*.h \
  191. $(S)src/rustllvm/*.h)
  192. ALL_HS := $(filter-out $(S)src/rt/vg/valgrind.h \
  193. $(S)src/rt/vg/memcheck.h \
  194. $(S)src/rt/msvc/typeof.h \
  195. $(S)src/rt/msvc/stdint.h \
  196. $(S)src/rt/msvc/inttypes.h \
  197. $(wildcard $(S)src/rt/sundown/src/*.h) \
  198. $(wildcard $(S)src/rt/sundown/html/*.h) \
  199. ,$(ALL_HS))
  200. # Run the tidy script in multiple parts to avoid huge 'echo' commands
  201. tidy:
  202. @$(call E, check: formatting)
  203. $(Q)find $(S)src -name '*.r[sc]' \
  204. | grep '^$(S)src/libuv' -v \
  205. | grep '^$(S)src/llvm' -v \
  206. | grep '^$(S)src/gyp' -v \
  207. | xargs -n 10 $(CFG_PYTHON) $(S)src/etc/tidy.py
  208. $(Q)find $(S)src/etc -name '*.py' \
  209. | xargs -n 10 $(CFG_PYTHON) $(S)src/etc/tidy.py
  210. $(Q)echo $(ALL_CS) \
  211. | xargs -n 10 $(CFG_PYTHON) $(S)src/etc/tidy.py
  212. $(Q)echo $(ALL_HS) \
  213. | xargs -n 10 $(CFG_PYTHON) $(S)src/etc/tidy.py
  214. $(Q)find $(S)src -type f -perm +111 \
  215. -not -name '*.rs' -and -not -name '*.py' \
  216. -and -not -name '*.sh' \
  217. | grep '^$(S)src/llvm' -v \
  218. | grep '^$(S)src/libuv' -v \
  219. | grep '^$(S)src/gyp' -v \
  220. | grep '^$(S)src/etc' -v \
  221. | grep '^$(S)src/doc' -v \
  222. | xargs $(CFG_PYTHON) $(S)src/etc/check-binaries.py
  223. endif
  224. ######################################################################
  225. # Sets of tests
  226. ######################################################################
  227. define DEF_TEST_SETS
  228. check-stage$(1)-T-$(2)-H-$(3)-exec: \
  229. check-stage$(1)-T-$(2)-H-$(3)-rpass-exec \
  230. check-stage$(1)-T-$(2)-H-$(3)-rfail-exec \
  231. check-stage$(1)-T-$(2)-H-$(3)-cfail-exec \
  232. check-stage$(1)-T-$(2)-H-$(3)-rpass-full-exec \
  233. check-stage$(1)-T-$(2)-H-$(3)-rmake-exec \
  234. check-stage$(1)-T-$(2)-H-$(3)-crates-exec \
  235. check-stage$(1)-T-$(2)-H-$(3)-doc-crates-exec \
  236. check-stage$(1)-T-$(2)-H-$(3)-bench-exec \
  237. check-stage$(1)-T-$(2)-H-$(3)-debuginfo-exec \
  238. check-stage$(1)-T-$(2)-H-$(3)-codegen-exec \
  239. check-stage$(1)-T-$(2)-H-$(3)-doc-exec \
  240. check-stage$(1)-T-$(2)-H-$(3)-pretty-exec
  241. # Only test the compiler-dependent crates when the target is
  242. # able to build a compiler (when the target triple is in the set of host triples)
  243. ifneq ($$(findstring $(2),$$(CFG_HOST)),)
  244. check-stage$(1)-T-$(2)-H-$(3)-crates-exec: \
  245. $$(foreach crate,$$(TEST_CRATES), \
  246. check-stage$(1)-T-$(2)-H-$(3)-$$(crate)-exec)
  247. else
  248. check-stage$(1)-T-$(2)-H-$(3)-crates-exec: \
  249. $$(foreach crate,$$(TEST_TARGET_CRATES), \
  250. check-stage$(1)-T-$(2)-H-$(3)-$$(crate)-exec)
  251. endif
  252. check-stage$(1)-T-$(2)-H-$(3)-doc-crates-exec: \
  253. $$(foreach crate,$$(TEST_DOC_CRATES), \
  254. check-stage$(1)-T-$(2)-H-$(3)-doc-$$(crate)-exec)
  255. check-stage$(1)-T-$(2)-H-$(3)-doc-exec: \
  256. $$(foreach docname,$$(DOC_TEST_NAMES), \
  257. check-stage$(1)-T-$(2)-H-$(3)-doc-$$(docname)-exec)
  258. check-stage$(1)-T-$(2)-H-$(3)-pretty-exec: \
  259. check-stage$(1)-T-$(2)-H-$(3)-pretty-rpass-exec \
  260. check-stage$(1)-T-$(2)-H-$(3)-pretty-rpass-full-exec \
  261. check-stage$(1)-T-$(2)-H-$(3)-pretty-rfail-exec \
  262. check-stage$(1)-T-$(2)-H-$(3)-pretty-bench-exec \
  263. check-stage$(1)-T-$(2)-H-$(3)-pretty-pretty-exec
  264. endef
  265. $(foreach host,$(CFG_HOST), \
  266. $(foreach target,$(CFG_TARGET), \
  267. $(foreach stage,$(STAGES), \
  268. $(eval $(call DEF_TEST_SETS,$(stage),$(target),$(host))))))
  269. ######################################################################
  270. # Crate testing
  271. ######################################################################
  272. define TEST_RUNNER
  273. # If NO_REBUILD is set then break the dependencies on extra so we can
  274. # test crates without rebuilding std and extra first
  275. ifeq ($(NO_REBUILD),)
  276. STDTESTDEP_$(1)_$(2)_$(3)_$(4) = $$(SREQ$(1)_T_$(2)_H_$(3)) \
  277. $$(foreach crate,$$(TARGET_CRATES),\
  278. $$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$$(crate))
  279. else
  280. STDTESTDEP_$(1)_$(2)_$(3)_$(4) =
  281. endif
  282. $(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2)): CFG_COMPILER = $(2)
  283. $(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2)): \
  284. $$(CRATEFILE_$(4)) \
  285. $$(CRATE_FULLDEPS_$(1)_T_$(2)_H_$(3)_$(4)) \
  286. $$(STDTESTDEP_$(1)_$(2)_$(3)_$(4))
  287. @$$(call E, oxidize: $$@)
  288. $$(STAGE$(1)_T_$(2)_H_$(3)) -o $$@ $$< --test \
  289. -L "$$(RT_OUTPUT_DIR_$(2))" \
  290. -L "$$(LLVM_LIBDIR_$(2))"
  291. endef
  292. $(foreach host,$(CFG_HOST), \
  293. $(eval $(foreach target,$(CFG_TARGET), \
  294. $(eval $(foreach stage,$(STAGES), \
  295. $(eval $(foreach crate,$(TEST_CRATES), \
  296. $(eval $(call TEST_RUNNER,$(stage),$(target),$(host),$(crate))))))))))
  297. define DEF_TEST_CRATE_RULES
  298. check-stage$(1)-T-$(2)-H-$(3)-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4))
  299. check-stage$(1)-T-$(2)-H-$(3)-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4))
  300. $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
  301. $(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2))
  302. @$$(call E, run: $$<)
  303. $$(Q)$$(call CFG_RUN_TEST_$(2),$$<,$(2),$(3)) $$(TESTARGS) \
  304. --logfile $$(call TEST_LOG_FILE,$(1),$(2),$(3),$(4)) \
  305. $$(call CRATE_TEST_EXTRA_ARGS,$(1),$(2),$(3),$(4)) \
  306. && touch $$@
  307. endef
  308. define DEF_TEST_CRATE_RULES_arm-linux-androideabi
  309. check-stage$(1)-T-$(2)-H-$(3)-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4))
  310. $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
  311. $(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2))
  312. @$$(call E, run: $$< via adb)
  313. $$(Q)$(CFG_ADB) push $$< $(CFG_ADB_TEST_DIR)
  314. $$(Q)$(CFG_ADB) shell '(cd $(CFG_ADB_TEST_DIR); LD_LIBRARY_PATH=. \
  315. ./$$(notdir $$<) \
  316. --logfile $(CFG_ADB_TEST_DIR)/check-stage$(1)-T-$(2)-H-$(3)-$(4).log \
  317. $$(call CRATE_TEST_EXTRA_ARGS,$(1),$(2),$(3),$(4)) $(TESTARGS))' \
  318. > tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).tmp
  319. $$(Q)cat tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).tmp
  320. $$(Q)touch tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).log
  321. $$(Q)$(CFG_ADB) pull $(CFG_ADB_TEST_DIR)/check-stage$(1)-T-$(2)-H-$(3)-$(4).log tmp/
  322. $$(Q)$(CFG_ADB) shell rm $(CFG_ADB_TEST_DIR)/check-stage$(1)-T-$(2)-H-$(3)-$(4).log
  323. $$(Q)$(CFG_ADB) pull $(CFG_ADB_TEST_DIR)/$$(call TEST_RATCHET_FILE,$(1),$(2),$(3),$(4)) tmp/
  324. @if grep -q "result: ok" tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).tmp; \
  325. then \
  326. rm tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).tmp; \
  327. touch $$@; \
  328. else \
  329. rm tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).tmp; \
  330. exit 101; \
  331. fi
  332. endef
  333. define DEF_TEST_CRATE_RULES_null
  334. check-stage$(1)-T-$(2)-H-$(3)-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4))
  335. $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
  336. $(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2))
  337. @$$(call E, failing: no device for $$< )
  338. false
  339. endef
  340. $(foreach host,$(CFG_HOST), \
  341. $(foreach target,$(CFG_TARGET), \
  342. $(foreach stage,$(STAGES), \
  343. $(foreach crate, $(TEST_CRATES), \
  344. $(if $(findstring $(target),$(CFG_BUILD)), \
  345. $(eval $(call DEF_TEST_CRATE_RULES,$(stage),$(target),$(host),$(crate))), \
  346. $(if $(findstring $(target),"arm-linux-androideabi"), \
  347. $(if $(findstring $(CFG_ADB_DEVICE_STATUS),"true"), \
  348. $(eval $(call DEF_TEST_CRATE_RULES_arm-linux-androideabi,$(stage),$(target),$(host),$(crate))), \
  349. $(eval $(call DEF_TEST_CRATE_RULES_null,$(stage),$(target),$(host),$(crate))) \
  350. ), \
  351. $(eval $(call DEF_TEST_CRATE_RULES,$(stage),$(target),$(host),$(crate))) \
  352. ))))))
  353. ######################################################################
  354. # Rules for the compiletest tests (rpass, rfail, etc.)
  355. ######################################################################
  356. RPASS_RC := $(wildcard $(S)src/test/run-pass/*.rc)
  357. RPASS_RS := $(wildcard $(S)src/test/run-pass/*.rs)
  358. RPASS_FULL_RC := $(wildcard $(S)src/test/run-pass-fulldeps/*.rc)
  359. RPASS_FULL_RS := $(wildcard $(S)src/test/run-pass-fulldeps/*.rs)
  360. RFAIL_RC := $(wildcard $(S)src/test/run-fail/*.rc)
  361. RFAIL_RS := $(wildcard $(S)src/test/run-fail/*.rs)
  362. CFAIL_RC := $(wildcard $(S)src/test/compile-fail/*.rc)
  363. CFAIL_RS := $(wildcard $(S)src/test/compile-fail/*.rs)
  364. BENCH_RS := $(wildcard $(S)src/test/bench/*.rs)
  365. PRETTY_RS := $(wildcard $(S)src/test/pretty/*.rs)
  366. DEBUGINFO_RS := $(wildcard $(S)src/test/debug-info/*.rs)
  367. CODEGEN_RS := $(wildcard $(S)src/test/codegen/*.rs)
  368. CODEGEN_CC := $(wildcard $(S)src/test/codegen/*.cc)
  369. # perf tests are the same as bench tests only they run under
  370. # a performance monitor.
  371. PERF_RS := $(wildcard $(S)src/test/bench/*.rs)
  372. RPASS_TESTS := $(RPASS_RC) $(RPASS_RS)
  373. RPASS_FULL_TESTS := $(RPASS_FULL_RC) $(RPASS_FULL_RS)
  374. RFAIL_TESTS := $(RFAIL_RC) $(RFAIL_RS)
  375. CFAIL_TESTS := $(CFAIL_RC) $(CFAIL_RS)
  376. BENCH_TESTS := $(BENCH_RS)
  377. PERF_TESTS := $(PERF_RS)
  378. PRETTY_TESTS := $(PRETTY_RS)
  379. DEBUGINFO_TESTS := $(DEBUGINFO_RS)
  380. CODEGEN_TESTS := $(CODEGEN_RS) $(CODEGEN_CC)
  381. CTEST_SRC_BASE_rpass = run-pass
  382. CTEST_BUILD_BASE_rpass = run-pass
  383. CTEST_MODE_rpass = run-pass
  384. CTEST_RUNTOOL_rpass = $(CTEST_RUNTOOL)
  385. CTEST_SRC_BASE_rpass-full = run-pass-fulldeps
  386. CTEST_BUILD_BASE_rpass-full = run-pass-fulldeps
  387. CTEST_MODE_rpass-full = run-pass
  388. CTEST_RUNTOOL_rpass-full = $(CTEST_RUNTOOL)
  389. CTEST_SRC_BASE_rfail = run-fail
  390. CTEST_BUILD_BASE_rfail = run-fail
  391. CTEST_MODE_rfail = run-fail
  392. CTEST_RUNTOOL_rfail = $(CTEST_RUNTOOL)
  393. CTEST_SRC_BASE_cfail = compile-fail
  394. CTEST_BUILD_BASE_cfail = compile-fail
  395. CTEST_MODE_cfail = compile-fail
  396. CTEST_RUNTOOL_cfail = $(CTEST_RUNTOOL)
  397. CTEST_SRC_BASE_bench = bench
  398. CTEST_BUILD_BASE_bench = bench
  399. CTEST_MODE_bench = run-pass
  400. CTEST_RUNTOOL_bench = $(CTEST_RUNTOOL)
  401. CTEST_SRC_BASE_perf = bench
  402. CTEST_BUILD_BASE_perf = perf
  403. CTEST_MODE_perf = run-pass
  404. CTEST_RUNTOOL_perf = $(CTEST_PERF_RUNTOOL)
  405. CTEST_SRC_BASE_debuginfo = debug-info
  406. CTEST_BUILD_BASE_debuginfo = debug-info
  407. CTEST_MODE_debuginfo = debug-info
  408. CTEST_RUNTOOL_debuginfo = $(CTEST_RUNTOOL)
  409. CTEST_SRC_BASE_codegen = codegen
  410. CTEST_BUILD_BASE_codegen = codegen
  411. CTEST_MODE_codegen = codegen
  412. CTEST_RUNTOOL_codegen = $(CTEST_RUNTOOL)
  413. ifeq ($(CFG_GDB),)
  414. CTEST_DISABLE_debuginfo = "no gdb found"
  415. endif
  416. ifeq ($(CFG_CLANG),)
  417. CTEST_DISABLE_codegen = "no clang found"
  418. endif
  419. ifeq ($(CFG_OSTYPE),apple-darwin)
  420. CTEST_DISABLE_debuginfo = "gdb on darwing needs root"
  421. endif
  422. define DEF_CTEST_VARS
  423. # All the per-stage build rules you might want to call from the
  424. # command line.
  425. #
  426. # $(1) is the stage number
  427. # $(2) is the target triple to test
  428. # $(3) is the host triple to test
  429. # Prerequisites for compiletest tests
  430. TEST_SREQ$(1)_T_$(2)_H_$(3) = \
  431. $$(HBIN$(1)_H_$(3))/compiletest$$(X_$(3)) \
  432. $$(SREQ$(1)_T_$(2)_H_$(3))
  433. # Rules for the cfail/rfail/rpass/bench/perf test runner
  434. # The tests select when to use debug configuration on their own;
  435. # remove directive, if present, from CFG_RUSTC_FLAGS (issue #7898).
  436. CTEST_RUSTC_FLAGS := $$(subst --cfg ndebug,,$$(CFG_RUSTC_FLAGS))
  437. # There's no need our entire test suite to take up gigabytes of space on disk
  438. # including copies of libstd/libextra all over the place
  439. CTEST_RUSTC_FLAGS := $$(CTEST_RUSTC_FLAGS) -C prefer-dynamic
  440. # The tests can not be optimized while the rest of the compiler is optimized, so
  441. # filter out the optimization (if any) from rustc and then figure out if we need
  442. # to be optimized
  443. CTEST_RUSTC_FLAGS := $$(subst -O,,$$(CTEST_RUSTC_FLAGS))
  444. ifndef CFG_DISABLE_OPTIMIZE_TESTS
  445. CTEST_RUSTC_FLAGS += -O
  446. endif
  447. CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) := \
  448. --compile-lib-path $$(HLIB$(1)_H_$(3)) \
  449. --run-lib-path $$(TLIB$(1)_T_$(2)_H_$(3)) \
  450. --rustc-path $$(HBIN$(1)_H_$(3))/rustc$$(X_$(3)) \
  451. --clang-path $(if $(CFG_CLANG),$(CFG_CLANG),clang) \
  452. --llvm-bin-path $(CFG_LLVM_INST_DIR_$(CFG_BUILD))/bin \
  453. --aux-base $$(S)src/test/auxiliary/ \
  454. --stage-id stage$(1)-$(2) \
  455. --target $(2) \
  456. --host $(3) \
  457. --adb-path=$(CFG_ADB) \
  458. --adb-test-dir=$(CFG_ADB_TEST_DIR) \
  459. --rustcflags "$(RUSTC_FLAGS_$(2)) $$(CTEST_RUSTC_FLAGS) -L $$(RT_OUTPUT_DIR_$(2))" \
  460. $$(CTEST_TESTARGS)
  461. CTEST_DEPS_rpass_$(1)-T-$(2)-H-$(3) = $$(RPASS_TESTS)
  462. CTEST_DEPS_rpass_full_$(1)-T-$(2)-H-$(3) = $$(RPASS_FULL_TESTS) $$(TLIBRUSTC_DEFAULT$(1)_T_$(2)_H_$(3))
  463. CTEST_DEPS_rfail_$(1)-T-$(2)-H-$(3) = $$(RFAIL_TESTS)
  464. CTEST_DEPS_cfail_$(1)-T-$(2)-H-$(3) = $$(CFAIL_TESTS)
  465. CTEST_DEPS_bench_$(1)-T-$(2)-H-$(3) = $$(BENCH_TESTS)
  466. CTEST_DEPS_perf_$(1)-T-$(2)-H-$(3) = $$(PERF_TESTS)
  467. CTEST_DEPS_debuginfo_$(1)-T-$(2)-H-$(3) = $$(DEBUGINFO_TESTS)
  468. CTEST_DEPS_codegen_$(1)-T-$(2)-H-$(3) = $$(CODEGEN_TESTS)
  469. endef
  470. $(foreach host,$(CFG_HOST), \
  471. $(eval $(foreach target,$(CFG_TARGET), \
  472. $(eval $(foreach stage,$(STAGES), \
  473. $(eval $(call DEF_CTEST_VARS,$(stage),$(target),$(host))))))))
  474. define DEF_RUN_COMPILETEST
  475. CTEST_ARGS$(1)-T-$(2)-H-$(3)-$(4) := \
  476. $$(CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3)) \
  477. --src-base $$(S)src/test/$$(CTEST_SRC_BASE_$(4))/ \
  478. --build-base $(3)/test/$$(CTEST_BUILD_BASE_$(4))/ \
  479. --ratchet-metrics $(call TEST_RATCHET_FILE,$(1),$(2),$(3),$(4)) \
  480. --mode $$(CTEST_MODE_$(4)) \
  481. $$(CTEST_RUNTOOL_$(4))
  482. check-stage$(1)-T-$(2)-H-$(3)-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4))
  483. ifeq ($$(CTEST_DISABLE_$(4)),)
  484. $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
  485. $$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
  486. $$(CTEST_DEPS_$(4)_$(1)-T-$(2)-H-$(3))
  487. @$$(call E, run $(4) [$(2)]: $$<)
  488. $$(Q)$$(call CFG_RUN_CTEST_$(2),$(1),$$<,$(3)) \
  489. $$(CTEST_ARGS$(1)-T-$(2)-H-$(3)-$(4)) \
  490. --logfile $$(call TEST_LOG_FILE,$(1),$(2),$(3),$(4)) \
  491. && touch $$@
  492. else
  493. $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
  494. $$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
  495. $$(CTEST_DEPS_$(4)_$(1)-T-$(2)-H-$(3))
  496. @$$(call E, run $(4) [$(2)]: $$<)
  497. @$$(call E, warning: tests disabled: $$(CTEST_DISABLE_$(4)))
  498. touch $$@
  499. endif
  500. endef
  501. CTEST_NAMES = rpass rpass-full rfail cfail bench perf debuginfo codegen
  502. $(foreach host,$(CFG_HOST), \
  503. $(eval $(foreach target,$(CFG_TARGET), \
  504. $(eval $(foreach stage,$(STAGES), \
  505. $(eval $(foreach name,$(CTEST_NAMES), \
  506. $(eval $(call DEF_RUN_COMPILETEST,$(stage),$(target),$(host),$(name))))))))))
  507. PRETTY_NAMES = pretty-rpass pretty-rpass-full pretty-rfail pretty-bench pretty-pretty
  508. PRETTY_DEPS_pretty-rpass = $(RPASS_TESTS)
  509. PRETTY_DEPS_pretty-rpass-full = $(RPASS_FULL_TESTS)
  510. PRETTY_DEPS_pretty-rfail = $(RFAIL_TESTS)
  511. PRETTY_DEPS_pretty-bench = $(BENCH_TESTS)
  512. PRETTY_DEPS_pretty-pretty = $(PRETTY_TESTS)
  513. PRETTY_DIRNAME_pretty-rpass = run-pass
  514. PRETTY_DIRNAME_pretty-rpass-full = run-pass-fulldeps
  515. PRETTY_DIRNAME_pretty-rfail = run-fail
  516. PRETTY_DIRNAME_pretty-bench = bench
  517. PRETTY_DIRNAME_pretty-pretty = pretty
  518. define DEF_RUN_PRETTY_TEST
  519. PRETTY_ARGS$(1)-T-$(2)-H-$(3)-$(4) := \
  520. $$(CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3)) \
  521. --src-base $$(S)src/test/$$(PRETTY_DIRNAME_$(4))/ \
  522. --build-base $(3)/test/$$(PRETTY_DIRNAME_$(4))/ \
  523. --mode pretty
  524. check-stage$(1)-T-$(2)-H-$(3)-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4))
  525. $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
  526. $$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
  527. $$(PRETTY_DEPS_$(4))
  528. @$$(call E, run pretty-rpass [$(2)]: $$<)
  529. $$(Q)$$(call CFG_RUN_CTEST_$(2),$(1),$$<,$(3)) \
  530. $$(PRETTY_ARGS$(1)-T-$(2)-H-$(3)-$(4)) \
  531. --logfile $$(call TEST_LOG_FILE,$(1),$(2),$(3),$(4)) \
  532. && touch $$@
  533. endef
  534. $(foreach host,$(CFG_HOST), \
  535. $(foreach target,$(CFG_TARGET), \
  536. $(foreach stage,$(STAGES), \
  537. $(foreach pretty-name,$(PRETTY_NAMES), \
  538. $(eval $(call DEF_RUN_PRETTY_TEST,$(stage),$(target),$(host),$(pretty-name)))))))
  539. define DEF_RUN_DOC_TEST
  540. DOC_TEST_ARGS$(1)-T-$(2)-H-$(3)-doc-$(4) := \
  541. $$(CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3)) \
  542. --src-base $(3)/test/doc-$(4)/ \
  543. --build-base $(3)/test/doc-$(4)/ \
  544. --mode run-pass
  545. check-stage$(1)-T-$(2)-H-$(3)-doc-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),doc-$(4))
  546. $$(call TEST_OK_FILE,$(1),$(2),$(3),doc-$(4)): \
  547. $$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
  548. doc-$(4)-extract$(3)
  549. @$$(call E, run doc-$(4) [$(2)]: $$<)
  550. $$(Q)$$(call CFG_RUN_CTEST_$(2),$(1),$$<,$(3)) \
  551. $$(DOC_TEST_ARGS$(1)-T-$(2)-H-$(3)-doc-$(4)) \
  552. --logfile $$(call TEST_LOG_FILE,$(1),$(2),$(3),doc-$(4)) \
  553. && touch $$@
  554. endef
  555. $(foreach host,$(CFG_HOST), \
  556. $(foreach target,$(CFG_TARGET), \
  557. $(foreach stage,$(STAGES), \
  558. $(foreach docname,$(DOC_TEST_NAMES), \
  559. $(eval $(call DEF_RUN_DOC_TEST,$(stage),$(target),$(host),$(docname)))))))
  560. define DEF_CRATE_DOC_TEST
  561. check-stage$(1)-T-$(2)-H-$(3)-doc-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),doc-$(4))
  562. ifeq ($(2),$$(CFG_BUILD))
  563. $$(call TEST_OK_FILE,$(1),$(2),$(3),doc-$(4)): \
  564. $$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
  565. $$(CRATE_FULLDEPS_$(1)_T_$(2)_H_$(3)_$(4)) \
  566. $$(HBIN$(1)_H_$(3))/rustdoc$$(X_$(3))
  567. @$$(call E, run doc-$(4) [$(2)])
  568. $$(Q)$$(HBIN$(1)_H_$(3))/rustdoc$$(X_$(3)) --test \
  569. $$(CRATEFILE_$(4)) --test-args "$$(TESTARGS)" && touch $$@
  570. else
  571. $$(call TEST_OK_FILE,$(1),$(2),$(3),doc-$(4)):
  572. touch $$@
  573. endif
  574. endef
  575. $(foreach host,$(CFG_HOST), \
  576. $(foreach target,$(CFG_TARGET), \
  577. $(foreach stage,$(STAGES), \
  578. $(foreach crate,$(TEST_DOC_CRATES), \
  579. $(eval $(call DEF_CRATE_DOC_TEST,$(stage),$(target),$(host),$(crate)))))))
  580. ######################################################################
  581. # Extracting tests for docs
  582. ######################################################################
  583. EXTRACT_TESTS := "$(CFG_PYTHON)" $(S)src/etc/extract-tests.py
  584. define DEF_DOC_TEST_HOST
  585. doc-$(2)-extract$(1):
  586. @$$(call E, extract: $(2) tests)
  587. $$(Q)rm -f $(1)/test/doc-$(2)/*.rs
  588. $$(Q)$$(EXTRACT_TESTS) $$(D)/$(2).md $(1)/test/doc-$(2)
  589. endef
  590. $(foreach host,$(CFG_HOST), \
  591. $(foreach docname,$(DOC_TEST_NAMES), \
  592. $(eval $(call DEF_DOC_TEST_HOST,$(host),$(docname)))))
  593. ######################################################################
  594. # Shortcut rules
  595. ######################################################################
  596. TEST_GROUPS = \
  597. crates \
  598. $(foreach crate,$(TEST_CRATES),$(crate)) \
  599. $(foreach crate,$(TEST_DOC_CRATES),doc-$(crate)) \
  600. rpass \
  601. rpass-full \
  602. rfail \
  603. cfail \
  604. bench \
  605. perf \
  606. rmake \
  607. debuginfo \
  608. codegen \
  609. doc \
  610. $(foreach docname,$(DOC_TEST_NAMES),doc-$(docname)) \
  611. pretty \
  612. pretty-rpass \
  613. pretty-rpass-full \
  614. pretty-rfail \
  615. pretty-bench \
  616. pretty-pretty \
  617. $(NULL)
  618. define DEF_CHECK_FOR_STAGE_AND_TARGET_AND_HOST
  619. check-stage$(1)-T-$(2)-H-$(3): check-stage$(1)-T-$(2)-H-$(3)-exec
  620. endef
  621. $(foreach stage,$(STAGES), \
  622. $(foreach target,$(CFG_TARGET), \
  623. $(foreach host,$(CFG_HOST), \
  624. $(eval $(call DEF_CHECK_FOR_STAGE_AND_TARGET_AND_HOST,$(stage),$(target),$(host))))))
  625. define DEF_CHECK_FOR_STAGE_AND_TARGET_AND_HOST_AND_GROUP
  626. check-stage$(1)-T-$(2)-H-$(3)-$(4): check-stage$(1)-T-$(2)-H-$(3)-$(4)-exec
  627. endef
  628. $(foreach stage,$(STAGES), \
  629. $(foreach target,$(CFG_TARGET), \
  630. $(foreach host,$(CFG_HOST), \
  631. $(foreach group,$(TEST_GROUPS), \
  632. $(eval $(call DEF_CHECK_FOR_STAGE_AND_TARGET_AND_HOST_AND_GROUP,$(stage),$(target),$(host),$(group)))))))
  633. define DEF_CHECK_FOR_STAGE
  634. check-stage$(1): check-stage$(1)-H-$$(CFG_BUILD)
  635. check-stage$(1)-H-all: $$(foreach target,$$(CFG_TARGET), \
  636. check-stage$(1)-H-$$(target))
  637. endef
  638. $(foreach stage,$(STAGES), \
  639. $(eval $(call DEF_CHECK_FOR_STAGE,$(stage))))
  640. define DEF_CHECK_FOR_STAGE_AND_GROUP
  641. check-stage$(1)-$(2): check-stage$(1)-H-$$(CFG_BUILD)-$(2)
  642. check-stage$(1)-H-all-$(2): $$(foreach target,$$(CFG_TARGET), \
  643. check-stage$(1)-H-$$(target)-$(2))
  644. endef
  645. $(foreach stage,$(STAGES), \
  646. $(foreach group,$(TEST_GROUPS), \
  647. $(eval $(call DEF_CHECK_FOR_STAGE_AND_GROUP,$(stage),$(group)))))
  648. define DEF_CHECK_FOR_STAGE_AND_HOSTS
  649. check-stage$(1)-H-$(2): $$(foreach target,$$(CFG_TARGET), \
  650. check-stage$(1)-T-$$(target)-H-$(2))
  651. endef
  652. $(foreach stage,$(STAGES), \
  653. $(foreach host,$(CFG_HOST), \
  654. $(eval $(call DEF_CHECK_FOR_STAGE_AND_HOSTS,$(stage),$(host)))))
  655. define DEF_CHECK_FOR_STAGE_AND_HOSTS_AND_GROUP
  656. check-stage$(1)-H-$(2)-$(3): $$(foreach target,$$(CFG_TARGET), \
  657. check-stage$(1)-T-$$(target)-H-$(2)-$(3))
  658. endef
  659. $(foreach stage,$(STAGES), \
  660. $(foreach host,$(CFG_HOST), \
  661. $(foreach group,$(TEST_GROUPS), \
  662. $(eval $(call DEF_CHECK_FOR_STAGE_AND_HOSTS_AND_GROUP,$(stage),$(host),$(group))))))
  663. ######################################################################
  664. # check-fast rules
  665. ######################################################################
  666. FT := run_pass_stage2
  667. FT_LIB := $(call CFG_LIB_NAME_$(CFG_BUILD),$(FT))
  668. FT_DRIVER := $(FT)_driver
  669. GENERATED += tmp/$(FT).rc tmp/$(FT_DRIVER).rs
  670. tmp/$(FT).rc tmp/$(FT_DRIVER).rs: \
  671. $(RPASS_TESTS) \
  672. $(S)src/etc/combine-tests.py
  673. @$(call E, check: building combined stage2 test runner)
  674. $(Q)$(CFG_PYTHON) $(S)src/etc/combine-tests.py
  675. define DEF_CHECK_FAST_FOR_T_H
  676. # $(1) unused
  677. # $(2) target triple
  678. # $(3) host triple
  679. $$(TLIB2_T_$(2)_H_$(3))/$$(FT_LIB): \
  680. tmp/$$(FT).rc \
  681. $$(SREQ2_T_$(2)_H_$(3))
  682. @$$(call E, oxidize: $$@)
  683. $$(STAGE2_T_$(2)_H_$(3)) --crate-type=dylib --out-dir $$(@D) $$< \
  684. -L "$$(RT_OUTPUT_DIR_$(2))"
  685. $(3)/test/$$(FT_DRIVER)-$(2)$$(X_$(2)): \
  686. tmp/$$(FT_DRIVER).rs \
  687. $$(TLIB2_T_$(2)_H_$(3))/$$(FT_LIB) \
  688. $$(SREQ2_T_$(2)_H_$(3))
  689. @$$(call E, oxidize: $$@ $$<)
  690. $$(STAGE2_T_$(2)_H_$(3)) -o $$@ $$< \
  691. -L "$$(RT_OUTPUT_DIR_$(2))"
  692. $(3)/test/$$(FT_DRIVER)-$(2).out: \
  693. $(3)/test/$$(FT_DRIVER)-$(2)$$(X_$(2)) \
  694. $$(SREQ2_T_$(2)_H_$(3))
  695. $$(Q)$$(call CFG_RUN_TEST_$(2),$$<,$(2),$(3)) \
  696. --logfile tmp/$$(FT_DRIVER)-$(2).log
  697. check-fast-T-$(2)-H-$(3): \
  698. $(3)/test/$$(FT_DRIVER)-$(2).out
  699. endef
  700. $(foreach host,$(CFG_HOST), \
  701. $(eval $(foreach target,$(CFG_TARGET), \
  702. $(eval $(call DEF_CHECK_FAST_FOR_T_H,,$(target),$(host))))))
  703. check-fast: tidy check-fast-H-$(CFG_BUILD) \
  704. $(foreach crate,$(TARGET_CRATES),check-stage2-$(crate))
  705. $(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
  706. define DEF_CHECK_FAST_FOR_H
  707. check-fast-H-$(1): check-fast-T-$(1)-H-$(1)
  708. endef
  709. $(foreach host,$(CFG_HOST), \
  710. $(eval $(call DEF_CHECK_FAST_FOR_H,$(host))))
  711. RMAKE_TESTS := $(shell ls -d $(S)src/test/run-make/*/)
  712. RMAKE_TESTS := $(RMAKE_TESTS:$(S)src/test/run-make/%/=%)
  713. define DEF_RMAKE_FOR_T_H
  714. # $(1) the stage
  715. # $(2) target triple
  716. # $(3) host triple
  717. ifeq ($(2)$(3),$$(CFG_BUILD)$$(CFG_BUILD))
  718. check-stage$(1)-T-$(2)-H-$(3)-rmake-exec: \
  719. $$(call TEST_OK_FILE,$(1),$(2),$(3),rmake)
  720. $$(call TEST_OK_FILE,$(1),$(2),$(3),rmake): \
  721. $$(RMAKE_TESTS:%=$(3)/test/run-make/%-$(1)-T-$(2)-H-$(3).ok)
  722. @touch $$@
  723. $(3)/test/run-make/%-$(1)-T-$(2)-H-$(3).ok: \
  724. $(S)src/test/run-make/%/Makefile \
  725. $$(CSREQ$(1)_T_$(2)_H_$(3))
  726. @rm -rf $(3)/test/run-make/$$*
  727. @mkdir -p $(3)/test/run-make/$$*
  728. $$(Q)$$(CFG_PYTHON) $(S)src/etc/maketest.py $$(dir $$<) \
  729. $$(HBIN$(1)_H_$(3))/rustc$$(X_$(3)) \
  730. $(3)/test/run-make/$$* \
  731. "$$(CC_$(3)) $$(CFG_GCCISH_CFLAGS_$(3))" \
  732. $$(HBIN$(1)_H_$(3))/rustdoc$$(X_$(3)) \
  733. "$$(TESTNAME)"
  734. @touch $$@
  735. else
  736. # FIXME #11094 - The above rule doesn't work right for multiple targets
  737. check-stage$(1)-T-$(2)-H-$(3)-rmake-exec:
  738. @true
  739. endif
  740. endef
  741. $(foreach stage,$(STAGES), \
  742. $(foreach target,$(CFG_TARGET), \
  743. $(foreach host,$(CFG_HOST), \
  744. $(eval $(call DEF_RMAKE_FOR_T_H,$(stage),$(target),$(host))))))