Skip to content

Commit fc12577

Browse files
committed
Add makefile rules to run compile-fail tests on .rc files
There's even more duplication now, but I'm reluctant to touch it since it's easy to subtly break the build rules
1 parent 4b8fba5 commit fc12577

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

mk/tests.mk

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,3 +264,27 @@ test/compile-fail/%.stage2.out.tmp: test/compile-fail/%.rs $(SREQ2)
264264
$(STAGE2) -c -o $(@:.o=$(X)) $< >$@ 2>&1; test $$? -ne 0
265265
$(Q)grep --text --quiet \
266266
"$$(grep error-pattern $< | cut -d : -f 2- | tr -d '\n\r')" $@
267+
268+
test/compile-fail/%.stage0.out.tmp: test/compile-fail/%.rc $(SREQ0)
269+
@$(call E, compile-fail [stage0]: $@)
270+
$(Q)grep -q error-pattern $<
271+
$(Q)rm -f $@
272+
$(STAGE0) -c -o $(@:.o=$(X)) $< >$@ 2>&1; test $$? -ne 0
273+
$(Q)grep --text --quiet \
274+
"$$(grep error-pattern $< | cut -d : -f 2- | tr -d '\n\r')" $@
275+
276+
test/compile-fail/%.stage1.out.tmp: test/compile-fail/%.rc $(SREQ1)
277+
@$(call E, compile-fail [stage1]: $@)
278+
$(Q)grep -q error-pattern $<
279+
$(Q)rm -f $@
280+
$(STAGE1) -c -o $(@:.o=$(X)) $< >$@ 2>&1; test $$? -ne 0
281+
$(Q)grep --text --quiet \
282+
"$$(grep error-pattern $< | cut -d : -f 2- | tr -d '\n\r')" $@
283+
284+
test/compile-fail/%.stage2.out.tmp: test/compile-fail/%.rc $(SREQ2)
285+
@$(call E, compile-fail [stage2]: $@)
286+
$(Q)grep -q error-pattern $<
287+
$(Q)rm -f $@
288+
$(STAGE2) -c -o $(@:.o=$(X)) $< >$@ 2>&1; test $$? -ne 0
289+
$(Q)grep --text --quiet \
290+
"$$(grep error-pattern $< | cut -d : -f 2- | tr -d '\n\r')" $@

0 commit comments

Comments
 (0)