changeset 661:72810ed81817

Improve test infrastructure a little bit Test bindings as well as the basics. Again, the implemented tests are a bit linux-specific, but since you run out of disk space on OS X long before getting to the bindings tests, I'm not too worried
author mas01cr
date Fri, 08 Jan 2010 21:09:01 +0000
parents 98db3bff21a0
children 01af8c56eb8d
files Makefile bindings/pd/Makefile bindings/sb-alien/Makefile bindings/sb-alien/tests.lisp
diffstat 4 files changed, 29 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Wed Jan 06 17:28:01 2010 +0000
+++ b/Makefile	Fri Jan 08 21:09:01 2010 +0000
@@ -6,6 +6,9 @@
 GSL_INCLUDE=$(shell pkg-config --cflags gsl)
 LIBGSL=$(shell pkg-config --libs gsl)
 
+TESTDIRS=tests libtests
+BINDINGDIRS=bindings/sb-alien bindings/pd
+
 PREFIX=/usr/local
 EXEC_PREFIX=$(PREFIX)
 LIBDIR=$(EXEC_PREFIX)/lib
@@ -85,8 +88,8 @@
 	-rm HELP.txt
 	-rm $(EXECUTABLE) $(EXECUTABLE).1 $(OBJS)
 	-rm xthresh
-	-sh -c "cd tests && sh ./clean.sh"
-	-sh -c "cd libtests && sh ./clean.sh"
+	-for d in $(TESTDIRS); do (cd $$d && sh ./clean.sh); done
+	-for d in $(BINDINGDIRS); do (cd $$d && $(MAKE) clean); done
 	-rm $(LIBRARY)
 	-rm tags
 
@@ -95,8 +98,8 @@
 	-rm -rf audioDB.dump
 
 test: $(EXECUTABLE) $(LIBRARY)
-	sh -c "cd libtests && sh ./run-tests.sh"
-	sh -c "cd tests && sh ./run-tests.sh"
+	for d in $(TESTDIRS); do (cd $$d && sh ./run-tests.sh); done
+	for d in $(BINDINGDIRS); do (cd $$d && $(MAKE) test); done
 
 xthresh: xthresh.c
 	$(CC) -o $@ $(CFLAGS) $(GSL_INCLUDE) $(LIBGSL) $<
--- a/bindings/pd/Makefile	Wed Jan 06 17:28:01 2010 +0000
+++ b/bindings/pd/Makefile	Fri Jan 08 21:09:01 2010 +0000
@@ -11,4 +11,4 @@
 	rm -f adbpd.o
 	rm -f adbpd.pd_linux
 
-
+test:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bindings/sb-alien/Makefile	Fri Jan 08 21:09:01 2010 +0000
@@ -0,0 +1,11 @@
+SBCL=sbcl
+
+all:
+	$(SBCL) --eval '(require :asdf)' --eval '(require :sb-adb)' --eval '(quit)'
+
+clean:
+	-rm *.fasl
+	-rm testdb*
+
+test: ../../libaudioDB.so.0.0
+	$(SBCL) --disable-debugger --eval '(require :asdf)' --eval '(require :sb-adb)'  --load tests.lisp --eval '(sb-adb::run-tests)' --eval '(quit)'
--- a/bindings/sb-alien/tests.lisp	Wed Jan 06 17:28:01 2010 +0000
+++ b/bindings/sb-alien/tests.lisp	Fri Jan 08 21:09:01 2010 +0000
@@ -1,5 +1,7 @@
 (in-package "SB-ADB")
 
+(load-shared-object "../../libaudioDB.so.0.0")
+
 (define-symbol-macro %default-query-args nil)
 (defmacro with-default-query-args (args &body body &environment env)
   (let ((current-args (macroexpand '%default-query-args env)))
@@ -153,3 +155,11 @@
       (assert-erroneous (retrieve "testfeature" db))
       (assert (equalp (retrieve "testfeature01" db) datum1))
       (assert (equalp (retrieve "testfeature10" db) datum2)))))
+
+(defun run-tests ()
+  (test-0003)
+  (test-0004)
+  (test-0010)
+  (test-0031)
+  (test-0036)
+  (test-0048))