Author: ksprotte
Date: Fri Jan 18 10:05:07 2008
New Revision: 2355
Added:
branches/bos/projects/bos/test/
branches/bos/projects/bos/test/allocation-cache.lisp
branches/bos/projects/bos/test/bos.test.asd
branches/bos/projects/bos/test/packages.lisp
branches/bos/projects/bos/test/suites.lisp
Modified:
branches/bos/projects/bos/Makefile
branches/bos/projects/bos/build.lisp
Log:
basic test-suite setup; run: make test
Modified: branches/bos/projects/bos/Makefile
==============================================================================
--- branches/bos/projects/bos/Makefile (original)
+++ branches/bos/projects/bos/Makefile Fri Jan 18 10:05:07 2008
@@ -4,9 +4,16 @@
cmucl.core:
lisp -load make-base-lisp.lisp
-bos.core: cmucl.core
+bos.core: cmucl.core build.sh load.lisp build.lisp
./build.sh
+# test
+
+.PHONY: test
+test:
+ lisp -core bos.core -test -slime
+
+# various cleaning stuff
.PHONY: cleancore
cleancore:
rm -f cmucl.core
Modified: branches/bos/projects/bos/build.lisp
==============================================================================
--- branches/bos/projects/bos/build.lisp (original)
+++ branches/bos/projects/bos/build.lisp Fri Jan 18 10:05:07 2008
@@ -2,7 +2,11 @@
(handler-bind ((style-warning #'muffle-warning))
(asdf:operate 'asdf:load-op :aserve)
- (asdf:operate 'asdf:load-op :bos.web))
+ (asdf:operate 'asdf:load-op :bos.web)
+ ;; FIXME: fuer das Deployment ?
+ ;; BOS tests
+ (asdf:operate 'asdf:load-op :fiveam)
+ (asdf:oos 'asdf:load-op :bos.test))
;;;
;;; Lisp-Image fuer das Deployment dumpen
@@ -25,6 +29,7 @@
(define-toggle-switch "nostart" *webserver* t)
(define-toggle-switch "slime" *slime* nil)
(define-toggle-switch "cert-daemon" *cert-daemon* nil)
+(define-toggle-switch "test" *run-tests* nil)
(defun start-webserver ()
(apply #'bos.m2::reinit (read-configuration "m2.rc"))
@@ -54,6 +59,13 @@
(fix-dpd)
(asdf:oos 'asdf:load-op :bos.web)
(format t "BOS Online-System~%")
+ (when *run-tests*
+ (asdf:oos 'asdf:load-op :bos.test)
+ (format t "Starting BOS tests...~%")
+ (eval (read-from-string "(5am:run! :bos.test)"))
+ (terpri)
+ (finish-output)
+ (cl-user::quit))
(when *cert-daemon*
(format t "; starting certificate generation daemon, slime and webserver not started~%")
(bos.m2.cert-generator:cert-daemon))
@@ -61,9 +73,13 @@
(start-slime))
(when *webserver*
(start-webserver))
- (if (or *slime* *webserver*)
- (mp::startup-idle-and-top-level-loops))
- (lisp::%top-level))
+ (cond
+ (*run-tests*
+ (asdf:oos 'asdf:load-op :bos.test)
+ (eval (read-from-string "(5am:run! :bos.test)")))
+ (t (when (or *slime* *webserver*)
+ (mp::startup-idle-and-top-level-loops))
+ (lisp::%top-level))))
(setf *default-pathname-defaults* #p"")
(when (probe-file "bos.core")
Added: branches/bos/projects/bos/test/allocation-cache.lisp
==============================================================================
--- (empty file)
+++ branches/bos/projects/bos/test/allocation-cache.lisp Fri Jan 18 10:05:07 2008
@@ -0,0 +1,9 @@
+(in-package :bos.test)
+(in-suite :bos.test.allocation-cache)
+
+(test dummy
+ (is (= 1 1)))
+
+(test dummy.2
+ (is (= 1 2)))
+
Added: branches/bos/projects/bos/test/bos.test.asd
==============================================================================
--- (empty file)
+++ branches/bos/projects/bos/test/bos.test.asd Fri Jan 18 10:05:07 2008
@@ -0,0 +1,10 @@
+(in-package :cl-user)
+
+(asdf:defsystem :bos.test
+ :description "BOS Online-System test-suite"
+ :depends-on (:bos.web :fiveam)
+ :components ((:file "packages")
+ (:file "suites" :depends-on ("packages"))
+ (:file "allocation-cache" :depends-on ("suites"))
+ ;; (:file "utils" :depends-on ("config"))
+ ))
Added: branches/bos/projects/bos/test/packages.lisp
==============================================================================
--- (empty file)
+++ branches/bos/projects/bos/test/packages.lisp Fri Jan 18 10:05:07 2008
@@ -0,0 +1,18 @@
+(defpackage :bos.test
+ (:use :cl
+ :fiveam
+ :iterate
+ ;; maybe later
+ ;; :cl-ppcre
+ ;; :cl-interpol
+ :bknr.utils
+ :bknr.indices
+ :bknr.datastore
+ :bknr.user
+ :bknr.web
+ :bknr.images
+ :bknr.statistics
+ :bknr.rss
+ :bos.m2.config
+ ))
+
Added: branches/bos/projects/bos/test/suites.lisp
==============================================================================
--- (empty file)
+++ branches/bos/projects/bos/test/suites.lisp Fri Jan 18 10:05:07 2008
@@ -0,0 +1,9 @@
+(in-package :bos.test)
+
+(def-suite :bos.test
+ :description "The root suite. Contains all tests.")
+
+(def-suite :bos.test.allocation-cache
+ :in :bos.test
+ :description "Tests for the newly introduced allocation-cache.")
+