From 4ea41512fcb12aba92bb17bf6f2235d23c06c51a Mon Sep 17 00:00:00 2001 From: Graydon Hoare Date: Fri, 2 Jul 2010 12:54:01 -0700 Subject: [PATCH] Change make rules around running tests to not produce an .out file if test-run fails. --- src/Makefile | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/Makefile b/src/Makefile index cd19ea86117..c9b8bddff9a 100644 --- a/src/Makefile +++ b/src/Makefile @@ -567,11 +567,17 @@ endif REQ := $(CFG_BOOT) $(CFG_RUNTIME) $(CFG_STDLIB) BOOT := $(CFG_QUIET)OCAMLRUNPARAM="b1" $(CFG_BOOT) $(CFG_BOOT_FLAGS) -test/run-pass/%.out: test/run-pass/%$(CFG_EXE_SUFFIX) $(CFG_RUNTIME) +# Cancel the implicit .out rule in GNU make. +%.out: % + +%.out: %.out.tmp + $(CFG_QUIET)mv $< $@ + +test/run-pass/%.out.tmp: test/run-pass/%$(CFG_EXE_SUFFIX) $(CFG_RUNTIME) @$(call CFG_ECHO, run: $<) $(CFG_QUIET)$(call CFG_RUN_TARG, $<) > $@ -test/run-fail/%.out: test/run-fail/%$(CFG_EXE_SUFFIX) $(CFG_RUNTIME) +test/run-fail/%.out.tmp: test/run-fail/%$(CFG_EXE_SUFFIX) $(CFG_RUNTIME) @$(call CFG_ECHO, run: $<) $(CFG_QUIET)rm -f $@ $(CFG_QUIET)$(call CFG_RUN_TARG, $<) >$@ 2>&1 ; X=$$? ; \ @@ -580,14 +586,14 @@ test/run-fail/%.out: test/run-fail/%$(CFG_EXE_SUFFIX) $(CFG_RUNTIME) "`awk -F: '/error-pattern/ { print $$2 }' \ $(basename $(basename $@)).rs | tr -d '\n\r'`" $@ -test/compile-fail/%.x86.out: test/compile-fail/%.rs $(REQ) +test/compile-fail/%.x86.out.tmp: test/compile-fail/%.rs $(REQ) @$(call CFG_ECHO, compile [x86]: $<) $(CFG_QUIET)rm -f $@ $(BOOT) -o $(@:.out=$(CFG_EXE_SUFFIX)) $< >$@ 2>&1 || true $(CFG_QUIET)grep --text --quiet \ "`awk -F: '/error-pattern/ { print $$2 }' $< | tr -d '\n\r'`" $@ -test/compile-fail/%.llvm.out: test/compile-fail/%.rs $(REQ) +test/compile-fail/%.llvm.out.tmp: test/compile-fail/%.rs $(REQ) @$(call CFG_ECHO, compile [llvm]: $<) $(CFG_QUIET)rm -f $@ $(BOOT) -o $(@:.out=$(CFG_EXE_SUFFIX)) $< >$@ 2>&1 || true