aboutsummaryrefslogtreecommitdiff
path: root/mathcomp/Makefile.test-suite.coq.local
diff options
context:
space:
mode:
authorEnrico Tassi2019-11-18 17:40:51 +0100
committerEnrico Tassi2020-09-07 16:34:30 +0200
commitbc0a71056c24b29c8289395ee01740bb2ef7ad8d (patch)
tree4afbdf7fd945363b5b68bbd85b9f44bab8762fe4 /mathcomp/Makefile.test-suite.coq.local
parent9adc523e89022fc6ac77471fb3fe381ad344d060 (diff)
[test suite] infrastructure to test how some statements are printed
Diffstat (limited to 'mathcomp/Makefile.test-suite.coq.local')
-rw-r--r--mathcomp/Makefile.test-suite.coq.local22
1 files changed, 22 insertions, 0 deletions
diff --git a/mathcomp/Makefile.test-suite.coq.local b/mathcomp/Makefile.test-suite.coq.local
new file mode 100644
index 0000000..5a1ec43
--- /dev/null
+++ b/mathcomp/Makefile.test-suite.coq.local
@@ -0,0 +1,22 @@
+OUTPUT_TESTS=test_suite/output.v
+
+OUTPUT_ARTIFACTS=$(OUTPUT_TESTS:%.v=%.v.out.new)
+
+COQ_VERSION=$(shell $(COQC) -print-version | cut -d ' ' -f 1 | cut -d '.' -f 1-2)
+
+# Given a file f we compare its compilation output f.out.new with
+# f.out.COQ_VERSION (or f.out if f.out.COQ_VERSION does not exist)
+post-all:: $(OUTPUT_ARTIFACTS)
+ @for f in $(OUTPUT_TESTS); do\
+ if [ -e $$f.out.$(COQ_VERSION) ]; then REFERENCE=$$f.out.$(COQ_VERSION);\
+ else REFERENCE=$$f.out; fi;\
+ diff -u $$REFERENCE $$f.out.new > /dev/null;\
+ if [ $$? -ne 0 ]; \
+ then echo "Output of file $$f differs!";\
+ diff -u $$REFERENCE $$f.out.new;\
+ exit 1;\
+ fi;\
+ done
+
+$(OUTPUT_ARTIFACTS): %.v.out.new: %.v all/all.vo
+ $(COQC) $(COQFLAGS) $(COQLIBS) $< > $<.out.new \ No newline at end of file