This is the kaputt Reference Manual, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 05:04:22 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
kaputt
A Simple Interactive Test Framework for Common Lisp
Michaël Le Barbier
CeCILL-B
alexandria
(system).
src
(module).
Modules are listed depth-first from the system components tree.
kaputt/src
kaputt
(system).
package.lisp
(file).
utilities.lisp
(file).
configuration.lisp
(file).
assert.lisp
(file).
result.lisp
(file).
supervisor.lisp
(file).
testcase.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
kaputt/kaputt.asd
kaputt/src/package.lisp
kaputt/src/utilities.lisp
kaputt/src/configuration.lisp
kaputt/src/assert.lisp
kaputt/src/result.lisp
kaputt/src/supervisor.lisp
kaputt/src/testcase.lisp
kaputt/src/utilities.lisp
src
(module).
description
(macro).
string-match
(function).
kaputt/src/configuration.lisp
src
(module).
*batch-mode*
(special variable).
kaputt/src/assert.lisp
src
(module).
assert-condition
(macro).
assert-eq
(function).
assert-eql
(function).
assert-equal
(function).
assert-float-is-approximately-equal
(function).
assert-float-is-definitely-greater-than
(function).
assert-float-is-definitely-less-than
(function).
assert-float-is-essentially-equal
(function).
assert-nil
(function).
assert-set-equal
(function).
assert-string-equal
(function).
assert-string<
(function).
assert-string<=
(function).
assert-string=
(function).
assert-string>
(function).
assert-string>=
(function).
assert-subsetp
(function).
assert-t
(function).
assert-t*
(function).
assert-type
(function).
assert-vector-equal
(function).
assert<
(function).
assert<=
(function).
assert=
(function).
assert>
(function).
assert>=
(function).
define-assertion
(macro).
*double-float-precision*
(special variable).
float-comparison-threshold
(macro).
report-string-comparison
(function).
report-string-comparison/details
(function).
report-string-comparison/unexpected-type
(function).
kaputt/src/result.lisp
src
(module).
assertion
(structure).
assertion-arguments
(reader).
(setf assertion-arguments)
(writer).
assertion-condition
(reader).
(setf assertion-condition)
(writer).
assertion-description
(reader).
(setf assertion-description)
(writer).
assertion-form
(reader).
(setf assertion-form)
(writer).
assertion-name
(reader).
(setf assertion-name)
(writer).
assertion-outcome
(reader).
(setf assertion-outcome)
(writer).
assertion-p
(function).
assertion-path
(reader).
(setf assertion-path)
(writer).
assertion-type
(reader).
(setf assertion-type)
(writer).
make-assertion
(function).
make-testcase
(function).
testcase
(structure).
testcase-arguments
(reader).
(setf testcase-arguments)
(writer).
testcase-condition
(reader).
(setf testcase-condition)
(writer).
testcase-failure
(reader).
(setf testcase-failure)
(writer).
testcase-name
(reader).
(setf testcase-name)
(writer).
testcase-p
(function).
testcase-path
(reader).
(setf testcase-path)
(writer).
testcase-results
(reader).
(setf testcase-results)
(writer).
testcase-skip
(reader).
(setf testcase-skip)
(writer).
testcase-success
(reader).
(setf testcase-success)
(writer).
testcase-total
(reader).
(setf testcase-total)
(writer).
copy-assertion
(function).
copy-testcase
(function).
count-total-number-of-assertions
(function).
count-total-number-of-assertions-by-outcome
(function).
kaputt/src/supervisor.lisp
src
(module).
supervisor
(class).
supervisor-assertion
(generic function).
supervisor-success-p
(generic function).
supervisor-testcase-begin
(generic function).
supervisor-testcase-end
(generic function).
*current-supervisor*
(special variable).
pointless-supervisor
(class).
serviceable-supervisor
(class).
supervisor-toplevel-begin
(generic function).
supervisor-toplevel-end
(generic function).
tally-supervisor
(class).
trace-supervisor
(class).
verbose-supervisor
(class).
kaputt/src/testcase.lisp
src
(module).
assert-failure
(macro).
define-testcase
(macro).
testcase-batch
(macro).
testcase-continue
(macro).
testcase-ignore
(macro).
*testcase-interaction*
(special variable).
*testcase-path*
(special variable).
*testcase-results*
(special variable).
*testcase-skip*
(special variable).
*testcase-supervisor-class*
(special variable).
assert-failure/main
(function).
assert-failure/unexpected-condition
(function).
assertion-failed
(condition).
assertion-failed/report
(function).
define-testcase/wrap-assert-form
(function).
restart-assertion
(macro).
supervise-assertion
(macro).
Packages are listed by definition order.
kaputt
The Kaputt Test Framework.
common-lisp
.
assert-condition
(macro).
assert-eq
(function).
assert-eql
(function).
assert-equal
(function).
assert-failure
(macro).
assert-float-is-approximately-equal
(function).
assert-float-is-definitely-greater-than
(function).
assert-float-is-definitely-less-than
(function).
assert-float-is-essentially-equal
(function).
assert-nil
(function).
assert-set-equal
(function).
assert-string-equal
(function).
assert-string<
(function).
assert-string<=
(function).
assert-string=
(function).
assert-string>
(function).
assert-string>=
(function).
assert-subsetp
(function).
assert-t
(function).
assert-t*
(function).
assert-type
(function).
assert-vector-equal
(function).
assert<
(function).
assert<=
(function).
assert=
(function).
assert>
(function).
assert>=
(function).
assertion
(structure).
assertion-arguments
(reader).
(setf assertion-arguments)
(writer).
assertion-condition
(reader).
(setf assertion-condition)
(writer).
assertion-description
(reader).
(setf assertion-description)
(writer).
assertion-form
(reader).
(setf assertion-form)
(writer).
assertion-name
(reader).
(setf assertion-name)
(writer).
assertion-outcome
(reader).
(setf assertion-outcome)
(writer).
assertion-p
(function).
assertion-path
(reader).
(setf assertion-path)
(writer).
assertion-type
(reader).
(setf assertion-type)
(writer).
define-assertion
(macro).
define-testcase
(macro).
make-assertion
(function).
make-testcase
(function).
supervisor
(class).
supervisor-assertion
(generic function).
supervisor-success-p
(generic function).
supervisor-testcase-begin
(generic function).
supervisor-testcase-end
(generic function).
testcase
(structure).
testcase-arguments
(reader).
(setf testcase-arguments)
(writer).
testcase-batch
(macro).
testcase-condition
(reader).
(setf testcase-condition)
(writer).
testcase-continue
(macro).
testcase-failure
(reader).
(setf testcase-failure)
(writer).
testcase-ignore
(macro).
testcase-name
(reader).
(setf testcase-name)
(writer).
testcase-p
(function).
testcase-path
(reader).
(setf testcase-path)
(writer).
testcase-results
(reader).
(setf testcase-results)
(writer).
testcase-skip
(reader).
(setf testcase-skip)
(writer).
testcase-success
(reader).
(setf testcase-success)
(writer).
testcase-total
(reader).
(setf testcase-total)
(writer).
*batch-mode*
(special variable).
*current-supervisor*
(special variable).
*double-float-precision*
(special variable).
*testcase-interaction*
(special variable).
*testcase-path*
(special variable).
*testcase-results*
(special variable).
*testcase-skip*
(special variable).
*testcase-supervisor-class*
(special variable).
assert-failure/main
(function).
assert-failure/unexpected-condition
(function).
assertion-failed
(condition).
assertion-failed/report
(function).
copy-assertion
(function).
copy-testcase
(function).
count-total-number-of-assertions
(function).
count-total-number-of-assertions-by-outcome
(function).
define-testcase/wrap-assert-form
(function).
description
(macro).
float-comparison-threshold
(macro).
pointless-supervisor
(class).
report-string-comparison
(function).
report-string-comparison/details
(function).
report-string-comparison/unexpected-type
(function).
restart-assertion
(macro).
serviceable-supervisor
(class).
string-match
(function).
supervise-assertion
(macro).
supervisor-toplevel-begin
(generic function).
supervisor-toplevel-end
(generic function).
tally-supervisor
(class).
trace-supervisor
(class).
verbose-supervisor
(class).
Definitions are sorted by export status, category, package, and then by lexicographic order.
The assertion (ASSERT-CONDITION CONDITION FORM) is true iff FORM yields CONDITION.
It is possible to perform arbitrary checks on the condition by providing SLOTS, which are bound
to the generated condition slots as in WITH-SLOTS and the given BODY yielding a generalised
boolean validating details of the assertion.
An assertion that verifies that the assertion FORM yields a failure. When a globbing PATTERN is supplied the description of the failure is matched against it.
Define an assertion function NAME, accepting LAMBDA-LIST with BODY.
The BODY is interpreted as computing a generalised boolean value,
which determines if the assertion is a success or failure. When it is a success,
a single value T is returned. When it is a failure, two values NIL and a descriptive
string are returned.
The NAME must start with ASSERT-, ASSERT<, ASSERT> or ASSERT=.
When the first BODY form is a string, this string is used as an informational message
when reporting the corresponding error condition. It is also used as a documentaion
string for the created function.
When the next BODY form starts with the keyword :REPORT, then the rest of that form must be function of a STREAM. This function is then used to generate an informational message when reporting the corresponding error condition. This allows to add dynamic context to this informational messsage, like the value of some variables.
Define a test case function TESTCASE-NAME, accepting TESTCASE-ARGS with BODY.
The BODY is examined and assertions spotted in it are wrapped with extra code
installing restarts and triggering supervisor events.
Test cases are allowed to be nested. A toplevel test case is a test suite and triggers testsuite supervisor events when beginning and ending. The return value of a testcase is a boolean which is true iff the current testsuite has experienced a failed assertion. Thus, even if a test case does not experience any failure, a NIL value is returned if a previous test case in the current test suite has experienced a failure.
Run FORMS in an environment where testcase are batched.
Run FORMS in an environment where testcase failures are continued.
Run FORMS in an environment where testcase failures are ignored.
The assertion (ASSERT-EQ A B) is true, iff A and B satisfy the EQ predicate.
The assertion (ASSERT-EQL A B) is true, iff A and B satisfy the EQL predicate.
The assertion (ASSERT-EQUAL A B) is true, iff A and B satisfy the EQUAL predicate.
The assertion (ASSERT-FLOAT-IS-APPROXIMATELY-EQUAL FLOAT1 FLOAT2) is true iff FLOAT1 and FLOAT2 are in a neighbourhood whose size is based on the magnitude orders of FLOAT1 and FLOAT2 and the floating point precision.
The assertion (ASSERT-FLOAT-IS-DEFINITELY-GREATER-THAN FLOAT1 FLOAT2) is true iff FLOAT1 is greater than FLOAT2 and not in a neighbourhood of FLOAT2 whose diameter is controlled by the INACCURACY, the magnitude orders of FLOAT1 and FLOAT2 and the floating point precision.
The assertion (ASSERT-FLOAT-IS-DEFINITELY-LESS-THAN FLOAT1 FLOAT2) is true iff FLOAT2
is greater than FLOAT1 and not in a neighbourhood of FLOAT1 whose diameter is controlled
by the INACCURACY, the magnitude orders of FLOAT1 and FLOAT2 and the floating point precision.
The assertion (ASSERT-FLOAT-IS-ESSENTIALLY-EQUAL FLOAT1 FLOAT2) is true iff FLOAT1 and FLOAT2 are in a neighbourhood whose size is based on the magnitude orders of FLOAT1 and FLOAT2 and the floating point precision.
The assertion (ASSERT-NIL EXPR) is true, iff EXPR is NIL.
The assertion (ASSERT-SET-EQUAL LIST1 LIST2) is true iff LIST1 denotes the same set as LIST2.
The assertion (ASSERT-STRING-EQUAL STRING1 STRING2) is true, iff STRING1 and STRING2
satisfy the STRING-EQUAL predicate.
This assertion supports the same keyword parameters as STRING-EQUAL.
The assertion (ASSERT-STRING< STRING1 STRING2) is true, iff STRING1 and STRING2
satisfy the STRING< predicate.
This assertion supports the same keyword parameters as STRING<.
The assertion (ASSERT-STRING<= STRING1 STRING2) is true, iff STRING1 and STRING2
satisfy the STRING<= predicate.
This assertion supports the same keyword parameters as STRING<=.
The assertion (ASSERT-STRING= STRING1 STRING2) is true, iff STRING1 and STRING2
satisfy the STRING= predicate.
This assertion supports the same keyword parameters as STRING=.
The assertion (ASSERT-STRING> STRING1 STRING2) is true, iff STRING1 and STRING2
satisfy the STRING> predicate.
This assertion supports the same keyword parameters as STRING>.
The assertion (ASSERT-STRING>= STRING1 STRING2) is true, iff STRING1 and STRING2
satisfy the STRING>= predicate.
This assertion supports the same keyword parameters as STRING>=.
The assertion (ASSERT-SUBSETP LIST1 LIST2) is true iff LIST1 is a subset of LIST2.
The assertion (ASSERT-T EXPR) is true, iff EXPR is T.
The assertion (ASSERT-T* EXPR) is true, iff EXPR is true as a generalised boolean.
The assertion (ASSERT-TYPE EXPR TYPE) is true, iff EXPR evaluates to a value of type TYPE.
The assertion (ASSERT-VECTOR-EQUAL VECTOR1 VECTOR2) is true iff VECTOR1 and VECTOR2 are equal.
Vectors are equal if they have the same length and have equal elements at each
index. The equality predicate used to compare elements is either EQL or the predicate
provided by the :TEST keyword argument.
The assertion (ASSERT< A B) is true, iff A and B satisfy the < predicate.
The assertion (ASSERT<= A B) is true, iff A and B satisfy the <= predicate.
The assertion (ASSERT= A B) is true, iff A and B satisfy the = predicate.
The assertion (ASSERT> A B) is true, iff A and B satisfy the > predicate.
The assertion (ASSERT>= A B) is true, iff A and B satisfy the >= predicate.
form
.
name
.
path
.
type
.
name
.
path
.
skip
.
This event is sent to a supervisor when an assertion has been performed.
progn
.
:most-specific-first
serviceable-supervisor
) assertion) ¶pointless-supervisor
) assertion) ¶tally-supervisor
) assertion) ¶trace-supervisor
) assertion) ¶null
) assertion) ¶supervisor
) assertion) ¶This method tells if a test suite has never recorded a failure.
null
)) ¶supervisor
)) ¶This event is sent to a supervisor when a test case begins.
progn
.
:most-specific-first
tally-supervisor
) testcase) ¶trace-supervisor
) testcase) ¶null
) testcase) ¶supervisor
) testcase) ¶This event is sent to a supervisor when a test case ends.
progn
.
:most-specific-first
trace-supervisor
) testcase outcome) ¶null
) testcase outcome) ¶supervisor
) testcase outcome) ¶A strucure capturing an assertion result.
Slots are populated as follows:
NAME:
The symbol designating the assertion. This is the first element of the FORM.
PATH:
The path of the assertion in the test hierarchy. This the stack of preceding testcases in
the test hierarchy.
ARGUMENTS:
The list of evaluated arguments for the assertion.
FORM:
The form for the assertion invocation.
TYPE:
One of the keywords :FUNCTION or :MACRO.
OUTCOME:
One of the keywords :SUCCESS, :FAILURE or :CONDITION.
DESCRIPTION:
When the OUTCOME is :SUCCESS, this is NIL. When the OUTCOME is :FAILURE, the failure
description provided by the assertion as a second value. When the OUTCOME is :CONDITION,
the description of the condition.
CONDITION:
When the OUTCOME is :CONDITION, the condition.
structure-object
.
common-lisp
.
common-lisp
.
A structure capturing a testcase result.
Slots are populated as follows:
NAME:
The symbol designating the testcase.
PATH:
The path of the testcase in the test hierarchy. This the stack of preceding testcases in
the test hierarchy.
ARGUMENTS:
The list of evaluated arguments for the testcase.
TOTAL:
The total number of assertions in the testcase and its descendants.
SUCCESS:
The total number of assertions that yielded a :SUCCESS in the testcase and its descendants.
FAILURE:
The total number of assertions that yielded a :FAILURE in the testcase and its descendants.
CONDITION:
The total number of assertions that yielded a :CONDITION in the testcase and its descendants.
SKIP:
The total number of assertions that yielded a :SKIP in the testcase and its descendants.
RESULTS:
The list of testcase results and assertions results yielded by descendants.
structure-object
.
common-lisp
.
This class models test suite execution supervisors.
When running a test suite, the progress and results of the execution
are recorded in a SUPERVISOR instance.
Descendants of this class provide more functionalities.
t
When *BATCH-MODE* is NIL, the debugger will pop-up on failed assertions, unless the operator has required to scroll through errors when restarting on a previous error of the current testcase.
The current supervisor.
The interaction mode for running testcases.
Accepted values are NIL, :RETRY, :CONTINUE, :IGNORE or :SKIP.
When the SWANK feature is active, we assume interactive use of the system and initialise the interaction mode to :RETRY. It is set to NIL otherwise.
The current path in the testcase hierarchy.
When running in a testcase, the first elements of *testcase-path* designate this
specific testcase.
The accumulated results of the current testcase. This is NIL when not running in a testcase.
Flag governing skipping assertions in the current testcase.
The supervisor class to use when running test suites.
Concatenate initial FORMS which are strings and use this as a control string.
Supervise the execution of FORM with restarts.
Supervise the execution of the assertion FORM and return ASSERTION evaluation details.
Handle the main line for ASSERT-FAILURE.
Handle unexpected conditions in ASSERT-FAILURE.
Count the total number of assertions in RESULTS.
Count the total number of assertions in RESULTS that yielded a OUTCOME.
Walks through BODY-FORMS and wrap assertion forms in a RESTART-CASE.
Predicate recognising TEXT matching a globbing PATTERN.
This event is sent to a supervisor, when a test suite starts. This is the appropriate place to prepare output files, register starting time and so on.
progn
.
:most-specific-first
null
)) ¶supervisor
)) ¶This event is sent to a supervisor when a test suite ends. This is the appopriate place to close output files, display aggregated reports.
progn
.
:most-specific-first
tally-supervisor
) results) ¶null
) results) ¶supervisor
) results) ¶serious-condition
.
:details
A pointless supervisor reports assertion progress with dots and capital letter E, for success and errors respectively. At the end of a testsuite, it prints basic counts describing the current testsuite and a detailed failure report.
70
A serviceable supervisor reports assertion failures as they come. At the end of the toplevel testsuite it displays a tally of the failures.
70
A tally supervisor counts TESTCASE and ASSERTION by their outcomes. At the end of a testsuite, it prints basic counts describing the current testsuite and a detailed failure report.
A trace supervisor reports each event sent to it.
A verbose supervisor owns a STREAM-OUTPUT.
*standard-output*
Jump to: | (
A C D F G M R S T |
---|
Jump to: | (
A C D F G M R S T |
---|
Jump to: | *
A C D F N O P R S T W |
---|
Jump to: | *
A C D F N O P R S T W |
---|
Jump to: | A C F K M P R S T U V |
---|
Jump to: | A C F K M P R S T U V |
---|