Makefile.coq.local 833 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12
# run tests after real-all
post-all:: test

# the test suite
TESTFILES=$(wildcard tests/*.v)

test: $(TESTFILES:.v=.vo)
.PHONY: test

$(TESTFILES:.v=.vo): %.vo: %.v $(VFILES:.v=.vo)
	$(SHOW)COQC [test] $<
	$(HIDE)TEST="$$(basename -s .v $<)" && \
Ralf Jung's avatar
Ralf Jung committed
13
	  TMPFILE="$$(mktemp)" && \
14
	  $(TIMER) $(COQC) $(COQDEBUG) $(TIMING_ARG) $(COQFLAGS) $(COQLIBS) $< $(TIMING_EXTRA) > "$$TMPFILE" && \
15
	  (diff -u "tests/$$TEST.ref" "$$TMPFILE" || (rm "tests/$$TEST.vo" "$$TMPFILE" && exit 1)) && \
16
	  rm "$$TMPFILE"
17 18 19 20 21 22 23 24

# a target, for convenience sake, to create the .ref file with the current output
ref: $(TESTFILES:.v=.ref)
.PHONY: ref

tests/%.ref: tests/%.v $(VFILES:.v=.vo)
	$(SHOW)COQC [ref] $<
	$(HIDE)TEST="$$(basename -s .v $<)" && \
25
	  $(TIMER) $(COQC) $(COQDEBUG) $(TIMING_ARG) $(COQFLAGS) $(COQLIBS) $< $(TIMING_EXTRA) > "tests/$$TEST.ref"