projects
/
fiveam.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c9c5c68
)
Use DEF-TEST in internal test suite
author
Stelian Ionescu
<sionescu@cddr.org>
Sun, 29 Jul 2012 17:05:18 +0000
(19:05 +0200)
committer
Stelian Ionescu
<sionescu@cddr.org>
Sun, 29 Jul 2012 17:05:18 +0000
(19:05 +0200)
t/tests.lisp
patch
|
blob
|
history
diff --git
a/t/tests.lisp
b/t/tests.lisp
index
a5fec51
..
65918d1
100644
(file)
--- a/
t/tests.lisp
+++ b/
t/tests.lisp
@@
-16,7
+16,7
@@
;;;; Test the checks
;;;; Test the checks
-(test (is1 :suite test-suite)
+(def-test is1 (:suite test-suite)
(is (plusp 1))
(is (< 0 1))
(is (not (plusp -1)))
(is (plusp 1))
(is (< 0 1))
(is (not (plusp -1)))
@@
-24,7
+24,7
@@
(is-true t)
(is-false nil))
(is-true t)
(is-false nil))
-(test (is2 :suite test-suite :fixture null-fixture)
+(def-test is2 (:suite test-suite :fixture null-fixture)
(is (plusp 0))
(is (< 0 -1))
(is (not (plusp 1)))
(is (plusp 0))
(is (< 0 -1))
(is (not (plusp 1)))
@@
-32,7
+32,7
@@
(is-true nil)
(is-false t))
(is-true nil)
(is-false t))
-(test (is :profile t)
+(def-test is (:profile t)
(with-test-results (results is1)
(is (= 6 (length results)))
(is (every #'test-passed-p results)))
(with-test-results (results is1)
(is (= 6 (length results)))
(is (every #'test-passed-p results)))
@@
-40,46
+40,46
@@
(is (= 6 (length results)))
(is (every #'test-failure-p results))))
(is (= 6 (length results)))
(is (every #'test-failure-p results))))
-(test signals/finishes
+(def-test signals/finishes ()
(signals error
(error "an error"))
(finishes
(signals error
(error "an error"))))
(signals error
(error "an error"))
(finishes
(signals error
(error "an error"))))
-(test pass
+(def-test pass ()
(pass))
(pass))
-(test (fail1 :suite test-suite)
+(def-test fail1 (:suite test-suite)
(fail "This is supposed to fail"))
(fail "This is supposed to fail"))
-(test fail
+(def-test fail ()
(with-test-results (results fail1)
(is (= 1 (length results)))
(is (test-failure-p (first results)))))
;;;; non top level checks
(with-test-results (results fail1)
(is (= 1 (length results)))
(is (test-failure-p (first results)))))
;;;; non top level checks
-(test foo-bar
+(def-test foo-bar ()
(let ((state 0))
(is (= 0 state))
(is (= 1 (incf state)))))
;;;; Test dependencies
(let ((state 0))
(is (= 0 state))
(is (= 1 (incf state)))))
;;;; Test dependencies
-(test (ok :suite test-suite)
+(def-test ok (:suite test-suite)
(pass))
(pass))
-(test (not-ok :suite test-suite)
+(def-test not-ok (:suite test-suite)
(fail "This is supposed to fail."))
(fail "This is supposed to fail."))
-(test (and1 :depends-on (and ok not-ok) :suite test-suite)
+(def-test and1 (:depends-on (and ok not-ok) :suite test-suite)
(fail))
(fail))
-(test (and2 :depends-on (and ok) :suite test-suite)
+(def-test and2 (:depends-on (and ok) :suite test-suite)
(pass))
(pass))
-(test dep-and
+(def-test dep-and ()
(with-test-results (results and1)
(is (= 3 (length results)))
;; we should have one skippedw one failed and one passed
(with-test-results (results and1)
(is (= 3 (length results)))
;; we should have one skippedw one failed and one passed
@@
-90,13
+90,13
@@
(is (= 2 (length results)))
(is (every #'test-passed-p results))))
(is (= 2 (length results)))
(is (every #'test-passed-p results))))
-(test (or1 :depends-on (or ok not-ok) :suite test-suite)
+(def-test or1 (:depends-on (or ok not-ok) :suite test-suite)
(pass))
(pass))
-(test (or2 :depends-on (or not-ok ok) :suite test-suite)
+(def-test or2 (:depends-on (or not-ok ok) :suite test-suite)
(pass))
(pass))
-(test dep-or
+(def-test dep-or ()
(with-test-results (results or1)
(is (= 2 (length results)))
(is (every #'test-passed-p results)))
(with-test-results (results or1)
(is (= 2 (length results)))
(is (every #'test-passed-p results)))
@@
-104,13
+104,13
@@
(is (= 3 (length results)))
(is (= 2 (length (remove-if-not #'test-passed-p results))))))
(is (= 3 (length results)))
(is (= 2 (length (remove-if-not #'test-passed-p results))))))
-(test (not1 :depends-on (not not-ok) :suite test-suite)
+(def-test not1 (:depends-on (not not-ok) :suite test-suite)
(pass))
(pass))
-(test (not2 :depends-on (not ok) :suite test-suite)
+(def-test not2 (:depends-on (not ok) :suite test-suite)
(fail))
(fail))
-(test not
+(def-test not ()
(with-test-results (results not1)
(is (= 2 (length results)))
(is (some #'test-passed-p results))
(with-test-results (results not1)
(is (= 2 (length results)))
(is (some #'test-passed-p results))
@@
-120,29
+120,29
@@
(is (some #'test-passed-p results))
(is (some #'test-skipped-p results))))
(is (some #'test-passed-p results))
(is (some #'test-skipped-p results))))
-(test (nested-logic :depends-on (and ok (not not-ok) (not not-ok))
+(def-test nested-logic (:depends-on (and ok (not not-ok) (not not-ok))
:suite test-suite)
(pass))
:suite test-suite)
(pass))
-(test dep-nested
+(def-test dep-nested ()
(with-test-results (results nested-logic)
(is (= 3 (length results)))
(is (= 2 (length (remove-if-not #'test-passed-p results))))
(is (= 1 (length (remove-if-not #'test-failure-p results))))))
(with-test-results (results nested-logic)
(is (= 3 (length results)))
(is (= 2 (length (remove-if-not #'test-passed-p results))))
(is (= 1 (length (remove-if-not #'test-failure-p results))))))
-(test (circular-0 :depends-on (and circular-1 circular-2 or1)
+(def-test circular-0 (:depends-on (and circular-1 circular-2 or1)
:suite test-suite)
(fail "we depend on a circular dependency, we should not be tested."))
:suite test-suite)
(fail "we depend on a circular dependency, we should not be tested."))
-(test (circular-1 :depends-on (and circular-2)
+(def-test circular-1 (:depends-on (and circular-2)
:suite test-suite)
(fail "we have a circular depednency, we should not be tested."))
:suite test-suite)
(fail "we have a circular depednency, we should not be tested."))
-(test (circular-2 :depends-on (and circular-1)
+(def-test circular-2 (:depends-on (and circular-1)
:suite test-suite)
(fail "we have a circular depednency, we should not be tested."))
:suite test-suite)
(fail "we have a circular depednency, we should not be tested."))
-(test circular
+(def-test circular ()
(signals circular-dependency
(run 'circular-0))
(signals circular-dependency
(signals circular-dependency
(run 'circular-0))
(signals circular-dependency
@@
-153,23
+153,23
@@
(def-suite before-test-suite :description "Suite for before test")
(def-suite before-test-suite :description "Suite for before test")
-(test (before-0 :suite before-test-suite)
+(def-test before-0 (:suite before-test-suite)
(pass))
(pass))
-(test (before-1 :depends-on (:before before-0)
+(def-test before-1 (:depends-on (:before before-0)
:suite before-test-suite)
(fail))
(def-suite before-test-suite-2 :description "Suite for before test")
:suite before-test-suite)
(fail))
(def-suite before-test-suite-2 :description "Suite for before test")
-(test (before-2 :depends-on (:before before-3)
+(def-test before-2 (:depends-on (:before before-3)
:suite before-test-suite-2)
(pass))
:suite before-test-suite-2)
(pass))
-(test (before-3 :suite before-test-suite-2)
+(def-test before-3 (:suite before-test-suite-2)
(pass))
(pass))
-(test before
+(def-test before ()
(with-test-results (results before-test-suite)
(is (some #'test-skipped-p results)))
(with-test-results (results before-test-suite)
(is (some #'test-skipped-p results)))
@@
-178,21
+178,21
@@
;;;; dependencies with symbol
;;;; dependencies with symbol
-(test (dep-with-symbol-first :suite test-suite)
+(def-test dep-with-symbol-first (:suite test-suite)
(pass))
(pass))
-(test (dep-with-symbol-dependencies-not-met :depends-on (not dep-with-symbol-first)
+(def-test dep-with-symbol-dependencies-not-met (:depends-on (not dep-with-symbol-first)
:suite test-suite)
(fail "Error in the test of the test, this should not ever happen"))
:suite test-suite)
(fail "Error in the test of the test, this should not ever happen"))
-(test (dep-with-symbol-depends-on-ok :depends-on dep-with-symbol-first :suite test-suite)
+(def-test dep-with-symbol-depends-on-ok (:depends-on dep-with-symbol-first :suite test-suite)
(pass))
(pass))
-(test (dep-with-symbol-depends-on-failed-dependency :depends-on dep-with-symbol-dependencies-not-met
+(def-test dep-with-symbol-depends-on-failed-dependency (:depends-on dep-with-symbol-dependencies-not-met
:suite test-suite)
(fail "No, I should not be tested becuase I depend on a test that in its turn has a failed dependecy."))
:suite test-suite)
(fail "No, I should not be tested becuase I depend on a test that in its turn has a failed dependecy."))
-(test dependencies-with-symbol
+(def-test dependencies-with-symbol ()
(with-test-results (results dep-with-symbol-first)
(is (some #'test-passed-p results)))
(with-test-results (results dep-with-symbol-first)
(is (some #'test-passed-p results)))
@@
-209,16
+209,16
@@
;;;; test for-all
;;;; test for-all
-(test gen-integer
+(def-test gen-integer ()
(for-all ((a (gen-integer)))
(is (integerp a))))
(for-all ((a (gen-integer)))
(is (integerp a))))
-(test for-all-guarded
+(def-test for-all-guarded ()
(for-all ((less (gen-integer))
(more (gen-integer) (< less more)))
(is (< less more))))
(for-all ((less (gen-integer))
(more (gen-integer) (< less more)))
(is (< less more))))
-(test gen-float
+(def-test gen-float ()
(macrolet ((test-gen-float (type)
`(for-all ((unbounded (gen-float :type ',type))
(bounded (gen-float :type ',type :bound 42)))
(macrolet ((test-gen-float (type)
`(for-all ((unbounded (gen-float :type ',type))
(bounded (gen-float :type ',type :bound 42)))
@@
-230,14
+230,14
@@
(test-gen-float double-float)
(test-gen-float long-float)))
(test-gen-float double-float)
(test-gen-float long-float)))
-(test gen-character
+(def-test gen-character ()
(for-all ((c (gen-character)))
(is (characterp c)))
(for-all ((c (gen-character :code (gen-integer :min 32 :max 40))))
(is (characterp c))
(member c (list #\Space #\! #\" #\# #\$ #\% #\& #\' #\())))
(for-all ((c (gen-character)))
(is (characterp c)))
(for-all ((c (gen-character :code (gen-integer :min 32 :max 40))))
(is (characterp c))
(member c (list #\Space #\! #\" #\# #\$ #\% #\& #\' #\())))
-(test gen-string
+(def-test gen-string ()
(for-all ((s (gen-string)))
(is (stringp s)))
(for-all ((s (gen-string :length (gen-integer :min 0 :max 2))))
(for-all ((s (gen-string)))
(is (stringp s)))
(for-all ((s (gen-string :length (gen-integer :min 0 :max 2))))
@@
-251,7
+251,7
@@
(lambda ()
(list 1 1)))
(lambda ()
(list 1 1)))
-(test for-all-destructuring-bind
+(def-test for-all-destructuring-bind ()
(for-all (((a b) (dummy-mv-generator)))
(is (= 1 a))
(is (= 1 b))))
(for-all (((a b) (dummy-mv-generator)))
(is (= 1 a))
(is (= 1 b))))