@@ -51,6 +51,12 @@ COMPILETEST_INPUTS := $(wildcard $(S)src/test/compiletest/*rs)
51
51
STDTEST_CRATE := $(S ) src/test/stdtest/stdtest.rc
52
52
STDTEST_INPUTS := $(wildcard $(S ) src/test/stdtest/* rs)
53
53
54
+ # Run the compiletest runner itself under valgrind
55
+ ifdef CTEST_VALGRIND
56
+ CFG_RUN_CTEST =$(call CFG_RUN_TEST,$(2 ) )
57
+ else
58
+ CFG_RUN_CTEST =$(call CFG_RUN,stage$(1 ) /lib,$(2 ) )
59
+ endif
54
60
55
61
# #####################################################################
56
62
# Main test targets
@@ -188,31 +194,31 @@ test/compiletest.stage$(2)$$(X): $$(COMPILETEST_CRATE) \
188
194
test/compile-fail.stage$(2 ) .out.tmp: test/compiletest.stage$(2 )$$(X ) \
189
195
$$(CFAIL_TESTS )
190
196
@$$(call E, run: $$< )
191
- $$(Q )$$(call CFG_RUN_TEST ,$$< ) $$(CFAIL_ARGS$(2 ) )
197
+ $$(Q )$$(call CFG_RUN_CTEST, $( 2 ) ,$$< ) $$(CFAIL_ARGS$(2 ) )
192
198
$$(Q ) touch $$@
193
199
194
200
test/run-fail.stage$(2 ) .out.tmp: test/compiletest.stage$(2 )$$(X ) \
195
201
$$(RFAIL_TESTS )
196
202
@$$(call E, run: $$< )
197
- $$(Q )$$(call CFG_RUN_TEST ,$$< ) $$(RFAIL_ARGS$(2 ) )
203
+ $$(Q )$$(call CFG_RUN_CTEST, $( 2 ) ,$$< ) $$(RFAIL_ARGS$(2 ) )
198
204
$$(Q ) touch $$@
199
205
200
206
test/run-pass.stage$(2 ) .out.tmp: test/compiletest.stage$(2 )$$(X ) \
201
207
$$(RPASS_TESTS )
202
208
@$$(call E, run: $$< )
203
- $$(Q )$$(call CFG_RUN_TEST ,$$< ) $$(RPASS_ARGS$(2 ) )
209
+ $$(Q )$$(call CFG_RUN_CTEST, $( 2 ) ,$$< ) $$(RPASS_ARGS$(2 ) )
204
210
$$(Q ) touch $$@
205
211
206
212
test/bench.stage$(2 ) .out.tmp: test/compiletest.stage$(2 )$$(X ) \
207
213
$$(BENCH_TESTS )
208
214
@$$(call E, run: $$< )
209
- $$(Q )$$(call CFG_RUN_TEST ,$$< ) $$(BENCH_ARGS$(2 ) )
215
+ $$(Q )$$(call CFG_RUN_CTEST, $( 2 ) ,$$< ) $$(BENCH_ARGS$(2 ) )
210
216
$$(Q ) touch $$@
211
217
212
218
test/pretty.stage$(2 ) .out.tmp: test/compiletest.stage$(2 )$$(X ) \
213
219
$$(RPASS_TESTS )
214
220
@$$(call E, run: $$< )
215
- $$(Q )$$(call CFG_RUN_TEST ,$$< ) $$(PRETTY_ARGS$(2 ) )
221
+ $$(Q )$$(call CFG_RUN_CTEST, $( 2 ) ,$$< ) $$(PRETTY_ARGS$(2 ) )
216
222
$$(Q ) touch $$@
217
223
218
224
endef
0 commit comments