Add IS-ALL macro.
[fiveam.git] / src / package.lisp
1 ;;;; -*- Mode: Lisp; indent-tabs-mode: nil -*-
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 :alexandria)
22   (:nicknames :5am :fiveam)
23   #+sb-package-locks
24   (:lock t)
25   (:export
26    ;; creating tests and test-suites
27    #:make-suite
28    #:def-suite
29    #:in-suite
30    #:in-suite*
31    #:make-test
32    #:test
33    #:def-test
34    #:get-test
35    #:rem-test
36    #:test-names
37    ;; fixtures
38    #:make-fixture
39    #:def-fixture
40    #:with-fixture
41    #:get-fixture
42    #:rem-fixture
43    ;; running checks
44    #:is
45    #:is-every
46    #:is-all
47    #:is-true
48    #:is-false
49    #:signals
50    #:finishes
51    #:skip
52    #:pass
53    #:fail
54    #:*test-dribble*
55    #:for-all
56    #:gen-integer
57    #:gen-float
58    #:gen-character
59    #:gen-string
60    #:gen-list
61    #:gen-tree
62    #:gen-buffer
63    #:gen-one-element
64    ;; running tests
65    #:run
66    #:run-all-tests
67    #:explain
68    #:explain!
69    #:run!
70    #:debug!
71    #:!
72    #:!!
73    #:!!!
74    #:*run-test-when-defined*
75    #:*debug-on-error*
76    #:*debug-on-failure*
77    #:*verbose-failures*
78    #:*print-names*
79    #:results-status))
80
81 ;;;; You can use #+5am to put your test-defining code inline with your
82 ;;;; other code - and not require people to have fiveam to run your
83 ;;;; package.
84
85 (pushnew :5am *features*)
86
87 ;;;;@include "check.lisp"
88
89 ;;;;@include "random.lisp"
90
91 ;;;;@include "fixture.lisp"
92
93 ;;;;@include "test.lisp"
94
95 ;;;;@include "suite.lisp"
96
97 ;;;;@include "run.lisp"
98
99 ;;;;@include "explain.lisp"
100
101 ;;;; * Colophon
102
103 ;;;; This documentaion was written by Edward Marco Baringer
104 ;;;; <mb@bese.it> and generated by qbook.
105
106 ;;;; ** COPYRIGHT
107
108 ;;;; Copyright (c) 2002-2003, Edward Marco Baringer
109 ;;;; All rights reserved.
110
111 ;;;; Redistribution and use in source and binary forms, with or without
112 ;;;; modification, are permitted provided that the following conditions are
113 ;;;; met:
114
115 ;;;;  - Redistributions of source code must retain the above copyright
116 ;;;;    notice, this list of conditions and the following disclaimer.
117
118 ;;;;  - Redistributions in binary form must reproduce the above copyright
119 ;;;;    notice, this list of conditions and the following disclaimer in the
120 ;;;;    documentation and/or other materials provided with the distribution.
121
122 ;;;;  - Neither the name of Edward Marco Baringer, nor BESE, nor the names
123 ;;;;    of its contributors may be used to endorse or promote products
124 ;;;;    derived from this software without specific prior written permission.
125
126 ;;;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
127 ;;;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
128 ;;;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
129 ;;;; A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT
130 ;;;; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
131 ;;;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
132 ;;;; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
133 ;;;; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
134 ;;;; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
135 ;;;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
136 ;;;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE