[elephant-cvs] CVS elephant/tests

rread rread at common-lisp.net
Tue Jan 24 18:25:01 UTC 2006


Update of /project/elephant/cvsroot/elephant/tests
In directory common-lisp:/tmp/cvs-serv22618/tests

Modified Files:
	elephant-tests.lisp testcollections.lisp testmigration.lisp 
	testsleepycat.lisp 
Log Message:
Clearer test usage and system-specific test invocation patterns


--- /project/elephant/cvsroot/elephant/tests/elephant-tests.lisp	2005/11/23 17:51:59	1.6
+++ /project/elephant/cvsroot/elephant/tests/elephant-tests.lisp	2006/01/24 18:25:01	1.7
@@ -86,14 +86,18 @@
 
 
 (defvar *testdb-path* 
-  ;;"/usr/local/share/common-lisp/elephant-0.2/tests/testdb"
   (namestring
    (merge-pathnames 
     #p"tests/testdb/" 
     (asdf:component-pathname (asdf:find-system 'elephant-tests)))))
 
+(defvar *testdb-path2* 
+  (namestring
+   (merge-pathnames 
+    #p"tests/testdb2/" 
+    (asdf:component-pathname (asdf:find-system 'elephant-tests)))))
+
 (defvar *sleepycatdb-path* 
-  ;;"/usr/local/share/common-lisp/elephant-0.2/tests/testdb"
   (namestring
    (merge-pathnames 
     #p"tests/testsleepycat/" 
@@ -136,7 +140,15 @@
 (defun do-migrate-test-spec(spud)
   (with-open-store(spud)
     (let ((*auto-commit* nil))
-      (do-test 'migrate1))))
+      (assert (equal (do-test 'remove-element) 'remove-element))
+      (assert (equal (do-test 'migrate1) 'migrate1))
+      (assert (equal (do-test 'migrate2) 'migrate2))
+      (assert (equal (do-test 'migrate3) 'migrate3))
+      (assert (equal (do-test 'migrate4) 'migrate4))
+      (assert (equal (do-test 'migrate5) 'migrate5))
+      t
+      )
+    ))
 
 (defun do-all-tests-spec(spec)
   (with-open-store (spec)
--- /project/elephant/cvsroot/elephant/tests/testcollections.lisp	2005/12/05 15:08:36	1.5
+++ /project/elephant/cvsroot/elephant/tests/testcollections.lisp	2006/01/24 18:25:01	1.6
@@ -11,7 +11,9 @@
 		 (add-to-root "x" x)
 		 (let ((sc1 (open-store *test-path-primary*)))
 		   (setf rv (equal (format nil "~A" x)
-				   (format nil "~A" (get-from-root "x"))))))
+				   (format nil "~A" (get-from-root "x"))))
+		   (close-store sc1)
+		   ))
 	    (progn
 	    (setq *store-controller* old-store)
 	    (setq *auto-commit* *prev-commit*)))
--- /project/elephant/cvsroot/elephant/tests/testmigration.lisp	2005/11/23 17:51:59	1.2
+++ /project/elephant/cvsroot/elephant/tests/testmigration.lisp	2006/01/24 18:25:01	1.3
@@ -7,16 +7,26 @@
 (in-package :ele-tests)
 
 (deftest remove-element
+    (if (or (null *test-path-secondary*) 
+	    (null *test-path-primary*))
+	(progn
+	  (format t "*test-path-secondary*  and *test-path-primary* not both set, skipping this test.")
+	  t)
     (let ((a (vector 'a 'b 'c))
 	  (ans (vector 'a 'c)))
       (setf a (ele::remove-indexed-element-and-adjust 1 a))
       (and (equal (aref a 0) (aref ans 0))
 	   (equal (aref a 1) (aref ans 1))
-	   (equal (length a) (length ans))))
+	   (equal (length a) (length ans)))))
   t)
 
 
 (deftest migrate1
+    (if (or (null *test-path-secondary*) 
+	    (null *test-path-primary*))
+	(progn
+	  (format t "*test-path-secondary*  and *test-path-primary* not both set, skipping this test.")
+	  t)
     (let ((old-store *store-controller*)
 	  (*prev-commit* *auto-commit*)
 	  (*auto-commit* t)
@@ -32,11 +42,16 @@
 	    (progn
 	    (setq *store-controller* old-store)
 	    (setq *auto-commit* *prev-commit*)))
-      rv)
+      rv))
   t)
 
 
 (deftest migrate2
+    (if (or (null *test-path-secondary*) 
+	    (null *test-path-primary*))
+	(progn
+	  (format t "*test-path-secondary*  and *test-path-primary* not both set, skipping this test.")
+	  nil)
     (let ((old-store *store-controller*)
 	  (*prev-commit* *auto-commit*)
 	  (*auto-commit* t)
@@ -53,11 +68,16 @@
 		 (btree-differ ibt mig))))
 	    (progn
 	      (setq *store-controller* old-store)
-	      (setq *auto-commit* *prev-commit*))))
+	      (setq *auto-commit* *prev-commit*)))))
   nil)
 
 
 (deftest migrate3
+    (if (or (null *test-path-secondary*) 
+	    (null *test-path-primary*))
+	(progn
+	  (format t "*test-path-secondary*  and *test-path-primary* not both set, skipping this test.")
+	  t)
     (let ((old-store *store-controller*)
 	  (*prev-commit* *auto-commit*)
 	  (*auto-commit* t)
@@ -92,11 +112,17 @@
 	(progn
 	  (setq *store-controller* old-store)
 	  (setq *auto-commit* *prev-commit*)))
-      rv)
+      rv
+      ))
   t)
 
 
 (deftest migrate4
+    (if (or (null *test-path-secondary*) 
+	    (null *test-path-primary*))
+	(progn
+	  (format t "*test-path-secondary*  and *test-path-primary* not both set, skipping this test.")
+	  t)
     (finishes
       (let ((old-store *store-controller*)
 	    (*prev-commit* *auto-commit*)
@@ -121,10 +147,15 @@
 	(progn
 	  (setq *store-controller* old-store)
 	  (setq *auto-commit* *prev-commit*)))
-      ))
+      )))
   t)
 
 (deftest migrate5
+    (if (or (null *test-path-secondary*) 
+	    (null *test-path-primary*))
+	(progn
+	  (format t "*test-path-secondary*  and *test-path-primary* not both set, skipping this test.")
+	  t)
     (finishes
       (let ((old-store *store-controller*)
 	    (*prev-commit* *auto-commit*)
@@ -166,5 +197,5 @@
 	(progn
 	  (setq *store-controller* old-store)
 	  (setq *auto-commit* *prev-commit*))))
-      )
+      ))
   t)
--- /project/elephant/cvsroot/elephant/tests/testsleepycat.lisp	2005/02/24 01:06:05	1.3
+++ /project/elephant/cvsroot/elephant/tests/testsleepycat.lisp	2006/01/24 18:25:01	1.4
@@ -17,7 +17,12 @@
 	   :auto-commit t :create t :thread t))
 
 (deftest prepares-sleepycat
-    (finishes (prepare-sleepycat)) t)
+    (if (not (find-package "ele-bdb"))
+	(progn 
+	  (format t "package ele-bdb not found, so not runnning test prepares-sleepycat~%")
+	     t)
+    (finishes (prepare-sleepycat)))
+    t)
 
 #|
 (deftest put-alot
@@ -60,7 +65,11 @@
 	  finally (sleepycat::db-sequence-remove seq :auto-commit t))))
 
 (deftest test-seq1
-    (finishes (test-sequence1))
+    (if (not (find-package "ele-bdb"))
+	(progn 
+	  (format t "package ele-bdb not found, so not runnning test prepares-sleepycat~%")
+	     t)
+    (finishes (test-sequence1)))
   t)
 
 (defun test-sequence2 ()
@@ -79,7 +88,11 @@
 	  finally (sleepycat::db-sequence-remove seq :auto-commit t))))
 
 (deftest test-seq2
-    (finishes (test-sequence2))
+    (if (not (find-package "ele-bdb"))
+	(progn 
+	  (format t "package ele-bdb not found, so not runnning test prepares-sleepycat~%")
+	     t)
+    (finishes (test-sequence2)))
   t)
 
 (defun cleanup-sleepycat ()
@@ -90,7 +103,11 @@
   (sleepycat::db-env-remove env "test"))
 
 (deftest cleansup-sleepycat
-    (finishes (cleanup-sleepycat))
+    (if (not (find-package "ele-bdb"))
+	(progn 
+	  (format t "package ele-bdb not found, so not runnning test prepares-sleepycat~%")
+	     t)
+    (finishes (cleanup-sleepycat)))
   t)
 
 ;;(unuse-package "SLEEPYCAT")




More information about the Elephant-cvs mailing list