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

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

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

10 11
COQ_TEST=$(COQTOP) $(COQDEBUG) -batch -test-mode

12
$(TESTFILES:.v=.vo): %.vo: %.v $(VFILES:.v=.vo)
13
	$(SHOW)COQTOP [test] $<
14
	$(HIDE)TEST="$$(basename -s .v $<)" && \
Ralf Jung's avatar
Ralf Jung committed
15
	  TMPFILE="$$(mktemp)" && \
16
	  $(TIMER) $(COQ_TEST) $(TIMING_ARG) $(COQFLAGS) $(COQLIBS) -load-vernac-source $< $(TIMING_EXTRA) > "$$TMPFILE" && \
17
	  (diff -u "tests/$$TEST.ref" "$$TMPFILE" || (rm "tests/$$TEST.vo" "$$TMPFILE" && exit 1)) && \
18
	  rm "$$TMPFILE"
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)
25
	$(SHOW)COQTOP [ref] $<
26
	$(HIDE)TEST="$$(basename -s .v $<)" && \
27
	  $(TIMER) $(COQ_TEST) $(TIMING_ARG) $(COQFLAGS) $(COQLIBS) -load-vernac-source $< $(TIMING_EXTRA) > "tests/$$TEST.ref"