src/Makefile.am, src/test-base.lisp: Check version numbers match.
[sod] / src / Makefile.am
index b5150be..b10f673 100644 (file)
@@ -82,26 +82,61 @@ dist_pkglispsrc_DATA        += class-output.lisp
 
 ## Method generation.
 dist_pkglispsrc_DATA   += method-proto.lisp method-impl.lisp
+dist_pkglispsrc_DATA   += method-aggregate.lisp
 
 ## User interface.
 dist_pkglispsrc_DATA   += sod-frontend.asd
 dist_pkglispsrc_DATA   += frontend.lisp optparse.lisp
 
+## Interactive testing.
+dist_pkglispsrc_DATA   += debug.lisp
+
 ###--------------------------------------------------------------------------
 ### Constructing an output image.
 
-CLEANFILES             += *.$(FASL_TYPE)
+CLEANFILES             += *.$(fasl) parser/*.$(fasl)
 
 ## Building the executable image.
 bin_PROGRAMS           += sod
 sod_SOURCES             =
 sod: $(dist_pkglispsrc_DATA)
-       set -ex; true_srcdir=$$(cd $(srcdir); pwd); \
+       $(V_DUMP)true_srcdir=$$(cd $(srcdir); pwd); \
        ASDF_OUTPUT_TRANSLATIONS=$$true_srcdir:$(abs_builddir): \
-       $(CL_LAUNCH) -o sod -d ! -l $(LISPSYS) +I -S $$true_srcdir/ \
+       $(CL_LAUNCH) -o sod -d ! -l $(LISPSYS) +I -S $$true_srcdir/: \
                -s sod-frontend -r sod-frontend:main
 
 ###--------------------------------------------------------------------------
+### Unit testing.
+
+## The system definition.
+EXTRA_DIST             += sod-test.asd
+
+## Basic utilities.
+EXTRA_DIST             += test-base.lisp
+
+## Parser tests.
+EXTRA_DIST             += parser/parser-test.lisp
+EXTRA_DIST             += parser/scanner-charbuf-test.lisp
+
+## Translator tests.
+EXTRA_DIST             += c-types-test.lisp
+EXTRA_DIST             += codegen-test.lisp
+EXTRA_DIST             += lexer-test.lisp
+
+## Running the Lisp tests.
+check-local:
+       $(V_TEST)true_srcdir=$$(cd $(srcdir); pwd); \
+       ASDF_OUTPUT_TRANSLATIONS=$$true_srcdir:$(abs_builddir): \
+       $(CL_LAUNCH) -l $(LISPSYS) -s sod-test +I -S $$true_srcdir/: \
+               -i '(handler-case ;\
+                     (progn ;\
+                       (setf sod-test:*build-version* "$(VERSION)") ;\
+                       (asdf:test-system "sod")) ;\
+                     (error (cond) ;\
+                       (format *error-output* "ERR: ~A~%" cond) ;\
+                       (cl-launch:quit 1)))'
+
+###--------------------------------------------------------------------------
 ### Installation.
 
 ## We want a symlink $(lispsysdir)/sod.asd -> $(lispsrcdir)/sod/sod.asd.  It
@@ -127,7 +162,7 @@ install-data-local:
        dots=$$(echo $$fwd | sed 's/[^ ][^ ]*/../g'); \
        rel=$$(echo $$dots $$twd | tr " " "/"); \
        echo >&2 "ln -s $$rel $$to"; \
-       ln -s $$rel $(DESTDIR)$$from.new; \
-       mv $(DESTDIR)$$from.new $(DESTDIR)$$from
+       ln -s $$rel $(DESTDIR)$$from/sod.asd.new; \
+       mv $(DESTDIR)$$from/sod.asd.new $(DESTDIR)$$from/sod.asd
 
 ###----- That's all, folks --------------------------------------------------