X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=t%2Ftests.lisp;h=a77abf3de45a308e69df5b46438e9100ca21d916;hb=ef75e7e7624f52a11e317fb0a8db7057233a45bf;hp=f88d1fe44b85dfd797171806140d00d652c120a0;hpb=9be99934ca30d5d0119280eccd9873434a31232c;p=fiveam.git diff --git a/t/tests.lisp b/t/tests.lisp index f88d1fe..a77abf3 100644 --- a/t/tests.lisp +++ b/t/tests.lisp @@ -4,9 +4,7 @@ (in-suite :it.bese.FiveAM) -(def-suite test-suite - :description "Suite for tests which should fail." - :default-test-args '(:fixture null-fixture :compile-at :run-time)) +(def-suite test-suite :description "Suite for tests which should fail.") (defmacro with-test-results ((results test-name) &body body) `(let ((,results (with-*test-dribble* nil (run ',test-name)))) @@ -151,6 +149,65 @@ (signals circular-dependency (run 'circular-2))) + +(def-suite before-test-suite :description "Suite for before test") + +(test (before-0 :suite before-test-suite) + (pass)) + +(test (before-1 :depends-on (:before before-0) + :suite before-test-suite) + (fail)) + +(def-suite before-test-suite-2 :description "Suite for before test") + +(test (before-2 :depends-on (:before before-3) + :suite before-test-suite-2) + (pass)) + +(test (before-3 :suite before-test-suite-2) + (pass)) + +(test before + (with-test-results (results before-test-suite) + (is (some #'test-skipped-p results))) + + (with-test-results (results before-test-suite-2) + (is (every #'test-passed-p results)))) + + +;;;; dependencies with symbol +(test (dep-with-symbol-first :suite test-suite) + (pass)) + +(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")) + +(test (dep-with-symbol-depends-on-ok :depends-on dep-with-symbol-first :suite test-suite) + (pass)) + +(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.")) + +(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-depends-on-ok) + (is (some #'test-passed-p results))) + + (with-test-results (results dep-with-symbol-dependencies-not-met) + (is (some #'test-skipped-p results))) + + ;; No failure here, because it means the test was run. + (with-test-results (results dep-with-symbol-depends-on-failed-dependency) + (is (not (some #'test-failure-p results))))) + + +;;;; test for-all + (test gen-integer (for-all ((a (gen-integer))) (is (integerp a))))