From 19df3e0001e75ce2decece2a177bf9711eab9dd7 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Sun, 30 Aug 2015 10:58:38 +0100 Subject: [PATCH 1/1] src/Makefile.am, src/test-base.lisp: Check version numbers match. We have version numbers in two places, and that's no good, but I can't see a good way of generating the Lisp package version from the Git version, so I'm just going to add a test that they match. It's not a perfect test, but it ought to do. --- src/Makefile.am | 4 +++- src/test-base.lisp | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/Makefile.am b/src/Makefile.am index 5b8aa21..b10f673 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -129,7 +129,9 @@ check-local: ASDF_OUTPUT_TRANSLATIONS=$$true_srcdir:$(abs_builddir): \ $(CL_LAUNCH) -l $(LISPSYS) -s sod-test +I -S $$true_srcdir/: \ -i '(handler-case ;\ - (asdf:test-system "sod") ;\ + (progn ;\ + (setf sod-test:*build-version* "$(VERSION)") ;\ + (asdf:test-system "sod")) ;\ (error (cond) ;\ (format *error-output* "ERR: ~A~%" cond) ;\ (cl-launch:quit 1)))' diff --git a/src/test-base.lisp b/src/test-base.lisp index ffc8e19..f7210ab 100644 --- a/src/test-base.lisp +++ b/src/test-base.lisp @@ -52,6 +52,20 @@ rather than `~A'." object print string)))) +(defclass base-test (test-case) ()) +(add-test *sod-test-suite* (get-suite base-test)) + +(export '*build-version*) +(defvar *build-version* nil) + +(def-test-method check-version ((test base-test) :run nil) + (unless (or (null *build-version*) + (and (>= (length *build-version*) (length *sod-version*)) + (string= *build-version* *sod-version* + :end1 (length *sod-version*)))) + (failure "Build version ~A doesn't match package version ~A." + *build-version* *sod-version*))) + (defun run-tests (&optional which) (textui-test-run (acond ((null which) *sod-test-suite*) -- 2.11.0