@@ -88,217 +88,192 @@ tidy:
88
88
$(S ) src/etc/%, $(PKG_FILES ) ) \
89
89
| xargs -n 10 python $(S ) src/etc/tidy.py
90
90
91
- # Cancel the implicit .out rule in GNU make
92
- % .out : %
93
-
94
- % .out : % .out.tmp
95
- $(Q ) mv $< $@
96
-
97
91
98
92
# #####################################################################
99
93
# Rules for the test runners
100
94
# #####################################################################
101
95
102
- # StageN template: to stay consistent with stageN.mk, arge 2 is the
103
- # stage being tested, arg 1 is stage N-1
104
-
105
96
define TEST_STAGEN
106
97
107
- # FIXME: These rules are complicated by a scheme to produce .out files
108
- # for each test, with the idea that if the targets produce actual
109
- # output, subsequent "make check's" will just exit successfully
110
- # without re-running the tests. Unfortunately this scheme is currently
111
- # broken and the tests rerun with every invocation of "make check"
112
- # anyway. Nobody seems to have noticed, so it would be simpler to just
113
- # remove all the code here involved with producing .out files.
98
+ # All the per-stage build rules you might want to call from the
99
+ # command line
114
100
115
- check-stage$(2 ) : tidy \
116
- check-stage$(2 ) -rustc \
117
- check-stage$(2 ) -std \
118
- check-stage$(2 ) -rpass \
119
- check-stage$(2 ) -rfail \
120
- check-stage$(2 ) -cfail \
121
- check-stage$(2 ) -bench \
122
- check-stage$(2 ) -pretty \
101
+ check-stage$(1 ) : tidy \
102
+ check-stage$(1 ) -rustc \
103
+ check-stage$(1 ) -std \
104
+ check-stage$(1 ) -rpass \
105
+ check-stage$(1 ) -rfail \
106
+ check-stage$(1 ) -cfail \
107
+ check-stage$(1 ) -bench \
108
+ check-stage$(1 ) -pretty
123
109
110
+ check-stage$(1 ) -std: check-stage$(1 ) -std-dummy
124
111
125
- # Rules for the standard library test runner
112
+ check-stage $( 1 ) -rustc: check-stage $( 1 ) -rustc-dummy
126
113
127
- check-stage$(2 ) -std: test/stdtest. stage$(2 ) .out \
114
+ check-stage$(1 ) -cfail: check- stage$(1 ) -cfail-dummy
128
115
129
- test/stdtest.stage$(2 )$$(X ) : $$(STDTEST_CRATE ) $$(STDTEST_INPUTS ) \
130
- $$(SREQ$(2 )$$(CFG_HOST_TRIPLE ) )
131
- @$$(call E, compile_and_link: $$@ )
132
- $$(STAGE$(2 ) ) -o $$@ $$< --test
116
+ check-stage$(1 ) -rfail: check-stage$(1 ) -rfail-dummy
133
117
134
- test/stdtest.stage$(2 ) .out.tmp: test/stdtest.stage$(2 )$$(X )
135
- @$$(call E, run: $$< )
136
- $$(Q )$$(call CFG_RUN_TEST,$$< ) $$(TESTARGS )
137
- $$(Q ) touch $$@
118
+ check-stage$(1 ) -rpass: check-stage$(1 ) -rpass-dummy
138
119
120
+ check-stage$(1 ) -bench: check-stage$(1 ) -bench-dummy
139
121
140
- # Rules for the rustc test runner
122
+ check-stage $( 1 ) -perf: check-stage $( 1 ) -perf-dummy
141
123
142
- check-stage$(2 ) -rustc: test/rustctest.stage$(2 ) .out \
124
+ check-stage$(1 ) -pretty: check-stage$(1 ) -pretty-rpass \
125
+ check-stage$(1 ) -pretty-rfail \
126
+ check-stage$(1 ) -pretty-bench \
127
+ check-stage$(1 ) -pretty-pretty
143
128
144
- test/rustctest.stage$(2 )$$(X ) : $$(COMPILER_CRATE ) $$(COMPILER_INPUTS ) \
145
- $$(HOST_LIB$(2 ) ) /$$(CFG_RUNTIME ) \
146
- $$(HOST_STDLIB_DEFAULT$(2 ) ) \
147
- $$(HOST_LIB$(2 ) ) /$$(CFG_RUSTLLVM ) \
148
- $$(SREQ$(1 )$$(CFG_HOST_TRIPLE ) )
149
- @$$(call E, compile_and_link: $$@ )
150
- $$(STAGE$(1 ) ) -L $$(HOST_LIB$(2 ) ) -o $$@ $$< --test
129
+ check-stage$(1 ) -pretty-rpass: check-stage$(1 ) -pretty-rpass-dummy
151
130
152
- test/rustctest.stage$(2 ) .out.tmp: test/rustctest.stage$(2 )$$(X )
153
- @$$(call E, run: $$< )
154
- $$(Q )$$(call CFG_RUN,$$(HOST_LIB$(2 ) ) ,$$(CFG_VALGRIND ) $$< ) \
155
- $$(TESTARGS )
156
- $$(Q ) touch $$@
131
+ check-stage$(1 ) -pretty-rfail: check-stage$(1 ) -pretty-rfail-dummy
157
132
133
+ check-stage$(1 ) -pretty-bench: check-stage$(1 ) -pretty-bench-dummy
158
134
159
- # Rules for the cfail/rfail/rpass/bench/perf test runner
135
+ check-stage $( 1 ) -pretty-pretty: check-stage $( 1 ) -pretty-pretty-dummy
160
136
161
- check-stage$(2 ) -cfail: test/compile-fail.stage$(2 ) .out \
162
137
163
- check-stage $( 2 ) -rfail: test/run-fail.stage $( 2 ) .out \
138
+ # Rules for the standard library test runner
164
139
165
- check-stage$(2 ) -rpass: test/run-pass.stage$(2 ) .out \
140
+ test/stdtest.stage$(1 )$$(X ) : $$(STDTEST_CRATE ) $$(STDTEST_INPUTS ) \
141
+ $$(SREQ$(1 )$$(CFG_HOST_TRIPLE ) )
142
+ @$$(call E, compile_and_link: $$@ )
143
+ $$(STAGE$(1 ) ) -o $$@ $$< --test
166
144
167
- check-stage$(2 ) -bench: test/bench.stage$(2 ) .out \
145
+ check-stage$(1 ) -std-dummy: test/stdtest.stage$(1 )$$(X )
146
+ @$$(call E, run: $$< )
147
+ $$(Q )$$(call CFG_RUN_TEST,$$< ) $$(TESTARGS )
168
148
169
- check-stage$(2 ) -perf: test/perf.stage$(2 ) .out \
170
149
171
- check-stage $( 2 ) -pretty-rpass: test/pretty-rpass.stage $( 2 ) .out \
150
+ # Rules for the rustc test runner
172
151
173
- check-stage$(2 ) -pretty-rfail: test/pretty-rfail.stage$(2 ) .out \
152
+ test/rustctest.stage$(1 )$$(X ) : \
153
+ $$(COMPILER_CRATE ) $$(COMPILER_INPUTS ) \
154
+ $$(TARGET_SREQ$(1 )$$(CFG_HOST_TRPILE ) ) \
155
+ $$(HOST_LIB$(1 ) ) /$$(CFG_RUSTLLVM ) \
156
+ $$(TARGET_LIB$(1 )$$(CFG_HOST_TRIPLE ) ) /$$(CFG_RUSTLLVM )
157
+ @$$(call E, compile_and_link: $$@ )
158
+ $$(STAGE$(1 ) ) -o $$@ $$< --test
174
159
175
- check-stage$(2 ) -pretty-bench: test/pretty-bench.stage$(2 ) .out \
160
+ check-stage$(1 ) -rustc-dummy: test/rustctest.stage$(1 )$$(X )
161
+ @$$(call E, run: $$< )
162
+ $$(Q )$$(call CFG_RUN,$$(HOST_LIB$(1 ) ) ,$$(CFG_VALGRIND ) $$< ) \
163
+ $$(TESTARGS )
176
164
177
- check-stage$(2 ) -pretty-pretty: test/pretty-pretty.stage$(2 ) .out \
178
165
179
- check-stage$(2 ) -pretty: check-stage$(2 ) -pretty-rpass \
180
- check-stage$(2 ) -pretty-rfail \
181
- check-stage$(2 ) -pretty-bench \
182
- check-stage$(2 ) -pretty-pretty \
166
+ # Rules for the cfail/rfail/rpass/bench/perf test runner
183
167
184
- CTEST_COMMON_ARGS$(2 ) := --compile-lib-path $$(HOST_LIB$(2 ) ) \
185
- --run-lib-path $$(TARGET_LIB$(2 )$$(CFG_HOST_TRIPLE ) ) \
186
- --rustc-path $$(HOST_BIN$(2 ) ) /rustc$$(X ) \
187
- --stage-id stage$(2 ) \
168
+ CTEST_COMMON_ARGS$(1 ) := --compile-lib-path $$(HOST_LIB$(1 ) ) \
169
+ --run-lib-path $$(TARGET_LIB$(1 )$$(CFG_HOST_TRIPLE ) ) \
170
+ --rustc-path $$(HOST_BIN$(1 ) ) /rustc$$(X ) \
171
+ --stage-id stage$(1 ) \
188
172
--rustcflags "$$(CFG_RUSTC_FLAGS ) " \
189
173
$$(CTEST_TESTARGS ) \
190
174
191
- CFAIL_ARGS$(2 ) := $$(CTEST_COMMON_ARGS$(2 ) ) \
175
+ CFAIL_ARGS$(1 ) := $$(CTEST_COMMON_ARGS$(1 ) ) \
192
176
--src-base $$(S ) src/test/compile-fail/ \
193
177
--build-base test/compile-fail/ \
194
178
--mode compile-fail \
195
179
196
- RFAIL_ARGS$(2 ) := $$(CTEST_COMMON_ARGS$(2 ) ) \
180
+ RFAIL_ARGS$(1 ) := $$(CTEST_COMMON_ARGS$(1 ) ) \
197
181
--src-base $$(S ) src/test/run-fail/ \
198
182
--build-base test/run-fail/ \
199
183
--mode run-fail \
200
184
$$(CTEST_RUNTOOL ) \
201
185
202
- RPASS_ARGS$(2 ) := $$(CTEST_COMMON_ARGS$(2 ) ) \
186
+ RPASS_ARGS$(1 ) := $$(CTEST_COMMON_ARGS$(1 ) ) \
203
187
--src-base $$(S ) src/test/run-pass/ \
204
188
--build-base test/run-pass/ \
205
189
--mode run-pass \
206
190
$$(CTEST_RUNTOOL ) \
207
191
208
- BENCH_ARGS$(2 ) := $$(CTEST_COMMON_ARGS$(2 ) ) \
192
+ BENCH_ARGS$(1 ) := $$(CTEST_COMMON_ARGS$(1 ) ) \
209
193
--src-base $$(S ) src/test/bench/ \
210
194
--build-base test/bench/ \
211
195
--mode run-pass \
212
196
$$(CTEST_RUNTOOL ) \
213
197
214
- PERF_ARGS$(2 ) := $$(CTEST_COMMON_ARGS$(2 ) ) \
198
+ PERF_ARGS$(1 ) := $$(CTEST_COMMON_ARGS$(1 ) ) \
215
199
--src-base $$(S ) src/test/bench/ \
216
200
--build-base test/perf/ \
217
201
--mode run-pass \
218
202
$$(CTEST_PERF_RUNTOOL ) \
219
203
220
- PRETTY_RPASS_ARGS$(2 ) := $$(CTEST_COMMON_ARGS$(2 ) ) \
204
+ PRETTY_RPASS_ARGS$(1 ) := $$(CTEST_COMMON_ARGS$(1 ) ) \
221
205
--src-base $$(S ) src/test/run-pass/ \
222
206
--build-base test/run-pass/ \
223
207
--mode pretty \
224
208
225
- PRETTY_RFAIL_ARGS$(2 ) := $$(CTEST_COMMON_ARGS$(2 ) ) \
209
+ PRETTY_RFAIL_ARGS$(1 ) := $$(CTEST_COMMON_ARGS$(1 ) ) \
226
210
--src-base $$(S ) src/test/run-fail/ \
227
211
--build-base test/run-fail/ \
228
212
--mode pretty \
229
213
230
- PRETTY_BENCH_ARGS$(2 ) := $$(CTEST_COMMON_ARGS$(2 ) ) \
214
+ PRETTY_BENCH_ARGS$(1 ) := $$(CTEST_COMMON_ARGS$(1 ) ) \
231
215
--src-base $$(S ) src/test/bench/ \
232
216
--build-base test/bench/ \
233
217
--mode pretty \
234
218
235
- PRETTY_PRETTY_ARGS$(2 ) := $$(CTEST_COMMON_ARGS$(2 ) ) \
219
+ PRETTY_PRETTY_ARGS$(1 ) := $$(CTEST_COMMON_ARGS$(1 ) ) \
236
220
--src-base $$(S ) src/test/pretty/ \
237
221
--build-base test/pretty/ \
238
222
--mode pretty \
239
223
240
- test/compile-fail. stage$(2 ) .out.tmp : $$(HOST_BIN$(2 ) ) /compiletest$$(X ) \
224
+ check- stage$(1 ) -cfail-dummy : $$(HOST_BIN$(1 ) ) /compiletest$$(X ) \
241
225
$$(CFAIL_TESTS )
242
226
@$$(call E, run: $$< )
243
- $$(Q )$$(call CFG_RUN_CTEST,$(2 ) ,$$< ) $$(CFAIL_ARGS$(2 ) )
244
- $$(Q ) touch $$@
227
+ $$(Q )$$(call CFG_RUN_CTEST,$(1 ) ,$$< ) $$(CFAIL_ARGS$(1 ) )
245
228
246
- test/run-fail. stage$(2 ) .out.tmp : $$(HOST_BIN$(2 ) ) /compiletest$$(X ) \
229
+ check- stage$(1 ) -rfail-dummy : $$(HOST_BIN$(1 ) ) /compiletest$$(X ) \
247
230
$$(RFAIL_TESTS )
248
231
@$$(call E, run: $$< )
249
- $$(Q )$$(call CFG_RUN_CTEST,$(2 ) ,$$< ) $$(RFAIL_ARGS$(2 ) )
250
- $$(Q ) touch $$@
232
+ $$(Q )$$(call CFG_RUN_CTEST,$(1 ) ,$$< ) $$(RFAIL_ARGS$(1 ) )
251
233
252
- test/run-pass. stage$(2 ) .out.tmp : $$(HOST_BIN$(2 ) ) /compiletest$$(X ) \
234
+ check- stage$(1 ) -rpass-dummy : $$(HOST_BIN$(1 ) ) /compiletest$$(X ) \
253
235
$$(RPASS_TESTS )
254
236
@$$(call E, run: $$< )
255
- $$(Q )$$(call CFG_RUN_CTEST,$(2 ) ,$$< ) $$(RPASS_ARGS$(2 ) )
256
- $$(Q ) touch $$@
237
+ $$(Q )$$(call CFG_RUN_CTEST,$(1 ) ,$$< ) $$(RPASS_ARGS$(1 ) )
257
238
258
- test/bench. stage$(2 ) .out.tmp : $$(HOST_BIN$(2 ) ) /compiletest$$(X ) \
239
+ check- stage$(1 ) -bench-dummy : $$(HOST_BIN$(1 ) ) /compiletest$$(X ) \
259
240
$$(BENCH_TESTS )
260
241
@$$(call E, run: $$< )
261
- $$(Q )$$(call CFG_RUN_CTEST,$(2 ) ,$$< ) $$(BENCH_ARGS$(2 ) )
262
- $$(Q ) touch $$@
242
+ $$(Q )$$(call CFG_RUN_CTEST,$(1 ) ,$$< ) $$(BENCH_ARGS$(1 ) )
263
243
264
- test/perf. stage$(2 ) .out.tmp : $$(HOST_BIN$(2 ) ) /compiletest$$(X ) \
244
+ check- stage$(1 ) -perf-dummy : $$(HOST_BIN$(1 ) ) /compiletest$$(X ) \
265
245
$$(BENCH_TESTS )
266
246
@$$(call E, perf: $$< )
267
- $$(Q )$$(call CFG_RUN_CTEST,$(2 ) ,$$< ) $$(PERF_ARGS$(2 ) )
268
- $$(Q ) touch $$@
247
+ $$(Q )$$(call CFG_RUN_CTEST,$(1 ) ,$$< ) $$(PERF_ARGS$(1 ) )
269
248
270
- test/pretty-rpass. stage$(2 ) .out.tmp : $$(HOST_BIN$(2 ) ) /compiletest$$(X ) \
249
+ check- stage$(1 ) -pretty-rpass-dummy : $$(HOST_BIN$(1 ) ) /compiletest$$(X ) \
271
250
$$(RPASS_TESTS )
272
251
@$$(call E, run: $$< )
273
- $$(Q )$$(call CFG_RUN_CTEST,$(2 ) ,$$< ) $$(PRETTY_RPASS_ARGS$(2 ) )
274
- $$(Q ) touch $$@
252
+ $$(Q )$$(call CFG_RUN_CTEST,$(1 ) ,$$< ) $$(PRETTY_RPASS_ARGS$(1 ) )
275
253
276
- test/pretty-rfail. stage$(2 ) .out.tmp : $$(HOST_BIN$(2 ) ) /compiletest$$(X ) \
254
+ check- stage$(1 ) -pretty-rfail-dummy : $$(HOST_BIN$(1 ) ) /compiletest$$(X ) \
277
255
$$(RFAIL_TESTS )
278
256
@$$(call E, run: $$< )
279
- $$(Q )$$(call CFG_RUN_CTEST,$(2 ) ,$$< ) $$(PRETTY_RFAIL_ARGS$(2 ) )
280
- $$(Q ) touch $$@
257
+ $$(Q )$$(call CFG_RUN_CTEST,$(1 ) ,$$< ) $$(PRETTY_RFAIL_ARGS$(1 ) )
281
258
282
- test/pretty-bench. stage$(2 ) .out.tmp : $$(HOST_BIN$(2 ) ) /compiletest$$(X ) \
259
+ check- stage$(1 ) -pretty-bench-dummy : $$(HOST_BIN$(1 ) ) /compiletest$$(X ) \
283
260
$$(BENCH_TESTS )
284
261
@$$(call E, run: $$< )
285
- $$(Q )$$(call CFG_RUN_CTEST,$(2 ) ,$$< ) $$(PRETTY_BENCH_ARGS$(2 ) )
286
- $$(Q ) touch $$@
262
+ $$(Q )$$(call CFG_RUN_CTEST,$(1 ) ,$$< ) $$(PRETTY_BENCH_ARGS$(1 ) )
287
263
288
- test/pretty-pretty. stage$(2 ) .out.tmp : $$(HOST_BIN$(2 ) ) /compiletest$$(X ) \
264
+ check- stage$(1 ) -pretty-pretty-dummy : $$(HOST_BIN$(1 ) ) /compiletest$$(X ) \
289
265
$$(PRETTY_TESTS )
290
266
@$$(call E, run: $$< )
291
- $$(Q )$$(call CFG_RUN_CTEST,$(2 ) ,$$< ) $$(PRETTY_PRETTY_ARGS$(2 ) )
292
- $$(Q ) touch $$@
267
+ $$(Q )$$(call CFG_RUN_CTEST,$(1 ) ,$$< ) $$(PRETTY_PRETTY_ARGS$(1 ) )
293
268
294
269
endef
295
270
296
271
# Instantiate the template for stage 0, 1, 2, 3
297
272
298
- $(eval $(call TEST_STAGEN,0,0 ))
299
- $(eval $(call TEST_STAGEN,0, 1))
300
- $(eval $(call TEST_STAGEN,1, 2))
301
- $(eval $(call TEST_STAGEN,2, 3))
273
+ $(eval $(call TEST_STAGEN,0))
274
+ $(eval $(call TEST_STAGEN,1))
275
+ $(eval $(call TEST_STAGEN,2))
276
+ $(eval $(call TEST_STAGEN,3))
302
277
303
278
304
279
# #####################################################################
0 commit comments