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