Added in-suite* that also defines the suite
[fiveam.git] / src / packages.lisp
1 ;; -*- lisp -*-
2
3 ;;;; * Introduction
4
5 ;;;; FiveAM is a testing framework. It takes care of all the boring
6 ;;;; bookkeeping associated with managing a test framework allowing
7 ;;;; the developer to focus on writing tests and code.
8
9 ;;;; FiveAM was designed with the following premises:
10
11 ;;;; - Defining tests should be about writing tests, not
12 ;;;; infrastructure. The developer should be able to focus on what
13 ;;;; they're testing, not the testing framework.
14
15 ;;;; - Interactive testing is the norm. Common Lisp is an interactive
16 ;;;; development environment, the testing environment should allow the
17 ;;;; developer to quickly and easily redefine, change, remove and run
18 ;;;; tests.
19
20 (defpackage :it.bese.FiveAM
21   (:use :common-lisp :it.bese.arnesi)
22   (:nicknames :5am)
23   (:export ;; creating tests and test-suites
24            #:make-suite
25            #:def-suite
26            #:in-suite
27            #:in-suite*
28            #:make-test
29            #:test
30            #:get-test
31            #:rem-test
32            #:test-names
33            ;; fixtures
34            #:make-fixture
35            #:def-fixture
36            #:with-fixture
37            #:get-fixture
38            #:rem-fixture
39            ;; running checks
40            #:is
41            #:is-true
42            #:is-false
43            #:signals
44            #:finishes
45            #:skip
46            #:pass
47            #:fail
48            #:*test-dribble*
49            #:for-all
50            #:gen-integer
51            #:gen-float
52            #:gen-character
53            #:gen-string
54            #:gen-list
55            #:gen-buffer
56            #:gen-one-element
57            ;; running tests
58            #:run
59            #:run-all-tests
60            #:explain
61            #:explain!
62            #:run!
63            #:!
64            #:!!
65            #:!!!
66            #:*run-test-when-defined*
67            #:*debug-on-error*
68            #:*debug-on-failure*
69            #:*verbose-failures*))
70
71 ;;;; You can use #+5am to put your test-defining code inline with your
72 ;;;; other code - and not require people to have fiveam to run your
73 ;;;; package.
74
75 (pushnew :5am *features*)
76
77 ;;;;@include "check.lisp"
78
79 ;;;;@include "random.lisp"
80
81 ;;;;@include "fixture.lisp"
82
83 ;;;;@include "test.lisp"
84
85 ;;;;@include "suite.lisp"
86
87 ;;;;@include "run.lisp"
88
89 ;;;;@include "explain.lisp"
90
91 ;;;; * Colophon
92
93 ;;;; This documentaion was written by Edward Marco Baringer
94 ;;;; <mb@bese.it> and generated by qbook.
95
96 ;;;; ** COPYRIGHT
97
98 ;;;; Copyright (c) 2002-2003, Edward Marco Baringer
99 ;;;; All rights reserved. 
100  
101 ;;;; Redistribution and use in source and binary forms, with or without
102 ;;;; modification, are permitted provided that the following conditions are
103 ;;;; met:
104  
105 ;;;;  - Redistributions of source code must retain the above copyright
106 ;;;;    notice, this list of conditions and the following disclaimer.
107  
108 ;;;;  - Redistributions in binary form must reproduce the above copyright
109 ;;;;    notice, this list of conditions and the following disclaimer in the
110 ;;;;    documentation and/or other materials provided with the distribution.
111
112 ;;;;  - Neither the name of Edward Marco Baringer, nor BESE, nor the names
113 ;;;;    of its contributors may be used to endorse or promote products
114 ;;;;    derived from this software without specific prior written permission.
115  
116 ;;;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
117 ;;;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
118 ;;;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
119 ;;;; A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT
120 ;;;; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
121 ;;;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
122 ;;;; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
123 ;;;; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
124 ;;;; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
125 ;;;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
126 ;;;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE