5 ;;;; FiveAM is A simple Common Lisp unit testing library.
7 ;;;; FiveAM is a testing framework. It takes care of all the boring
8 ;;;; bookkeeping associated with managing a test framework allowing
9 ;;;; the developer to focus on writing tests and code.
11 ;;;; FiveAM was designed with the following premises:
13 ;;;; - Defining tests should be about writing tests, not
14 ;;;; infrastructure. The developer should be able to focus on what
15 ;;;; they're testing, not the testing framework.
17 ;;;; - Interactive testing is the norm. Common Lisp is an interactive
18 ;;;; development environment, the testing environment should allow
19 ;;;; the developer to quickly and easily redefine, change, remove
22 (defpackage :it.bese.FiveAM
23 (:use :common-lisp :it.bese.arnesi)
25 (:export ;; creating tests and test-suites
59 #:*verbose-failures*))
61 ;;;; You can use #+5am to put your test-defining code inline with your
62 ;;;; other code - and not require people to have fiveam to run your
65 (pushnew :5am *features*)
67 ;;;;@include "check.lisp"
69 ;;;;@include "test.lisp"
71 ;;;;@include "fixture.lisp"
73 ;;;;@include "suite.lisp"
75 ;;;;@include "run.lisp"
77 ;;;;@include "explain.lisp"
81 #| (def-suite my-suite :description "My Example Suite")
87 (is (= 4 (+ 2 2)) "2 plus 2 wasn't equal to 4 (using #'= to test equality)")
89 (throws (error "Trying to add 4 to FOO didn't signal an error")
91 (is (= 0 (+ 1 1)) "this should have failed"))
94 ;; Running suite MY-SUITE
96 Suite My Example Suite ran 4 tests (3/0/1) - 1 FAILED -
98 MY-TESTS FAILED: (+ 1 1) was not = to 0 (returned 2 instead)
100 Message: this should have failed
105 ;;;; This documentaion was written by Edward Marco Baringer
106 ;;;; <mb@bese.it> and generated by qbook.
110 ;;;; Copyright (c) 2002-2003, Edward Marco Baringer
111 ;;;; All rights reserved.
113 ;;;; Redistribution and use in source and binary forms, with or without
114 ;;;; modification, are permitted provided that the following conditions are
117 ;;;; - Redistributions of source code must retain the above copyright
118 ;;;; notice, this list of conditions and the following disclaimer.
120 ;;;; - Redistributions in binary form must reproduce the above copyright
121 ;;;; notice, this list of conditions and the following disclaimer in the
122 ;;;; documentation and/or other materials provided with the distribution.
124 ;;;; - Neither the name of Edward Marco Baringer, nor BESE, nor the names
125 ;;;; of its contributors may be used to endorse or promote products
126 ;;;; derived from this software without specific prior written permission.
128 ;;;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
129 ;;;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
130 ;;;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
131 ;;;; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
132 ;;;; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
133 ;;;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
134 ;;;; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
135 ;;;; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
136 ;;;; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
137 ;;;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
138 ;;;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE