From dba6f901e662f4f754975a4016a91a03577a6173 Mon Sep 17 00:00:00 2001
From: Ralf Jung <jung@mpi-sws.org>
Date: Thu, 17 May 2018 16:28:46 +0200
Subject: [PATCH] clean up test tmpfile; remove .vo if test failed so it gets
 re-run

---
 Makefile.coq.local | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Makefile.coq.local b/Makefile.coq.local
index f4aa7556d..5b0ccce6a 100644
--- a/Makefile.coq.local
+++ b/Makefile.coq.local
@@ -12,7 +12,8 @@ $(TESTFILES:.v=.vo): %.vo: %.v $(VFILES:.v=.vo)
 	$(HIDE)TEST="$$(basename -s .v $<)" && \
 	  TMPFILE="$$(tempfile -p test- -s "-$$TEST")" && \
 	  $(TIMER) $(COQC) $(COQDEBUG) $(TIMING_ARG) $(COQFLAGS) $(COQLIBS) $< $(TIMING_EXTRA) > "$$TMPFILE" && \
-	  diff --color=auto -u "tests/$$TEST.ref" "$$TMPFILE"
+	  (diff --color=auto -u "tests/$$TEST.ref" "$$TMPFILE" || (rm "tests/$$TEST.vo" "$$TMPFILE" && exit 1)) && \
+	  rm "$$TMPFILE"
 
 # a target, for convenience sake, to create the .ref file with the current output
 ref: $(TESTFILES:.v=.ref)
-- 
GitLab