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