[elephant-cvs] CVS elephant/tests

ieslick ieslick at common-lisp.net
Sat Apr 28 17:18:34 UTC 2007


Update of /project/elephant/cvsroot/elephant/tests
In directory clnet:/tmp/cvs-serv32598/tests

Modified Files:
	elephant-tests.lisp testconditions.lisp 
Log Message:
test conditions fix, new run-regression test interface; remove doc strings to cleanup manual

--- /project/elephant/cvsroot/elephant/tests/elephant-tests.lisp	2007/04/28 02:31:31	1.32
+++ /project/elephant/cvsroot/elephant/tests/elephant-tests.lisp	2007/04/28 17:18:34	1.33
@@ -86,6 +86,9 @@
 (defvar *testpg-spec*
   '(:clsql (:postgresql "localhost.localdomain" "test" "postgres" "")))
 
+(defvar *testpg-spec2*
+  '(:clsql (:postgresql "localhost.localdomain" "test2" "postgres" "")))
+
 (defvar *testsqlite3-spec*
   `(:clsql (:sqlite3 
 	    ,(namestring
@@ -116,14 +119,36 @@
 
 
 ;;
-;; GUIDE TO TESTING
+;; COMPREHENSIVE TESTING
+;;
+
+(defun run-regression-tests (type)
+  (let (sc1 sc2 oid)
+    (case type
+      (:BDB 
+       (setf sc1 *testbdb-spec*
+	     sc2 *testbdb-spec2*
+	     oid *testbdb-spec-oid*))
+      (:SQLITE
+       (setf sc1 *testsqlite3-spec*
+	     sc2 *testsqlite3-spec2*))
+      (:POSTGRES
+       (setf sc1 *testpg-spec*
+	     sc2 *testpg-spec*))
+      (t (error "Unrecognized data store type: ~A" type)))
+    (let ((*test-spec-primary* sc1)
+	  (*test-spec-secondary* sc2))
+      (declare (special *test-spec-secondary* *test-spec-primary*))
+      (do-backend-tests sc1))))
+
+;;
+;; GUIDE TO SUBTESTS
 ;;
-;; 1) Set *default-spec* to the above spec of your choice
-;; 2) Call (do-backend-tests) to test the standard API
-;; 3) To test migration: (do-migration-tests *default-spec* <second-spec>) inserting a second
+;; 1) Call (do-backend-tests <specname>) to test the standard API
+;; 3) To test migration: (do-migration-tests <first-spec> <second-spec>) inserting a second
 ;;    spec, typically a bdb spec or create another instance of a sql db depending on 
 ;;    your configuration
-;; 4) A backend is green if it passes do-backend-tests and can succesfully be
+;; 4) A data store is green if it passes do-backend-tests and can succesfully be
 ;;    used as spec1 or spec2 argument in the migration test
 ;;
 
@@ -146,8 +171,7 @@
   "For easy interactive running of single tests while debugging"
   (when spec
     (with-open-store (spec)
-      (let ((*auto-commit* nil))
-	(do-test testname)))))
+      (do-test testname))))
 
 (defun do-migration-tests (spec1 spec2 &optional oid-spec)
   "Interface to do explicit migration tests between backends"
--- /project/elephant/cvsroot/elephant/tests/testconditions.lisp	2007/04/28 03:07:39	1.4
+++ /project/elephant/cvsroot/elephant/tests/testconditions.lisp	2007/04/28 17:18:34	1.5
@@ -19,9 +19,9 @@
       (progn 
 	(format t "~%Second store spec missing: ignoring")
 	(values t t t t))
-      (let (*store-controller*
-	    (sc1 *store-controller*)
-	    (sc2 (open-store *test-spec-secondary* :recover t :deadlock-detect nil)))
+      (let ((sc2 (open-store *test-spec-secondary* :recover t :deadlock-detect nil))
+	    (*store-controller* *store-controller*)
+	    (sc1 *store-controller*))
 	(unwind-protect
 	     (let ((inst1 (make-instance 'pfoo :slot1 100 :sc sc1))
 		   (inst2 (make-instance 'pfoo :slot1 200 :sc sc2)))
@@ -36,10 +36,7 @@
   t t t t)
 
 (deftest unindexed-class-condition
-    (let* ((sc (open-store *test-spec-primary* :recover t :deadlock-detect nil))
-	   (inst (make-instance 'pfoo :slot1 1 :sc sc)))
-      (unwind-protect
-	   (signals-specific-condition (persistent-class-not-indexed)
-	     (find-class-index 'pfoo :sc sc))
-	(close-store sc)))
+    (let ((inst (make-instance 'pfoo :slot1 1)))
+      (signals-specific-condition (persistent-class-not-indexed)
+	(find-class-index 'pfoo)))
   t)
\ No newline at end of file




More information about the Elephant-cvs mailing list