Next: Introduction, Previous: (dir), Up: (dir) [Contents][Index]
This is the lisp-unit2 Reference Manual, version 0.2.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Mon Aug 15 05:13:49 2022 GMT+0.
Next: Systems, Previous: The lisp-unit2 Reference Manual, Up: The lisp-unit2 Reference Manual [Contents][Index]
lisp-unit2 is a Common Lisp library that supports unit testing. It is a new version of a library of the lisp-unit library written by Chris Riesbeck. There is a long history of testing packages in Lisp, usually called "regression" testers. More recent packages in Lisp and other languages have been inspired by JUnit for Java.
Recently longtime users at Acceleration.net felt motivated to refactor significantly, attempting to make some broad improvements to the library while maintaining its benefits and workflow
(lambda (body-thunk) (let ((*var* 1))(funcall body-thunk)))
(ql:quickload :lisp-unit2)
or ASDF
: (asdf:load-system :lisp-unit2)
.(lisp-unit2:define-test my-tests::test-subtraction
(:tags '(my-tests::bar))
(assert-eql 1 (- 2 1)))
;; with-summary provides results while the tests are running
;;;; using the context function
(run-tests :package :my-tests
:run-contexts #'with-summary-context)
;;;; using the context macro (does the same thing as
;;;; :run-contexts, See Contexts below for an explanation).
(with-summary () (run-tests :package :my-tests))
;; to print the results after the run is complete
(print-summary (run-tests :tags 'my-tests::bar))
;; The difference is in whether or not the output occurs while the
;; tests are running or after all the tests have run
;; to disable the debugger:
(let (*debugger-hook*)
(run-tests :tests 'my-tests::test-subtraction))
;; to debug failed assertions with the context function
(run-tests :tests 'my-tests::test-subtraction
:run-contexts #'with-failure-debugging-context)
;; or use the context macro
(with-failure-debugging ()
(run-tests :tests 'my-tests::test-subtraction))
See the internal test suite for more and better examples (internal-test/*)
The define-test
macro is the primary way to install a
test. define-test
creates a function with the same name as the test,
which can be called to execute the test. This is nice because there
is a direct way to call every test, but also because the test has
implicit source destination and thus "go-to-definition" on any
printing of the test name will take you directly to the test in
question. define-test
also creates a unit-test object and inserts
it into the test-database.
The test body is compiled at the time of definition (so that any compile warnings or errors are immediately noticeable) and also before every run of the test (so that macro expansions are never out of date).
package
: if package is provided the test name and all tags are
reinterned into that package before definition. This is mostly for
porting lisp-unit systems where test-names were not functions and so
tests could be named the same as the function they tested.contexts
(see Contexts below): a (single or tree of) context
fn that will be applied around the test bodytags
: a list of symbols used to organize tests into groups (not
hierarchical)Because lisp-unit2 keeps a database of tests and functions, removing a
tests is not as simple as deleteing the test from from your
file. Instead a function uninstall-test
and a macro undefine-test
allow you to remove all the runtime components of a test from
lisp-unit2. Uninstall-test
accepts the test's symbolic name.
Undefine-test
is a macro whose form mimics define-test, so that you
can simply add the two characters and compile the form to remove the
test. This also gives you the ability to easily leave tests in your
test file that are inactive currently.
The primary entry point for running tests is
lisp-unit2:run-tests
. run-tests
and get-tests
both accept (&key
tests tags package reintern-package) as discussed below in "Test
Organization". Each test can also be run individually by calling the
function named for the test, and by calling lisp-unit2:run-test
which each return a single test-result
.
run-tests
returns a test-results-db, and aside from the keys above
accepts,
run-contexts
: a (single, or list of) context that will be
applied around the entire body of running the teststest-contexts
: a (single, or list of) context that will be
applied around each tests body. This will be around any contexts
defined on the unit testname
: a name used for this test run. Useful for identifying what
defaults to all packages being tested. We attempt to make a good
default if nothing is providedOnce you have a test-result-db (or list there of) you can call
rerun-tests
or rerun-failures
to rerun and produce new results.
Tests are organized by their name and by tags. Both of these are symbols in some package. Tests can be retrieved by their name, the package that their name is in, and any of the tags that reference the test.
The most common way to retrieve and run unit tests is run-tests which calls get-tests.
(lisp-unit2:run-tests &key tests tags package reintern-package)
(lisp-unit2:get-tests &key tests tags package reintern-package)
Both of these functions accept:
If no arguments are provided lisp-unit2 will run all tests in package
In some cases, particularly when converting from lisp-unit(1) we need
our tests to be in a different package (because tests are functions in
their name's package). In lisp-unit these tests would not conflict
with a function named the same (because tests were not functions). To
ease conversion, the reintern-package argument will reintern all test
names and tags provided into a different package. Define test accepts
a package
argument that mirrors this functionality. Suggested usage
is to either have tests be named differently from the functions they test
or to have tests and tags be in an explicitly referenced package, eg:
(define-test my-tests::test1 (:tags '(my-tests::tag1)) ...)
Tests are organized into the *test-db*
which is an instance
test-database
. These can be rebound if you needed to write tests
about your test framework (see the internal example-tests).
While lisp-unit does not have any specific notion of a suite, it is believed that the tests are composable enough that explicit test suites are not needed.
One suggestion would be to have named functions that run you specific set of tests:
(defun run-{suite} ()
(lisp-unit2:run-tests
:name :{suite}
{stuff to test} ))
(defun run-symbol-munger-and-lisp-unit2-tests ()
(lisp-unit2:run-tests
:name :symbol-munger-and-lisp-unit2-tests
:package '(:symbol-munger-tests :lisp-unit2-tests)))
(defun run-error-and-basic-tests ()
(lisp-unit2:run-tests
:name :error-and-basic-tests
:tests '(symbol-munger-test::test-basic)
:tags '(:errors lisp-unit2-tests::errors)))
Another suggestion would be to define tests that call other tests:
(define-test suite-1 (:tags '(suites))
(test-fn-1) ;; calls test-fn-1 unit-test
(lisp-unit2::run-tests ...) ; runs an entire other set of unit tests)
All assert-*
macros signal assertion-pass
and assertion-fail
by
comparing their expected results to the actual results during
execution. All other values in the assert forms are assumed to be
extra data to aid debugging.
assert-{equality-test}
macros compare the actual to the expected
value of each of the values returned from expected (see:
multiple-values) (eg: (assert-eql exp act)
=> (eql act exp)
) This
ordering was used so that functions like typep, member, etc could be
used as test.
assert-false
and assert-true
simply check the generic-boolean
truth of their first arg (eg: null and (not null)
assert-{signal}
and assert-{no-signal}
macros are used for testing
condition protocols. Signals that are expected/not-expected handled.
Actual values are compared to all expected values, that is:
LISP-UNIT2-TESTS> (lisp-unit2:with-assertion-summary ()
(assert-eql (values 1 2) (values 1 2 3)))
<No Test>:Passed (ASSERT-EQL (VALUES 1 2) (VALUES 1 2 3))
T
LISP-UNIT2-TESTS> (lisp-unit2:with-assertion-summary ()
(assert-eql (values 1 2 3) (values 1 2)))
Failed Form: (ASSERT-EQL (VALUES 1 2 3) (VALUES 1 2))
Expected 1; 2; 3
but saw 1; 2
Debugging is controlled by *debugger-hook*
(as is usual in common-lisp).
You can make lisp-unit simply record the error and move on by binding
*debugger-hook*
to nil around your run-tests
call.
If you would like to debug failed assertions you can wrap your call in
with-failure-debugging
or apply the with-failure-debugging-context
to the unit-test run.
All output is printed to *test-stream*
(which by default is
*standard-output*
). Most forms do not output results by default,
instead returning a result object. All results objects can be printed
(to *test-stream*
) by calling print-summary
on the object in
question.
print-summary
prints information about passing as well as failing
tests. print-failure-summary
can be called to print only messages
about failures, warnings, errors and empty tests (empty tests had no
assertions). Care is taken to print tests with their short, but still
fully packaged symbol-name (so that go-to-definition) works.
When running interactively with-summary(-context)
can provide
real-time output, printing start messages and result messages for each
test. with-assertion-summary(-context)
provides even more detailed
output printing a message for each assertion passed or failed.
Test results (from one or many runs) can be captured using
with-test-results
. The arg: collection-place
will copy all the
results as they arrive into a location of your choosing (eg: variable,
object slot). The arg: summarize?
will print a failure summary of
each test-run after all of the tests are finished running. This is
useful for collecting separate results for many packages or systems
(see test-asdf-system-recursive). If no args are provided summarize?
is defaulted to true.
Lisp-unit2 provides TAP (test anything protocol) test results (printed in such a way that jenkins tap plugin can parse them).
with-tap-summary
prints tap results as the tests run write-tap
,
write-tap-to-file
accept a test-results database and write the TAP
results either to test-stream or a file
asdf:test-system
is assumed to be the canonical way of testing a
every system, and so lisp-unit2 makes effort to work well with
test-system
Here is an example asdf:test-sytem definition, which will print the verbose summary of the tests as they run.
(defmethod asdf:perform ((o asdf:test-op) (c (eql (find-system :symbol-munger))))
(asdf:oos 'asdf:load-op :symbol-munger-test)
(let ((*package* (find-package :symbol-munger-test)))
(eval (read-from-string "
(lisp-unit2:with-summary ()
(lisp-unit2:run-tests
:package :symbol-munger-test
:name :symbol-munger
:run-context))
"))))
Additionally, lisp-unit2 provides test-asdf-system-recursive which accepts a (list or single) system name, looks up all its dependencies and calls asdf:tests-system on each listed system. Any lisp-unit or lisp-unit2 test-results-dbs are collected and returned at the end. A failure summary is also printed for each result db (so that after running many tests you are presented with a short synopsis of what ran and what failed.
There is an interop layer for converting test results from other systems to lisp-unit2 test results, so that we can gather and summarize more information. Currently this is only implemented for lisp-unit1, but patches would be welcome to allow collecting test results from any other lisp test systems. (This is currently a bit tedious, simplification patches welcome as well, see interop.lisp).
Signals are used throughout lisp-unit2 to communicate progress and results throughout lisp unit
missing-test
: when asked to run a test that does not existtest-start
: when a unit test starts, contains a ref to the
unit-testtest-complete
: when a test completes contains a ref to results for
that test (test-result)all-tests-start
, all-tests-complete
: signaled at the beginning
and end of run-tests, contains a ref to the test-results-dbcollect-test-results
: used in it interop to send results to
with-test-results
assertion-pass
: signaled when an assertion passesassertion-fail
: signaled when an assertion failsAll signals have an abort interrupt which simply cancels the signal. This is mostly used for meta-testing (ie: testing lisp-unit2), but there are conceivably other uses.
Contexts allow you to manipulate the dynamic state of a given unit-test or test-run. These are functions of a single required argument (a thunk), that they execute inside of a new/changed dynamic environment.
A good example is the with-failure-debugging-context, which simply invokes the debugger whenever we signal a failed assertion
(defun with-failure-debugging-context (body-fn)
"A context that invokes the debugger on failed assertions"
(handler-bind ((assertion-fail #'invoke-debugger))
(funcall body-fn)))
Both define-test
and run-tests
accept a tree of contexts that is
flattened and turned into a single context function (see
combine-contexts
). This function then executes the body-fn for us
(see: do-contexts
).
This should allow any type of manipulation of the current lisp-unit2 environment through access to handling signals and setting up and tearing down dynamic environments.
Example Contexts:
Example test-with-contexts defintion:
(defmacro db-render-test (name (&rest args) &body body)
`(lisp-unit2:define-test ,name
(:tags ',args
:contexts
(list #'test-context #'dom-context #'database-context )
:package :test-objects)
,@body))
test-database
: a list and some indexes of all installed testsunit-test
: an object containing the name, code, contexts, and
documentation for a single unit-testtest-results-db
: a collection of results from a single run-tests
calltest-result
: the result of running a single unit testfailure-result
: information useful for debugging failures (eg: unit-test,
the form that failed, the expected and actual results)Next: Files, Previous: Introduction, Up: The lisp-unit2 Reference Manual [Contents][Index]
The main system appears first, followed by any subsystem dependency.
Common Lisp library that supports unit testing.
MIT
0.2.0
Next: Packages, Previous: Systems, Up: The lisp-unit2 Reference Manual [Contents][Index]
Files are sorted by type and then listed depth-first from the systems components trees.
Next: lisp-unit2/package.lisp, Previous: Lisp, Up: Lisp [Contents][Index]
lisp-unit2 (system).
Next: lisp-unit2/assert-package.lisp, Previous: lisp-unit2/lisp-unit2.asd, Up: Lisp [Contents][Index]
lisp-unit2 (system).
Next: lisp-unit2/vars.lisp, Previous: lisp-unit2/package.lisp, Up: Lisp [Contents][Index]
package.lisp (file).
lisp-unit2 (system).
Next: lisp-unit2/collectors.lisp, Previous: lisp-unit2/assert-package.lisp, Up: Lisp [Contents][Index]
assert-package.lisp (file).
lisp-unit2 (system).
Next: lisp-unit2/asserts.lisp, Previous: lisp-unit2/vars.lisp, Up: Lisp [Contents][Index]
vars.lisp (file).
lisp-unit2 (system).
Next: lisp-unit2/lisp-unit.lisp, Previous: lisp-unit2/collectors.lisp, Up: Lisp [Contents][Index]
collectors.lisp (file).
lisp-unit2 (system).
Next: lisp-unit2/summarize.lisp, Previous: lisp-unit2/asserts.lisp, Up: Lisp [Contents][Index]
asserts.lisp (file).
lisp-unit2 (system).
Next: lisp-unit2/rational.lisp, Previous: lisp-unit2/lisp-unit.lisp, Up: Lisp [Contents][Index]
lisp-unit.lisp (file).
lisp-unit2 (system).
Next: lisp-unit2/floating-point.lisp, Previous: lisp-unit2/summarize.lisp, Up: Lisp [Contents][Index]
summarize.lisp (file).
lisp-unit2 (system).
%seq-rational-equal (function).
Next: lisp-unit2/test-anything-protocol.lisp, Previous: lisp-unit2/rational.lisp, Up: Lisp [Contents][Index]
rational.lisp (file).
lisp-unit2 (system).
Next: lisp-unit2/interop.lisp, Previous: lisp-unit2/floating-point.lisp, Up: Lisp [Contents][Index]
floating-point.lisp (file).
lisp-unit2 (system).
Previous: lisp-unit2/test-anything-protocol.lisp, Up: Lisp [Contents][Index]
test-anything-protocol.lisp (file).
lisp-unit2 (system).
Next: Definitions, Previous: Files, Up: The lisp-unit2 Reference Manual [Contents][Index]
Packages are listed by definition order.
Previous: lisp-unit2-asserts, Up: Packages [Contents][Index]
Next: Indexes, Previous: Packages, Up: The lisp-unit2 Reference Manual [Contents][Index]
Definitions are sorted by export status, category, package, and then by lexicographic order.
Next: Internals, Previous: Definitions, Up: Definitions [Contents][Index]
Next: Macros, Previous: Public Interface, Up: Public Interface [Contents][Index]
Set the error epsilon if the defaults are not acceptable.
The current test result (bound in %run-test)
The current results database (bound in run-tests)
Default to 4 significant figures.
The unit test database is a list of tests and some hashtable indexes
The currently executing unit test (bound in %run-test, ie every test function)
Next: Ordinary functions, Previous: Special variables, Up: Public Interface [Contents][Index]
Assert whether expected and form are EQ.
Assert whether expected and form are EQL.
Assert whether expected and form are EQUAL.
Assert whether expected and form are equal according to test.
Assert whether expected and form are EQUALP.
Assert whether form signals condition.
Assert whether form expands to expansion.
Assert whether the form is false.
Assert whether form signals condition.
Assert whether printing the form generates the output.
Assert whether the form is true.
Assert whether expected and form are TYPEP.
Defines a new test object, test functions and installs the test
function in the test database
name: the name of the test and the test-function
contexts: a (lambda (fn)...) (or list of) that runs the fn in a dynamic
context
tags: symbols that can be used to group tests
If package is provided, the name and any provided tags are reinterned into
package before use. Keywords are left alone. This is useful because many
times tests and the functions they test, coexist (and always could in
lisp-unit v1, now that we create test functions, we dont want them
overwriting the original function).
Note: This should probably not be used (rather opting for
packaged::symbols), but will be useful when converting from lisp-unit
1->2. See also: run-tests, get-tests reintern-package
A context macro that invokes the debugger on failed assertions
see with-test-results-context
Next: Generic functions, Previous: Macros, Up: Public Interface [Contents][Index]
Return a list of the indices and error between the array elements.
Return a random complex number.
finds tests by names, tags, and package
if reintern-package is provided, reintern all symbols provided for tests
and tags into the reintern-package. Mostly provided for easing conversion
of lisp-unit1 test suites
Return a list of the tags
Return a list of all tests,
use get tests to find tests by package tag or name
Return a nested list with INITIAL-ELEMENT.
Return a 2D array of random numbers.
Return a nested list of random numbers.
Return a list of random numbers.
Return true if the numbers are equal within some epsilon, optionally requiring the types to be identical.
Remove individual tags or entire sets.
Remove individual tests or entire sets.
Return true if every element of list1 is an element of list2 and vice versa.
Returns the code stored for the test name.
Return the documentation for the test.
A context that invokes the debugger on failed assertions
A context that collects test-result-databases
if collection-place-setter (lambda (new) (setf collection-place new)) exists
anytime we get a new test result we set the place to the new collection
if summarize? at the end of the block we print the results summary for all tests this defaults to T if no collection-place-setter is provided and nil otherwise
Write the test results to ‘stream‘ in TAP format. Returns the test results.
write the test results to ‘path‘ in TAP format, overwriting ‘path‘. Returns pathname to the output file
Next: Standalone methods, Previous: Ordinary functions, Up: Public Interface [Contents][Index]
Return the default epsilon for the value.
automatically generated reader method
automatically generated writer method
automatically generated reader method
automatically generated writer method
automatically generated reader method
automatically generated writer method
Return true if the floating point data is equal.
automatically generated reader method
automatically generated writer method
Return the element-wise norm of the data.
Return the entrywise norm of the array according to the measure.
Return the norm of the vector according to the measure.
Return the norm of the list according to the measure.
Return true if the norm of the data is equal.
Return true if the arrays are equal in length and the relative error norm is less than epsilon.
Return true if the vectors are equal in length and the relative error norm is less than epsilon.
Return true if the vector and the list are equal in length and the relative error norm is less than epsilon.
Return true if the vector and the list are equal in length and the relative error norm is less than epsilon.
Return true if the lists are equal in length and the relative error norm is less than epsilon.
Return true if the results are numerically equal according to :TEST.
Return true if the arrays are equal in dimension and each element is equal according to :TEST.
Return true if every element of the list is equla to the corresponding element of the vector.
Return true if every element of the list is equal to the corresponding element of the vector.
Return true if the vectors are equal in length and each element is equal according to :TEST.
Return true if the lists are equal in length and each element is equal according to :TEST.
Return true if the the numbers are equal according to :TEST.
automatically generated reader method
automatically generated writer method
Return true if the rational data is equal.
Return true if the arrays are equal in dimension and element-wise equal.
Return true if the vectors are equal in length and element-wise equal.
Return true if the vector and the list are equal in length and element-wise equal.
Return true if the vector and the list are equal in length and element-wise equal.
Return true if the lists are equal in length and element-wise equal.
Return true if the complex parts are rational and equal.
Return true if the rational numbers are equal.
Return the relative-error between the 2 quantities.
Return the relative error of the complex numbers.
Return the relative error between the float and complex number.
Return the relative error between the float and complex number.
Return the error delta between the exact and approximate floating point value.
Return the relative error norm
Return the relative error norm of the arrays.
Return the relative error norm of the vectors.
Return the relative error norm of the list and the vector.
Return the relative error norm of the list and the vector.
Return the relative error norm of the lists.
reruns failed tests
Rerun all tests from a given run (returns new results)
automatically generated reader method
automatically generated writer method
Run the specified tests.
We run all the listed tests, and all tests tagged with tags. If both test
and tags are nil (the default), then we run all tests in
package (defaulting to *package*)
name is the name of the test run. Generally expected to be the name of the system
being tested. Can be defaulted with the name parameter of with-summary as well.
can also be defaulted with.
reintern-package: when looking up tests, first reintern all tests and tags
in this package. In general this should probably not be used, but is provided
for convenience in transitioning from lisp-unit 1 to 2 (see: define-test package)
test-contexts is a list of contexts that will be applied around
each individual test
run-contexts is a list of contexts that will be applied around the entire
suite (around signals)
exclude-tests, exclude-tags: tests / tags to remove from the
run. explicit inclusion overrides, explicit exclusion, overrides
implicit inclusion
EG: (define-test test-takes-forever (manual stuff) ...)
(find-test :tags ’stuff :exclude-tags ’manual)
will not find test-takes-forever
(find-test :tags ’(stuff manual) :exclude-tags ’manual)
(find-test :tests ’test-takes-forever :exclude-tags ’manual)
both will find test-takes-forever
Return true if the data have equal significant figures.
Return true if the arrays are equal in length and the element-wise comparison is equal to significant figures.
Return true if the vectors are equal in length and the element-wise comparison is equal to significant figures.
Return true if the list and the vector are equal in length and the element-wise comparison is equal to significant figures.
Return true if the vector and the list are equal in length and the element-wise comparison is equal to significant figures.
Return true if the lists are equal in length and the element-wise comparison is equal to significant figures.
Return true if the floating point numbers have equal significant figures.
Return the scaling parameter and the sum of the powers of p of the ~ data.
Return the scaling parameter and the sum of the powers of p of the ~ array.
Return the scaling parameter and the sum of the powers of p of the ~ vector.
Return the scaling parameter and the sum of the powers of p of the ~ data.
Return the scaling parameter and the sum of the squares of the ~ data.
Return the scaling parameter and the sum of the squares of the ~ array.
Return the scaling parameter and the sum of the squares of the ~ vector.
Return the scaling parameter and the sum of the squares of the ~ list.
Uninstalls a previously defined unit test
automatically generated reader method
automatically generated reader method
automatically generated writer method
automatically generated writer method
automatically generated reader method
automatically generated writer method
Next: Conditions, Previous: Generic functions, Up: Public Interface [Contents][Index]
Print the auto-print-items for this instance.
Print the summary counts with the object.
Next: Classes, Previous: Standalone methods, Up: Public Interface [Contents][Index]
Signaled when a test run is finished.
Signaled when a single test starts.
condition.
(quote nil)
:results
condition.
(quote lisp-unit2:*unit-test*)
:unit-test
(quote nil)
:assertion
(quote nil)
:failure
Signaled that with-test-results should collect this test-result-database
condition.
(quote nil)
:results
Signaled when a single test is finished.
warning.
(quote nil)
:test-name
Signaled when a single test is finished.
condition.
(quote nil)
:result
Signaled when a single test starts.
condition.
(quote nil)
:unit-test
Previous: Conditions, Up: Public Interface [Contents][Index]
Failure details of the assertion.
lisp-unit2:*unit-test*
:unit-test
:actual
:expected
:extras
Store the results of the tests for further evaluation.
:name
:tests
:results
Organize the unit test documentation and code.
:tags
tags.
:most-recent-result
:eval-package
Previous: Public Interface, Up: Definitions [Contents][Index]
List of statuses in order of priority for categorizing test runs
Next: Ordinary functions, Previous: Special variables, Up: Internals [Contents][Index]
Expand the assertion to the internal format.
Expand extra forms.
Expand the macro form once.
Capture the output of the form in a string.
Next: Generic functions, Previous: Macros, Up: Internals [Contents][Index]
Return a list of the indices, values and error of the elements that are not equal.
Recursively calculate the indices from the row major index.
Return a random complex float number.
Return a random complex rational number.
Descend into the forms checking for equality.
The first unequal part is the second value
Return true if the relative error norm is less than epsilon.
Return the normalized floating point number and exponent.
Return the relative error of the numbers.
Return the relative error norm of the sequences.
This should only be called from run-test-name, which everyone else should call This ensures our test name is easily in the inspector and the redefining a test then retrying calls the new test body
Return true if the sequences are equal length and at each position the corresponding elements are equal.
Return true if the element-wise comparison is equal to the specified significant figures.
Return true if the sequences are equal in length and each element is equal according to :TEST.
Return a sequence of the indice and error between the sequences.
Return true if the floating point numbers have equal significant figures.
Coerces its argument to a unit-test argument
always look up by name so that rerunning a suite after uninstalling a test behaves appropriately
returns a date as {y}{mon}{d}-{h}{min}{s}, defaults to get-universal-time
intended for use in datestamping filenames
Output a single test, taking care to ensure the indentation level is the same before and after invocation.
Takes a list of nils and contexts and combines them into a single context (or null of no contexts were provided)
runs the body-fn inside of contexts, the last context will be the outermost all nils in contexts are ignored
Perform the assertion and record the results.
Write the null-tags-warning to the stream.
Write the null-tests-warning to the stream.
Alias for write-tap for backwards and forwards consistency
as we are finishing a test (ie: it has the right status) record the result
Return a sequence of the indice and error between the sequence elements.
Write the test-name-error to the stream.
Signal a type-error if the test name is not a symbol.
Next: Conditions, Previous: Ordinary functions, Up: Internals [Contents][Index]
Return the norm of the data according to measure.
Return the infinity, or maximum, norm of the vector.
Return the infinity, or maximum, norm of the list.
Return the Euclidean norm of the vector.
Return the Euclidean norm of the list.
Return the Euclidean norm of the vector.
Return the Euclidean norm of the list.
Return the Taxicab norm of the vector.
Return the Taxicab norm of the list.
Print a summary of all results to the stream.
automatically generated reader method
automatically generated writer method
automatically generated reader method
automatically generated writer method
automatically generated reader method
args.
automatically generated writer method
args.
Return the result of the assertion.
A function that accepts a test thunk and executes
with a given context (eg: database-connects, html-collectors,
http-context etc)
Convert the test results from a given test system to lisp-unit2:test-results-db
Convert the test results from a given test system to lisp-unit2:test-results-db
Shared data so the context
data.
automatically generated reader method
automatically generated writer method
automatically generated reader method
automatically generated writer method
automatically generated reader method
automatically generated writer method
automatically generated reader method
form.
automatically generated writer method
form.
automatically generated reader method
head.
automatically generated writer method
head.
Installs a unit test, generally only called from define-test
automatically generated reader method
automatically generated writer method
automatically generated reader method
automatically generated writer method
automatically generated reader method
len.
automatically generated writer method
len.
automatically generated reader method
name.
automatically generated writer method
name.
automatically generated reader method
automatically generated writer method
automatically generated reader method
automatically generated writer method
Record the details of the failure.
automatically generated reader method
automatically generated writer method
automatically generated reader method
automatically generated writer method
automatically generated reader method
automatically generated writer method
automatically generated reader method
tags.
automatically generated writer method
tags.
name.
automatically generated reader method
tail.
automatically generated writer method
tail.
automatically generated reader method
test.
automatically generated writer method
test.
automatically generated reader method
automatically generated writer method
name.
Retrieve all tests with a given status from the database
Next: Classes, Previous: Generic functions, Up: Internals [Contents][Index]
simple-warning.
:name
This slot is read-only.
simple-warning.
:name
This slot is read-only.
The test name error is a type error.
type-error.
Initarg | Value |
---|---|
:expected-type | (quote symbol) |
Previous: Conditions, Up: Internals [Contents][Index]
Result of a failed equal assertion.
Result of a failed error assertion.
Result of a failed macro expansion assertion.
Result of a failed output assertion.
Result of a failed warning assertion.
:%tests
(make-hash-table)
:name-index
(make-hash-table)
:package-index
(make-hash-table)
:tag-index
(get-universal-time)
:start-time
(get-internal-real-time)
:internal-start-time
:end-time
:internal-end-time
Helps commonize test construction by providing a shared data and dynamic context
A function that accepts a test thunk and executes
with a given context (eg: database-connects, html-collectors,
http-context etc)
:contexts
Previous: Definitions, Up: The lisp-unit2 Reference Manual [Contents][Index]
Jump to: | %
(
A C D E F G H I L M N P R S T U V W |
---|
Jump to: | %
(
A C D E F G H I L M N P R S T U V W |
---|
Next: Data types, Previous: Functions, Up: Indexes [Contents][Index]
Jump to: | %
*
+
A C D E F H I L M N P R S T U W |
---|
Jump to: | %
*
+
A C D E F H I L M N P R S T U W |
---|
Jump to: | A C E F I L M N O P R S T U V |
---|
Jump to: | A C E F I L M N O P R S T U V |
---|