Skip to content

Commit b505e89

Browse files
committed
---
yaml --- r: 6502 b: refs/heads/master c: 4f92204 h: refs/heads/master v: v3
1 parent 9c347e2 commit b505e89

File tree

3 files changed

+91
-59
lines changed

3 files changed

+91
-59
lines changed

[refs]

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 821298737a123da856ad9d994343371c02c97a2b
2+
refs/heads/master: 4f92204765ed5b9cbe8e2c54ea0102109987f245

trunk/mk/tests.mk

+88-56
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ PRETTY_TESTS := $(PRETTY_RS)
2929
FT := run_pass_stage2
3030
FT_LIB := $(call CFG_LIB_NAME,$(FT))
3131
FT_DRIVER := $(FT)_driver
32-
GENERATED += test/$(FT).rc test/$(FT_DRIVER).rs
3332

3433
# The arguments to all test runners
3534
ifdef TESTNAME
@@ -75,10 +74,6 @@ check: tidy check-stage2 \
7574

7675
check-full: tidy check-stage1 check-stage2 check-stage3 \
7776

78-
check-fast: tidy \
79-
check-stage2-rustc check-stage2-std \
80-
test/$(FT_DRIVER).out
81-
8277
# Run the tidy script in multiple parts to avoid huge 'echo' commands
8378
ifdef CFG_NOTIDY
8479
tidy:
@@ -214,18 +209,18 @@ RFAIL_ARGS$(1)-T-$(2)-H-$(3) := \
214209
--mode run-fail \
215210
$$(CTEST_RUNTOOL)
216211

217-
RPASS_ARGS$(1)-T-$(2)-H-$(3) := \
212+
RPASS_ARGS$(1)-T-$(2)-H-$(3) := \
218213
$$(CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3)) \
219214
--src-base $$(S)src/test/run-pass/ \
220215
--build-base $(3)/test/run-pass/ \
221-
--mode run-pass \
216+
--mode run-pass \
222217
$$(CTEST_RUNTOOL)
223218

224-
BENCH_ARGS$(1)-T-$(2)-H-$(3) := \
219+
BENCH_ARGS$(1)-T-$(2)-H-$(3) := \
225220
$$(CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3)) \
226221
--src-base $$(S)src/test/bench/ \
227222
--build-base $(3)/test/bench/ \
228-
--mode run-pass \
223+
--mode run-pass \
229224
$$(CTEST_RUNTOOL)
230225

231226
PERF_ARGS$(1)-T-$(2)-H-$(3) := \
@@ -261,32 +256,32 @@ PRETTY_PRETTY_ARGS$(1)-T-$(2)-H-$(3) := \
261256

262257
check-stage$(1)-T-$(2)-H-$(3)-cfail-dummy: \
263258
$$(HBIN$(1)_H_$(3))/compiletest$$(X) \
264-
$$(SREQ$(1)_T_$(2)_H_$(3)) \
265-
$$(CFAIL_TESTS)
259+
$$(SREQ$(1)_T_$(2)_H_$(3)) \
260+
$$(CFAIL_TESTS)
266261
@$$(call E, run cfail: $$<)
267262
$$(Q)$$(call CFG_RUN_CTEST,$(1),$$<,$(3)) \
268263
$$(CFAIL_ARGS$(1)-T-$(2)-H-$(3))
269264

270265
check-stage$(1)-T-$(2)-H-$(3)-rfail-dummy: \
271266
$$(HBIN$(1)_H_$(3))/compiletest$$(X) \
272-
$$(SREQ$(1)_T_$(2)_H_$(3)) \
273-
$$(RFAIL_TESTS)
267+
$$(SREQ$(1)_T_$(2)_H_$(3)) \
268+
$$(RFAIL_TESTS)
274269
@$$(call E, run rfail: $$<)
275270
$$(Q)$$(call CFG_RUN_CTEST,$(1),$$<,$(3)) \
276271
$$(RFAIL_ARGS$(1)-T-$(2)-H-$(3))
277272

278273
check-stage$(1)-T-$(2)-H-$(3)-rpass-dummy: \
279274
$$(HBIN$(1)_H_$(3))/compiletest$$(X) \
280-
$$(SREQ$(1)_T_$(2)_H_$(3)) \
281-
$$(RPASS_TESTS)
275+
$$(SREQ$(1)_T_$(2)_H_$(3)) \
276+
$$(RPASS_TESTS)
282277
@$$(call E, run rpass: $$<)
283278
$$(Q)$$(call CFG_RUN_CTEST,$(1),$$<,$(3)) \
284279
$$(RPASS_ARGS$(1)-T-$(2)-H-$(3))
285280

286281
check-stage$(1)-T-$(2)-H-$(3)-bench-dummy: \
287282
$$(HBIN$(1)_H_$(3))/compiletest$$(X) \
288-
$$(SREQ$(1)_T_$(2)_H_$(3)) \
289-
$$(BENCH_TESTS)
283+
$$(SREQ$(1)_T_$(2)_H_$(3)) \
284+
$$(BENCH_TESTS)
290285
@$$(call E, run bench: $$<)
291286
$$(Q)$$(call CFG_RUN_CTEST,$(1),$$<,$(3)) \
292287
$$(BENCH_ARGS$(1)-T-$(2)-H-$(3))
@@ -300,33 +295,33 @@ check-stage$(1)-T-$(2)-H-$(3)-perf-dummy: \
300295
$$(PERF_ARGS$(1)-T-$(2)-H-$(3))
301296

302297
check-stage$(1)-T-$(2)-H-$(3)-pretty-rpass-dummy: \
303-
$$(HBIN$(1)_H_$(3))/compiletest$$(X) \
304-
$$(SREQ$(1)_T_$(2)_H_$(3)) \
305-
$$(RPASS_TESTS)
298+
$$(HBIN$(1)_H_$(3))/compiletest$$(X) \
299+
$$(SREQ$(1)_T_$(2)_H_$(3)) \
300+
$$(RPASS_TESTS)
306301
@$$(call E, run pretty-rpass: $$<)
307302
$$(Q)$$(call CFG_RUN_CTEST,$(1),$$<,$(3)) \
308303
$$(PRETTY_RPASS_ARGS$(1)-T-$(2)-H-$(3))
309304

310305
check-stage$(1)-T-$(2)-H-$(3)-pretty-rfail-dummy: \
311-
$$(HBIN$(1)_H_$(3))/compiletest$$(X) \
312-
$$(SREQ$(1)_T_$(2)_H_$(3)) \
313-
$$(RFAIL_TESTS)
306+
$$(HBIN$(1)_H_$(3))/compiletest$$(X) \
307+
$$(SREQ$(1)_T_$(2)_H_$(3)) \
308+
$$(RFAIL_TESTS)
314309
@$$(call E, run pretty-rfail: $$<)
315310
$$(Q)$$(call CFG_RUN_CTEST,$(1),$$<,$(3)) \
316311
$$(PRETTY_RFAIL_ARGS$(1)-T-$(2)-H-$(3))
317312

318313
check-stage$(1)-T-$(2)-H-$(3)-pretty-bench-dummy: \
319-
$$(HBIN$(1)_H_$(3))/compiletest$$(X) \
320-
$$(SREQ$(1)_T_$(2)_H_$(3)) \
321-
$$(BENCH_TESTS)
314+
$$(HBIN$(1)_H_$(3))/compiletest$$(X) \
315+
$$(SREQ$(1)_T_$(2)_H_$(3)) \
316+
$$(BENCH_TESTS)
322317
@$$(call E, run pretty-bench: $$<)
323318
$$(Q)$$(call CFG_RUN_CTEST,$(1),$$<,$(3)) \
324319
$$(PRETTY_BENCH_ARGS$(1)-T-$(2)-H-$(3))
325320

326321
check-stage$(1)-T-$(2)-H-$(3)-pretty-pretty-dummy: \
327-
$$(HBIN$(1)_H_$(3))/compiletest$$(X) \
328-
$$(SREQ$(1)_T_$(2)_H_$(3)) \
329-
$$(PRETTY_TESTS)
322+
$$(HBIN$(1)_H_$(3))/compiletest$$(X) \
323+
$$(SREQ$(1)_T_$(2)_H_$(3)) \
324+
$$(PRETTY_TESTS)
330325
@$$(call E, run pretty-pretty: $$<)
331326
$$(Q)$$(call CFG_RUN_CTEST,$(1),$$<,$(3)) \
332327
$$(PRETTY_PRETTY_ARGS$(1)-T-$(2)-H-$(3))
@@ -340,10 +335,57 @@ $(foreach host,$(CFG_TARGET_TRIPLES), \
340335
$(eval $(foreach stage,$(STAGES), \
341336
$(eval $(call TEST_STAGEN,$(stage),$(target),$(host))))))))
342337

343-
# Make convenient Shorthand Targets for use on command
344-
# line or by other rules:
338+
######################################################################
339+
# Fast-test rules
340+
######################################################################
345341

346-
define DEF_CHECK_SAME
342+
GENERATED += tmp/$$(FT).rc tmp/$$(FT_DRIVER).rs
343+
344+
tmp/$$(FT).rc tmp/$$(FT_DRIVER).rs: \
345+
$$(TEST_RPASS_SOURCES_STAGE2) \
346+
$$(S)src/etc/combine-tests.py
347+
@$$(call E, check: building combined stage2 test runner)
348+
$$(Q)$$(S)src/etc/combine-tests.py
349+
350+
define DEF_CHECK_FAST_FOR_T_H
351+
# $(1) unused
352+
# $(2) target triple
353+
# $(3) host triple
354+
355+
$$(TLIB2_T_$(2)_H_$(3))/$$(FT_LIB): \
356+
tmp/$$(FT).rc \
357+
$$(SREQ2_T_$(2)_H_$(3))
358+
@$$(call E, compile_and_link: $$@)
359+
$$(STAGE2_$(CFG_HOST_TRIPLE)) --lib -o $$@ $$<
360+
361+
$(3)/test/$(FT_DRIVER)-$(2)$(X): \
362+
tmp/$(FT_DRIVER).rs \
363+
$(TLIB2_T_$(2)_H_$(3))/$(FT_LIB) \
364+
$(SREQ2_T_$(2)_H_$(3))
365+
@$(call E, compile_and_link: $@)
366+
$(STAGE2_$(CFG_HOST_TRIPLE)) -L $(HOST_LIB2) -o $@ $<
367+
368+
$(3)/test/$(FT_DRIVER)-$(2).out: \
369+
$(3)/test/$(FT_DRIVER)-$(2)$(X) \
370+
$(SREQ2_T_$(2)_H_$(3))
371+
$(Q)$(call CFG_RUN_TEST,$<,$(2),$(3))
372+
373+
check-fast-T-$(2)-H-$(3): tidy \
374+
check-stage2-T-$(2)-H-$(3)-rustc \
375+
check-stage2-T-$(2)-H-$(3)-std \
376+
$(3)/test/$(FT_DRIVER)-$(2).out
377+
378+
endef
379+
380+
$(foreach host,$(CFG_TARGET_TRIPLES), \
381+
$(eval $(foreach target,$(CFG_TARGET_TRIPLES), \
382+
$(eval $(call DEF_CHECK_FAST_FOR_T_H,,$(target),$(host))))))
383+
384+
######################################################################
385+
# Shortcut rules
386+
######################################################################
387+
388+
define DEF_CHECK_FOR_STAGE_H
347389

348390
check-stage$(1)-H-$(2): check-stage$(1)-T-$(2)-H-$(2)
349391
check-stage$(1)-H-$(2)-perf: check-stage$(1)-T-$(2)-H-$(2)-perf
@@ -356,11 +398,20 @@ check-stage$(1)-H-$(2)-bench: check-stage$(1)-T-$(2)-H-$(2)-bench
356398

357399
endef
358400

359-
$(foreach stage,$(STAGES), \
401+
$(foreach stage,$(STAGES), \
360402
$(eval $(foreach target,$(CFG_TARGET_TRIPLES), \
361-
$(eval $(call DEF_CHECK_SAME,$(stage),$(target))))))
403+
$(eval $(call DEF_CHECK_FOR_STAGE_H,$(stage),$(target))))))
404+
405+
define DEF_CHECK_FAST_FOR_H
406+
407+
check-fast-H-$(1): check-fast-T-$(1)-H-$(1)
408+
409+
endef
362410

363-
define DEF_CHECK_HOST
411+
$(foreach target,$(CFG_TARGET_TRIPLES), \
412+
$(eval $(call DEF_CHECK_FAST_FOR_H,$(target))))
413+
414+
define DEF_CHECK_FOR_STAGE
364415

365416
check-stage$(1): check-stage$(1)-H-$(CFG_HOST_TRIPLE)
366417
check-stage$(1)-perf: check-stage$(1)-H-$(CFG_HOST_TRIPLE)-perf
@@ -374,25 +425,6 @@ check-stage$(1)-bench: check-stage$(1)-H-$(CFG_HOST_TRIPLE)-bench
374425
endef
375426

376427
$(foreach stage,$(STAGES), \
377-
$(eval $(call DEF_CHECK_HOST,$(stage))))
378-
379-
######################################################################
380-
# Fast-test rules
381-
######################################################################
382-
383-
test/$(FT).rc test/$(FT_DRIVER).rs: $(TEST_RPASS_SOURCES_STAGE2) \
384-
$(S)src/etc/combine-tests.py
385-
@$(call E, check: building combined stage2 test runner)
386-
$(Q)$(S)src/etc/combine-tests.py
387-
388-
$(TARGET_HOST_LIB2)/$(FT_LIB): test/$(FT).rc $(SREQ2$(CFG_HOST_TRIPLE))
389-
@$(call E, compile_and_link: $@)
390-
$(STAGE2_$(CFG_HOST_TRIPLE)) --lib -o $@ $<
391-
392-
test/$(FT_DRIVER)$(X): test/$(FT_DRIVER).rs $(TARGET_HOST_LIB2)/$(FT_LIB) \
393-
$(SREQ2$(CFG_HOST_TRIPLE))
394-
@$(call E, compile_and_link: $@)
395-
$(STAGE2_$(CFG_HOST_TRIPLE)) -L $(HOST_LIB2) -o $@ $<
428+
$(eval $(call DEF_CHECK_FOR_STAGE,$(stage))))
396429

397-
test/$(FT_DRIVER).out: test/$(FT_DRIVER)$(X) $(SREQ2$(CFG_HOST_TRIPLE))
398-
$(Q)$(call CFG_RUN_TEST,$<,$(CFG_HOST_TRIPLE),$(CFG_HOST_TRIPLE))
430+
check-fast: check-fast-H-$(CFG_HOST_TRIPLE)

trunk/src/etc/combine-tests.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def scrub(b):
3636

3737
stage2_tests.sort()
3838

39-
c = open("test/run_pass_stage2.rc", "w")
39+
c = open("tmp/run_pass_stage2.rc", "w")
4040
i = 0
4141
c.write("// AUTO-GENERATED FILE: DO NOT EDIT\n")
4242
c.write("#[link(name=\"run_pass_stage2\", vers=\"0.1\")];\n")
@@ -49,7 +49,7 @@ def scrub(b):
4949
c.close()
5050

5151

52-
d = open("test/run_pass_stage2_driver.rs", "w")
52+
d = open("tmp/run_pass_stage2_driver.rs", "w")
5353
d.write("// AUTO-GENERATED FILE: DO NOT EDIT\n")
5454
d.write("use std;\n")
5555
d.write("use run_pass_stage2;\n")

0 commit comments

Comments
 (0)