Next: Introduction, Previous: (dir), Up: (dir) [Contents][Index]
This is the clunit2 Reference Manual, version 0.3.0, generated automatically by Declt version 3.0 "Montgomery Scott" on Mon Apr 19 15:40:22 2021 GMT+0.
• Introduction | What clunit2 is all about | |
• Systems | The systems documentation | |
• Modules | The modules documentation | |
• Files | The files documentation | |
• Packages | The packages documentation | |
• Definitions | The symbols documentation | |
• Indexes | Concepts, functions, variables and data types |
* CLUnit * Overview CLUnit is a Common Lisp unit testing framework. It is designed to be easy to use so that you can quickly start testing. - Author: Tapiwa Gutu - Maintainer of this fork: cage CLUnit provides a rich set of features aimed at improving your unit testing experience: + Multiple inheritance for test suites allows you to group tests into hierarchies. + Composes the test results of each test run into a single report. + Allows redefinition of inline functions and macros without having to redefine your tests. + Supports composable test suite fixtures. + Allows for an interactive testing process which gives you access to the test environment. + Provides visual feedback of the unit test progress. + Extensible test reporting. Builtin support for default reporting and [[http://en.wikipedia.org/wiki/Test_Anything_Protocol]["Test Anything Protocol" (TAP)]] output. + Released under MIT license Check out the comprehensive [[http://tgutu.github.com/clunit][CLUnit Tutorial]]. * Example #+BEGIN_SRC lisp (ql:quickload "clunit") (use-package :clunit) ;; Test suite for all number operation tests. (defsuite number-suite ()) ;; Test suite for floating point operations (defsuite float-suite (number-suite)) (defsuite integer-suite (number-suite)) ;; Define a test called TEST-INT1 (deftest test-int-1 (integer-suite) (assert-true (= 1 1)) (assert-equalp 4 (+ 2 2))) ;; Define a test called TEST-FLOAT1 (deftest test-float-1 (float-suite) (assert-true (= 1.0 -1.0)) (assert-equalp 4.0 (+ 2.0 2.0))) (run-suite 'number-suite) #+END_SRC which produces the output: #+BEGIN_SRC PROGRESS: ========= NUMBER-SUITE: (Test Suite) INTEGER-SUITE: (Test Suite) TEST-INT-1: .. FLOAT-SUITE: (Test Suite) TEST-FLOAT-1: F. FAILURE DETAILS: ================ NUMBER-SUITE -> FLOAT-SUITE: (Test Suite) TEST-FLOAT-1: Expression: (= 1.0 -1.0) Expected: T Returned: NIL SUMMARY: ======== Test functions: Executed: 2 Skipped: 0 Tested 4 assertions. Passed: 3/4 some tests not passed Failed: 1/4 some tests failed #+END_SRC * Tests and assertions Each test, like ~test-int1~ in the above example, can contain a number of assertions, given in the table below: |-----------------------------------------+------------------------------------------------------------------------------------------------------------------------------| | Assertion | Description | |-----------------------------------------+------------------------------------------------------------------------------------------------------------------------------| | | <20> | | ~assert-true EXPRESSION~ | Passes if the expression ~EXPRESSION~ is not ~NIL~ | | ~assert-false EXPRESSION~ | Passes if ~EXPRESSION~ is ~NIL~ | | ~assert-eq VALUE EXPRESSION~ | Passes if ~(EQ VALUE EXPRESSION)~ returns true | | ~assert-eql VALUE EXPRESSION~ | Passes if ~(EQL VALUE EXPRESSION)~ returns true | | ~assert-equal VALUE EXPRESSION~ | Passes if ~(EQUAL VALUE EXPRESSION)~ returns true | | ~assert-equalp VALUE EXPRESSION~ | Passes if ~(EQUALP VALUE EXPRESSION)~ returns true | | ~assert-equality TEST VALUE EXPRESSION~ | Passes if ~(FUNCALL TEST VALUE EXPRESSION)~ returns true | | ~assert-equality* VALUE EXPRESSION~ | Passes if ~(FUNCALL *clunit-equality-test* VALUE EXPRESSION)~ returns true. By default *clunit-equality-test* is ~EQUALP~ | | ~assert-expands EXPANSION EXPRESSION~ | Tests macro expansion, passes if ~(EQUALP EXPANSION (MACROEXPAND-1 EXPRESSION))~ is true | | ~assert-condition CONDITION EXPRESSION~ | Passes if ~EXPRESSION~ signals ~CONDITION~ | | ~assert-fails FORMAT-STRING~ | Force test to fail, giving a format string for the message | |-----------------------------------------+------------------------------------------------------------------------------------------------------------------------------| All of these tests take optional forms, which are evaluated and printed if the test fails. These can be used to provide test diagnostics or documentation. For example #+BEGIN_SRC lisp (deftest test-suiteless () (let ((a 1) (b 2) (c 3)) (assert-true (= a b c) "This assertion is meant to fail." a b c ))) (run-test 'test-suiteless :report-progress nil) #+END_SRC produces the output: #+BEGIN_SRC FAILURE DETAILS: ================ TEST-SUITELESS: Expression: (= A B C) Expected: T Returned: NIL This assertion is meant to fail. A => 1 B => 2 C => 3 SUMMARY: ======== Test functions: Executed: 1 Skipped: 0 Tested 1 assertion. Failed: 1/1 all tests failed #+END_SRC * BUGS Please file bug report on the [[https://notabug.org/cage/clunit2/issues][issue tracker]] * Notes This is a fork of https://github.com/tgutu/clunit .
Next: Modules, Previous: Introduction, Up: Top [Contents][Index]
The main system appears first, followed by any subsystem dependency.
• The clunit2 system |
cage
Tapiwa Gutu
BSD
CLUnit is a Common Lisp unit testing framework.
CLUnit is a Common Lisp unit testing framework. It is designed to be easy to use so that you can quickly start testing.
CLUnit provides a rich set of features aimed at improving your unit
testing experience:
* Multiple inheritance for test suites allows you to group tests into hierarchies.
* Composes the test results of each test run into a single report.
* Allows redefinition of inline functions and macros without
having to redefine your tests.
* Supports composable test suite fixtures.
* Allows for an interactive testing process which gives you access to the test environment.
* Provides visual feedback of the unit test progress.
* Extensible test reporting. Builtin support for default reporting and TAP output.
0.3.0
clunit2.asd (file)
src (module)
Modules are listed depth-first from the system components tree.
• The clunit2/src module | ||
• The clunit2/src/classes module | ||
• The clunit2/src/functions module | ||
• The clunit2/src/report-formats module | ||
• The clunit2/src/macros module |
Next: The clunit2/src/classes module, Previous: Modules, Up: Modules [Contents][Index]
clunit2 (system)
src/
Next: The clunit2/src/functions module, Previous: The clunit2/src module, Up: Modules [Contents][Index]
specials.lisp (file)
src (module)
src/classes/
Next: The clunit2/src/report-formats module, Previous: The clunit2/src/classes module, Up: Modules [Contents][Index]
classes (module)
src (module)
src/functions/
Next: The clunit2/src/macros module, Previous: The clunit2/src/functions module, Up: Modules [Contents][Index]
functions (module)
src (module)
src/report-formats/
Previous: The clunit2/src/report-formats module, Up: Modules [Contents][Index]
report-formats (module)
src (module)
src/macros/
Files are sorted by type and then listed depth-first from the systems components trees.
• Lisp files |
Next: The clunit2/src/package․lisp file, Previous: Lisp files, Up: Lisp files [Contents][Index]
clunit2.asd
clunit2 (system)
Next: The clunit2/src/specials․lisp file, Previous: The clunit2․asd file, Up: Lisp files [Contents][Index]
Next: The clunit2/src/classes/assertion-conditions․lisp file, Previous: The clunit2/src/package․lisp file, Up: Lisp files [Contents][Index]
package.lisp (file)
src (module)
src/specials.lisp
Next: The clunit2/src/classes/test-suite-failure-conditions․lisp file, Previous: The clunit2/src/specials․lisp file, Up: Lisp files [Contents][Index]
classes (module)
src/classes/assertion-conditions.lisp
Next: The clunit2/src/classes/clunit-report․lisp file, Previous: The clunit2/src/classes/assertion-conditions․lisp file, Up: Lisp files [Contents][Index]
classes (module)
src/classes/test-suite-failure-conditions.lisp
Next: The clunit2/src/classes/clunit-test-case․lisp file, Previous: The clunit2/src/classes/test-suite-failure-conditions․lisp file, Up: Lisp files [Contents][Index]
classes (module)
src/classes/clunit-report.lisp
Next: The clunit2/src/classes/clunit-test-suite․lisp file, Previous: The clunit2/src/classes/clunit-report․lisp file, Up: Lisp files [Contents][Index]
classes (module)
src/classes/clunit-test-case.lisp
Next: The clunit2/src/classes/clunit-test-report․lisp file, Previous: The clunit2/src/classes/clunit-test-case․lisp file, Up: Lisp files [Contents][Index]
classes (module)
src/classes/clunit-test-suite.lisp
Next: The clunit2/src/functions/prepare-specials․lisp file, Previous: The clunit2/src/classes/clunit-test-suite․lisp file, Up: Lisp files [Contents][Index]
classes (module)
src/classes/clunit-test-report.lisp
Next: The clunit2/src/functions/assertion-functions․lisp file, Previous: The clunit2/src/classes/clunit-test-report․lisp file, Up: Lisp files [Contents][Index]
functions (module)
src/functions/prepare-specials.lisp
Next: The clunit2/src/functions/generic-functions․lisp file, Previous: The clunit2/src/functions/prepare-specials․lisp file, Up: Lisp files [Contents][Index]
functions (module)
src/functions/assertion-functions.lisp
Next: The clunit2/src/functions/test-case-functions․lisp file, Previous: The clunit2/src/functions/assertion-functions․lisp file, Up: Lisp files [Contents][Index]
functions (module)
src/functions/generic-functions.lisp
Next: The clunit2/src/functions/test-suite-functions․lisp file, Previous: The clunit2/src/functions/generic-functions․lisp file, Up: Lisp files [Contents][Index]
functions (module)
src/functions/test-case-functions.lisp
Next: The clunit2/src/functions/rerun-failed-tests․lisp file, Previous: The clunit2/src/functions/test-case-functions․lisp file, Up: Lisp files [Contents][Index]
functions (module)
src/functions/test-suite-functions.lisp
Next: The clunit2/src/functions/progress-report-functions․lisp file, Previous: The clunit2/src/functions/test-suite-functions․lisp file, Up: Lisp files [Contents][Index]
functions (module)
src/functions/rerun-failed-tests.lisp
rerun-failed-tests (function)
Next: The clunit2/src/report-formats/report-format-default․lisp file, Previous: The clunit2/src/functions/rerun-failed-tests․lisp file, Up: Lisp files [Contents][Index]
functions (module)
src/functions/progress-report-functions.lisp
Next: The clunit2/src/report-formats/report-format-tap․lisp file, Previous: The clunit2/src/functions/progress-report-functions․lisp file, Up: Lisp files [Contents][Index]
report-formats (module)
src/report-formats/report-format-default.lisp
Next: The clunit2/src/report-formats/print-object․lisp file, Previous: The clunit2/src/report-formats/report-format-default․lisp file, Up: Lisp files [Contents][Index]
report-formats (module)
src/report-formats/report-format-tap.lisp
Next: The clunit2/src/macros/utility-macros․lisp file, Previous: The clunit2/src/report-formats/report-format-tap․lisp file, Up: Lisp files [Contents][Index]
report-formats (module)
src/report-formats/print-object.lisp
Next: The clunit2/src/macros/assertion-macros․lisp file, Previous: The clunit2/src/report-formats/print-object․lisp file, Up: Lisp files [Contents][Index]
macros (module)
src/macros/utility-macros.lisp
Next: The clunit2/src/macros/deffixture․lisp file, Previous: The clunit2/src/macros/utility-macros․lisp file, Up: Lisp files [Contents][Index]
utility-macros.lisp (file)
macros (module)
src/macros/assertion-macros.lisp
Next: The clunit2/src/macros/defsuite․lisp file, Previous: The clunit2/src/macros/assertion-macros․lisp file, Up: Lisp files [Contents][Index]
assertion-macros.lisp (file)
macros (module)
src/macros/deffixture.lisp
Next: The clunit2/src/macros/deftest․lisp file, Previous: The clunit2/src/macros/deffixture․lisp file, Up: Lisp files [Contents][Index]
deffixture.lisp (file)
macros (module)
src/macros/defsuite.lisp
Previous: The clunit2/src/macros/defsuite․lisp file, Up: Lisp files [Contents][Index]
defsuite.lisp (file)
macros (module)
src/macros/deftest.lisp
Next: Definitions, Previous: Files, Up: Top [Contents][Index]
Packages are listed by definition order.
• The clunit package |
package.lisp (file)
common-lisp
Definitions are sorted by export status, category, package, and then by lexicographic order.
• Exported definitions | ||
• Internal definitions |
Next: Internal definitions, Previous: Definitions, Up: Definitions [Contents][Index]
• Exported special variables | ||
• Exported macros | ||
• Exported functions | ||
• Exported generic functions | ||
• Exported classes |
Next: Exported macros, Previous: Exported definitions, Up: Exported definitions [Contents][Index]
Holds the equality test used to compare values by the ASSERT-EQUALITY macro.<br/> The default value <em>#’equalp</em> is reset at the end of each test/suite run.
specials.lisp (file)
Controls the output format of the unit test results. Possible values are :default, :tap or NIL.
specials.lisp (file)
The stream where the output made by tests is printed (default to ‘*standard-output*’)
specials.lisp (file)
Next: Exported functions, Previous: Exported special variables, Up: Exported definitions [Contents][Index]
Evaluates EXPRESSION as an assertion, an assertion passes if
EXPRESSION signals CONDITION. FORMS and their values are printed if
the test fails.
Example:
(assert-condition arithmetic-error (/ 1 0)) ; This assertion passes.
assertion-macros.lisp (file)
Evaluates EXPRESSION as an assertion, an assertion passes if (EQ VALUE EXPRESSION) values non nil. FORMS and their values are printed if the test fails.
assertion-macros.lisp (file)
Evaluates EXPRESSION as an assertion, an assertion passes if (EQL VALUE EXPRESSION) values non nil. FORMS and their values are printed if the test fails.
assertion-macros.lisp (file)
Evaluates EXPRESSION as an assertion, an assertion passes if (EQUAL
VALUE EXPRESSION) values non nil. FORMS and their values are printed if
the test fails.
example
(let ((q (+ 2 -2)))
(assert-equal 4 q q))
;; This assertion fails and prints the message below with
;; *clunit-report-format* set to :DEFAULT.
Expression: (EQUAL 4 Q)
Expected: 4
Returned: 0
Q => 0
assertion-macros.lisp (file)
Evaluates EXPRESSION as an assertion, an assertion passes
if (FUNCALL TEST VALUE EXPRESSION) values non nil. FORMS and their
values are printed if the test fails.
Example:
(assert-equality #’string= "some string" "another string") ; This assertion fails.
assertion-macros.lisp (file)
Evaluates EXPRESSION as an assertion, an assertion passes
if (FUNCALL *clunit-equality-test* VALUE EXPRESSION) returns
true. FORMS and their values are printed if the test fails.
Example:
(let ((*clunit-equality-test* #’string=))
(assert-equality* "some string" "another string")) ; This assertion fails
assertion-macros.lisp (file)
Evaluates EXPRESSION as an assertion, an assertion passes if (EQUALP VALUE EXPRESSION) values non nil. FORMS and their values are printed if the test fails.
assertion-macros.lisp (file)
Evaluates EXPRESSION as an assertion, an assertion passes if (EQUALP EXPANSION (MACROEXPAND-1 EXPRESSION)) values non nil. FORMS and their values are printed if the test fails.
assertion-macros.lisp (file)
Evaluates EXPRESSION as an assertion, an assertion passes if it returns nil. FORMS and their values are printed if the test fails.
example:
(assert-false (= 1 2)) ; This assertion passes.
assertion-macros.lisp (file)
Evaluates EXPRESSION as an assertion, an assertion passes if it
returns any non-NIL value. FORMS and their values are printed if the
test fails. Remember in Common Lisp any non-NIL value is true, if you
want a strict binary assertion test use (assert-eq t expression)
instead.
Example:
(assert-true (= 1 1)) ; This assertion passes.
assertion-macros.lisp (file)
A fixture defines a code template that is wrapped around the code
of each test case and test suite that are executed by test suite
SUITE at runtime.. The test case body is plugged into the
template at the position identified by PLUG.
Fixtures are expanded at runtime, so the fixture that will wrap
around a test depends on the test suite call stack.
Example:
(deffixture arithmetic (@body) ; @body is the plug
(let ((x 0) (y 1) (z 2))
@body))
deffixture.lisp (file)
Defines a test suite called NAME. If PARENTS is non-NIL the test
suite is defined as a sub-suite of each of the test suites in
PARENTS.
Example:
(defsuite arithmetic ())
(defsuite arithmetic-+ (arithmetic))
defsuite.lisp (file)
Defines a test case called NAME. DECLARATIONS declares which test
suites this test case is associated with as well as any other test
cases that it depends on. The test case body is revaluated on each
run, so any redefinition of macros and inline functions will be
automatically visible without having to redefine the test.
A test case will be queued until all tests cases it depends on have been run.
If all the test cases pass the queued test is executed otherwise its skipped.
The DEFTEST macro has three possible forms:
- Define a test case not associated with any test suite and with no dependencies.<br/>
(deftest name () . body)
- Define a test case which is associated with test suites: suite1 ... suiteN.
(deftest name (suite1 suite2 ... suiteN) . body)
- Define a test case associated with test suites: suite1 ... suiteN and
depends on tests: test1 ... testN
(deftest name ((suite1 suite2 ... suiteN) (test1 test2 ... testN)) . body)
deftest.lisp (file)
Remove a fixture definition.
deffixture.lisp (file)
defsuite.lisp (file)
deftest.lisp (file)
Next: Exported generic functions, Previous: Exported macros, Up: Exported definitions [Contents][Index]
Calling this function is equivalent to signalling a failed assertion.
The FORMAT-STRING and ARGS are used to print the failure message as
follows:
(format stream "~?" format-string args)
If you want to achieve a nice looking output message, use pretty printing directives in the format string e.g. "~:@_" instead of "%".
assertion-macros.lisp (file)
Returns non-nil if a test suite called SUITE-NAME is defined, otherwise returns NIL.
test-suite-functions.lisp (file)
Returns non-nil if a test case called TEST-NAME is defined, otherwise returns NIL.
test-case-functions.lisp (file)
Returns a list of all test suite names that are children of the suite called SUITE-NAME.
test-suite-functions.lisp (file)
Returns a list of all test case names that are children of the suite called SUITE-NAME.
test-suite-functions.lisp (file)
Returns a list of all defined test suite names.
test-suite-functions.lisp (file)
Returns a list of all defined test case names.
test-case-functions.lisp (file)
Reruns all failed tests recorded in LAST-REPORT which defaults
to the report of the previous test run. If REPORT-PROGRESS is
non-NIL, the test progress is reported. If USE-DEBUGGER is
non-NIL, the debugger is invoked whenever an assertion fails.
If STOP-ON-FAIL is non-NIL, the rest of the unit test is
cancelled when any assertion fails or an error occurs.
If PRINT-RESULTS-SUMMARY is non nil the summary results of tests is printed on the standard output.
rerun-failed-tests.lisp (file)
Executes a test case called SUITE. If REPORT-PROGRESS is non-NIL,
the test progress is reported.
If USE-DEBUGGER is non-NIL, the debugger is invoked whenever an
assertion fails.
If STOP-ON-FAIL is non-NIL, the rest of the unit test is cancelled
when any assertion fails or an error occurs.
if PRINT-RESULTS-SUMMARY is non nil the summary results of tests is printed on the standard output.
test-suite-functions.lisp (file)
Executes a test case called ‘test’.
If REPORT-PROGRESS is non-NIL, the test progress is reported.
If USE-DEBUGGER is non-NIL, the debugger is invoked whenever an
assertion fails.
If STOP-ON-FAIL is non-NIL, the rest of the unit test is cancelled
when any assertion fails or an error occurs.
If PRINT-RESULTS-SUMMARY is non nil the summary results of tests is printed on the standard output.
test-case-functions.lisp (file)
Next: Exported classes, Previous: Exported functions, Up: Exported definitions [Contents][Index]
the reader function is used in test-case-execution-action (see utility functions)
clunit-test-report.lisp (file)
Non-nil if the report passed
clunit-test-report.lisp (file)
A list of ‘cl-test-report’ that contains all the test’s reports
clunit-report.lisp (file)
Previous: Exported generic functions, Up: Exported definitions [Contents][Index]
the clunit-report instance is used to store the
aggregated reports of all executed test cases (returned by ‘run-test’
and ‘rerun-failed-tests’.
clunit-report.lisp (file)
standard-object (class)
The number of tests that signalled an error condition during test executions.
:errors
0
errors (generic function)
(setf errors) (generic function)
The number of tests failed during test executions.
:failed
0
failed (generic function)
(setf failed) (generic function)
The number of tests that passed during test executions.
:passed
0
passed (generic function)
(setf passed) (generic function)
The number of tests that was skipped during test executions.
:skipped
0
skipped (generic function)
(setf skipped) (generic function)
A list of ‘cl-test-report’ that contains all the test’s reports
test-reports (generic function)
(setf test-reports) (generic function)
clunit-test-report.lisp (file)
standard-object (class)
the reader function is used in test-case-execution-action (see utility functions)
:test-name
test-report-name (generic function)
(setf test-report-name) (generic function)
Non-nil if the report passed
:passed-p
t
test-report-passed-p (generic function)
(setf test-report-passed) (generic function)
Non-nil if the test was skipped
:skipped-p
skipped-p (generic function)
(setf skipped-tests) (generic function)
A list of the suites this test belong.
:suite-list
suite-list (generic function)
(setf suite-list) (generic function)
the clunit-test-report instance is used to store the report information for each executed test case.
assertion-conditions (generic function)
(setf assertion-conditions) (generic function)
Previous: Exported definitions, Up: Definitions [Contents][Index]
• Internal special variables | ||
• Internal macros | ||
• Internal functions | ||
• Internal generic functions | ||
• Internal conditions | ||
• Internal classes |
Next: Internal macros, Previous: Internal definitions, Up: Internal definitions [Contents][Index]
Holds a CLUNIT-REPORT object during a test run, used to store aggregated test reports.
specials.lisp (file)
Holds a CLUNIT-TEST-REPORT object for each executing test case.
specials.lisp (file)
Holds the last returned CLUNIT-REPORT object. Default optional argument to the function RERUN-FAILED-TESTS.
specials.lisp (file)
A list of queued CLUNIT-TEST-REPORT objects whose test case execution has been deferred until their dependencies requirements are met.
specials.lisp (file)
This variable switches on progress reporting if set to true.
specials.lisp (file)
If any assertion fails or an error condition occurs, stop the unit test.
specials.lisp (file)
Holds a list of suite symbol names in their current calling order. First called suite at the front, currently executing suite at the back.
specials.lisp (file)
Number of tab columns to use for indentation (in the reporting functions).
specials.lisp (file)
Counter used in these printing functions
report-format-tap.lisp (file)
Holds CLUNIT-TEST-CASE instances. The key of each test case object is the symbol name.
specials.lisp (file)
Holds the name of the test currently executing.
specials.lisp (file)
Holds CLUNIT-TEST-SUITE instances. The key of each test suite object is the symbol name.
specials.lisp (file)
If set to true, the debugger is invoked whenever an assertion fails.
specials.lisp (file)
Next: Internal functions, Previous: Internal special variables, Up: Internal definitions [Contents][Index]
WITH-ASSERT-RESTART places a restart called SKIP-ASSERTION around an assertion form.
utility-macros.lisp (file)
WITH-GENSYMS takes a list of symbols SYM and a list of body forms. It returns a LET clause with each symbol in SYM bound to a gensymbol and the body forms as the body of the let clause.
utility-macros.lisp (file)
Set some common special variables to meaningful values to prepare for running tests or suite
prepare-specials.lisp (file)
utility-macros.lisp (file)
Next: Internal generic functions, Previous: Internal macros, Up: Internal definitions [Contents][Index]
Expands an assertion macro call.
assertion-macros.lisp (file)
Deletes the TEST-CASE instance associated with the key NAME in the hash table *TEST-CASES*
test-case-functions.lisp (file)
Deletes the TEST-SUITE instance associated with the key NAME in the hash table *TEST-SUITES*
test-suite-functions.lisp (file)
test-case-functions.lisp (file)
test-suite-functions.lisp (file)
FORM-EXPANDER manipulates the list of forms provided to an
assertion form, e.g. (defmacro assert-false (expression &rest
forms) . body)
The members of the forms list are printed out when an assertion
test fails. The example below, shows the debug output when an
assertion form fails.
(let ((x 1) (y 2) (z 3))
;;forms = ’(x y "Comment: This is meant to fail." z)
(assert-true (= x y z) x y "Comment: This is meant to fail." z))
======== Debug output ===========
Expression: (= x y z)
Expected: T
Returned: NIL
x => 1
y => 2
Comment: This is meant to fail.
z => 3
==================================
As you can see, the reporting is somehow able to
differentiate between the symbols x, y, z and the string
comment.
This is achieved by expanding ’(x y "Comment..." z) => (T ’x
x T ’y y NIL "Comment..." T ’z z)
The T or NIL symbol tells the reporting function whether to
report the next two values as a pair or not.
I went at great lengths to explain this because WHAT the
function does is straight forward from the code, but WHY it
does it
isn’t too obvious unless someone tells you :o)
assertion-macros.lisp (file)
Retrieves the TEST-CASE instance associated with the key NAME in the hash table *TEST-CASES*
test-case-functions.lisp (file)
(setf get-test-case) (function)
Adds NEW-TEST-CASE in the hash table *TEST-CASES* under the key NAME.
test-case-functions.lisp (file)
get-test-case (function)
Retrieves the TEST-SUITE instance associated with the key NAME in the hash table *TEST-SUITES*
test-suite-functions.lisp (file)
(setf get-test-suite) (function)
Adds NEW-TEST-SUITE in the hash table *TEST-SUITES* under the key NAME.
test-suite-functions.lisp (file)
get-test-suite (function)
Records the result of assertion tests and records any errors that occur.
assertion-functions.lisp (file)
assertion-functions.lisp (file)
test-case-functions.lisp (file)
Enqueue a test.
test-case-functions.lisp (file)
assertion-functions.lisp (file)
Skip a test.
test-case-functions.lisp (file)
Determines the execution action for TEST-CASE. If test case has no
dependencies or pending dependencies, then :RUN is returned.
If test case has another test case it depends on that failed or was
skipped, then :SKIP is returned.
If test case depends on test cases that have not yet run or are also queued, then :QUEUE is returned.
test-case-functions.lisp (file)
Next: Internal conditions, Previous: Internal functions, Up: Internal definitions [Contents][Index]
the clunit-test-report instance is used to store the report information for each executed test case.
clunit-test-report.lisp (file)
automatically generated reader method
clunit-test-suite.lisp (file)
automatically generated writer method
clunit-test-suite.lisp (file)
The DEPENDENCIES slot holds the names of the test cases that
this test case depends on. Using an indirect reference like this
allows us to easily undefine a test case without much cleaning up.
When we execute a test case and we resolve the references of the tests it depends on. If the object is not found it means the reference is now stale, so we remove the name from the list.
clunit-test-case.lisp (file)
The number of tests that signalled an error condition during test executions.
clunit-report.lisp (file)
Expands out a fixture body for the given test suite.
generic-functions.lisp (file)
The number of tests failed during test executions.
clunit-report.lisp (file)
automatically generated reader method
clunit-test-case.lisp (file)
automatically generated writer method
clunit-test-case.lisp (file)
The number of tests that passed during test executions.
clunit-report.lisp (file)
Outputs the OBJECT report to STREAM in the given FORMAT. FORMAT can be :default, :tap or NIL.
generic-functions.lisp (file)
report-format-tap.lisp (file)
report-format-tap.lisp (file)
report-format-tap.lisp (file)
report-format-tap.lisp (file)
report-format-tap.lisp (file)
report-format-default.lisp (file)
report-format-default.lisp (file)
report-format-default.lisp (file)
report-format-default.lisp (file)
report-format-default.lisp (file)
report-format-default.lisp (file)
The number of tests that was skipped during test executions.
clunit-report.lisp (file)
Non-nil if the test was skipped
clunit-test-report.lisp (file)
Non-nil if the test was skipped
clunit-test-report.lisp (file)
A list of the suites this test belong.
clunit-test-report.lisp (file)
The tests that belongs to this suite (list of symbols)
clunit-test-suite.lisp (file)
The actual test, a function with no arguments that returns non nil if the test passed
clunit-test-case.lisp (file)
Non-nil if the report passed
clunit-test-report.lisp (file)
Next: Internal classes, Previous: Internal generic functions, Up: Internal definitions [Contents][Index]
assertion-conditions.lisp (file)
condition (condition)
print-object (method)
assertion-conditions.lisp (file)
assertion-condition (condition)
this is a special case, if an unexpected condition
is signalled outside an assertion test, store the condition
description here.
:message
(quote "")
assertion-conditions.lisp (file)
assertion-condition (condition)
the format string argument passed to format.
:format-string
(quote "")
the format string arguments.
:args
(quote "")
assertion-conditions.lisp (file)
assertion-condition (condition)
the expression that was tested.
:expression
(quote nil)
holds a list of form-value pairs, see function expand-forms for more detail.
:forms
(quote nil)
the value the expression was expected to return.
:expected
(quote nil)
the result that was returned from evaluating the expression.
:returned
(quote nil)
assertion-conditions.lisp (file)
assertion-condition (condition)
test-suite-failure-condition (condition)
The number of tests with errors.
:test-errors
(quote nil)
The number of tests that failed.
:test-fails
(quote nil)
The total number of tests.
:total-tests
(quote nil)
condition (condition)
test-suite-failure (condition)
print-format (method)
Previous: Internal conditions, Up: Internal definitions [Contents][Index]
clunit-test-case.lisp (file)
named-class (class)
The DEPENDENCIES slot holds the names of the test cases that
this test case depends on. Using an indirect reference like this
allows us to easily undefine a test case without much cleaning up.
When we execute a test case and we resolve the references of the tests it depends on. If the object is not found it means the reference is now stale, so we remove the name from the list.
:dependencies
dependencies (generic function)
(setf dependencies) (generic function)
The actual test, a function with no arguments that returns non nil if the test passed
:test-function
test-function (generic function)
(setf test-function) (generic function)
The slots test-cases, child-suites and
parent-suites hold the symbol names of test cases and test suites
instead of the actual objects. using an indirect reference like this
allows us to undefine a test case or test suite.
When we execute a test suite and try to resolve the reference for an object. if the object is not found, it means the reference is now stale so the name of that test case or suite is removed.
clunit-test-suite.lisp (file)
named-class (class)
The tests that belongs to this suite (list of symbols)
:test-cases
test-cases (generic function)
(setf test-cases) (generic function)
:child-suites
child-suites (generic function)
(setf child-suites) (generic function)
A class for object with an identifier (the slot ’name’)
clunit-test-case.lisp (file)
standard-object (class)
:name
name (generic function)
(setf name) (generic function)
Previous: Definitions, Up: Top [Contents][Index]
• Concept index | ||
• Function index | ||
• Variable index | ||
• Data type index |
Next: Function index, Previous: Indexes, Up: Indexes [Contents][Index]
Jump to: | C F L M |
---|
Jump to: | C F L M |
---|
Next: Variable index, Previous: Concept index, Up: Indexes [Contents][Index]
Jump to: | (
A C D E F G H M N P Q R S T U W |
---|
Jump to: | (
A C D E F G H M N P Q R S T U W |
---|
Next: Data type index, Previous: Function index, Up: Indexes [Contents][Index]
Jump to: | *
A C D E F M N P R S T |
---|
Jump to: | *
A C D E F M N P R S T |
---|
Previous: Variable index, Up: Indexes [Contents][Index]
Jump to: | A C N P S T |
---|
Jump to: | A C N P S T |
---|