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.
ASDF_OUTPUT_TRANSLATIONS=$$true_srcdir:$(abs_builddir): \
$(CL_LAUNCH) -l $(LISPSYS) -s sod-test +I -S $$true_srcdir/: \
-i '(handler-case ;\
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)))'
(error (cond) ;\
(format *error-output* "ERR: ~A~%" cond) ;\
(cl-launch:quit 1)))'
rather than `~A'."
object print string))))
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*)
(defun run-tests (&optional which)
(textui-test-run (acond
((null which) *sod-test-suite*)