Skip to content

Commit

Permalink
convert weblocks-store-test to define LIFT tests exclusively
Browse files Browse the repository at this point in the history
  • Loading branch information
S11001001 committed Sep 9, 2008
1 parent ed69ff3 commit 8454d4c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
25 changes: 15 additions & 10 deletions test/weblocks-store-test.lisp
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@

(defpackage #:weblocks-store-test
(:use :cl :weblocks :rtest))
(:use :cl :weblocks :lift :f-underscore))

(in-package :weblocks-store-test)

(deftestsuite store-suite ()
()
(:setup (weblocks::open-stores))
(:teardown (mapstores #'clean-store)
(weblocks::close-stores))
(:documentation "Tests for the store API and implementations on
currently defined stores."))

;; XXX this dupes deftest in weblocks-test (not yet loaded)
(defmacro deftest-store (name test &rest values)
"A macro that makes defining test cases for stores easier. The macro
prepends the test expression with opening all stores, and appends it
with closing all stores. The result of the test expression is
returned."
`(deftest ,name
(unwind-protect
(progn
(weblocks::open-stores)
,test)
(mapstores (lambda (store)
(clean-store store)))
(weblocks::close-stores))
,@values))
`(addtest ,name
(ensure-same ,test
,(if (typep values '(cons t null))
`',(first values)
`(values . ,(mapcar (f_ `',_) values))))))

;;; test begin-transaction (no comprehensive test)
(deftest-store begin-transaction-1
Expand Down
2 changes: 1 addition & 1 deletion weblocks-store-test.asd
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
:author "Slava Akhmechet"
:licence "LLGPL"
:description "A test suite for weblocks backend stores."
:depends-on (:rt :weblocks)
:depends-on (:rt :weblocks :lift :f-underscore)
:components ((:module test
:components (
(:file "weblocks-store-test")))))
Expand Down

0 comments on commit 8454d4c

Please sign in to comment.