The clunit Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The clunit Reference Manual

This is the clunit Reference Manual, version 0.2.3, generated automatically by Declt version 2.3 "Robert April" on Wed Mar 14 03:44:15 2018 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

New Project Steward Required!

This project needs a new maintainer or someone to continue taking it forward. I put a lot of effort and passion to deliver not just a functional but also a beautifully designed and written piece of code. Unfortunately other commitments have crept up over the years, thus I hope someone just as passionate can take over.

CLUnit

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

CLUnit provides a rich set of features aimed at improving your unit testing experience:

Check out the comprehensive CLUnit Tutorial.

Example

(ql:quickload "clunit")
(use-package :clunit)

;; Test suite for all number operation tests.
(defsuite NumberSuite ())
  
;; Test suite for floating point operations
(defsuite FloatSuite (NumberSuite))
  
(defsuite IntegerSuite (NumberSuite))
    
;; Define a test called TEST-INT1
(deftest test-int1 (IntegerSuite)
    (assert-true  (= 1 1))
    (assert-equalp 4 (+ 2 2)))

;; Define a test called TEST-FLOAT1
(deftest test-float1 (FloatSuite)
    (assert-true (= 1.0 -1.0))
    (assert-equalp 4.0 (+ 2.0 2.0)))

(print (run-suite 'NumberSuite))

which produces the output:

PROGRESS:
=========

    NUMBERSUITE: (Test Suite)

        INTEGERSUITE: (Test Suite)
            TEST-INT1: ..

        FLOATSUITE: (Test Suite)
            TEST-FLOAT1: F.

FAILURE DETAILS:
================

    NUMBERSUITE -> FLOATSUITE: (Test Suite)
        TEST-FLOAT1: Expression: (= 1.0 -1.0)
                     Expected: T
                     Returned: NIL


SUMMARY:
========
    Test functions:
        Executed: 2
        Skipped:  0

    Tested 4 assertions.
        Passed: 3/4 ( 75.0%)
        Failed: 1/4 ( 25.0%) 

(if you are entering forms in the REPL, the print form is not usually needed).

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 | | ------------------------------------------ | ---------------------------------------------------------------- | | 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


(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)

produces the output:

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.
        Passed: 0/1 (  0.0%)
        Failed: 1/1 (100.0%)
        Errors: 0/1 (  0.0%)

(if not in a REPL, you may have to print the return value of run-test).


Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 clunit

Author

Tapiwa Gutu <tgutu@ml.sun.ac.za>

License

BSD

Description

CLUnit is a Common Lisp unit testing framework.

Long Description

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.

Version

0.2.3

Source

clunit.asd (file)

Component

src (module)


Next: , Previous: , Up: Top   [Contents][Index]

3 Modules

Modules are listed depth-first from the system components tree.


Next: , Previous: , Up: Modules   [Contents][Index]

3.1 clunit/src

Parent

clunit (system)

Location

src/

Components

Next: , Previous: , Up: Modules   [Contents][Index]

3.2 clunit/src/classes

Dependency

specials.lisp (file)

Parent

src (module)

Location

src/classes/

Components

Next: , Previous: , Up: Modules   [Contents][Index]

3.3 clunit/src/functions

Dependency

classes (module)

Parent

src (module)

Location

src/functions/

Components

Next: , Previous: , Up: Modules   [Contents][Index]

3.4 clunit/src/report-formats

Dependency

functions (module)

Parent

src (module)

Location

src/report-formats/

Components

Previous: , Up: Modules   [Contents][Index]

3.5 clunit/src/macros

Dependency

report-formats (module)

Parent

src (module)

Location

src/macros/

Components

Next: , Previous: , Up: Top   [Contents][Index]

4 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

4.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.1 clunit.asd

Location

clunit.asd

Systems

clunit (system)


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.2 clunit/src/package.lisp

Parent

src (module)

Location

src/package.lisp

Packages

clunit


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.3 clunit/src/specials.lisp

Dependency

package.lisp (file)

Parent

src (module)

Location

src/specials.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.4 clunit/src/classes/assertion-conditions.lisp

Parent

classes (module)

Location

src/classes/assertion-conditions.lisp

Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.5 clunit/src/classes/clunit-report.lisp

Parent

classes (module)

Location

src/classes/clunit-report.lisp

Exported Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.6 clunit/src/classes/clunit-test-case.lisp

Parent

classes (module)

Location

src/classes/clunit-test-case.lisp

Internal Definitions

clunit-test-case (class)


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.7 clunit/src/classes/clunit-test-suite.lisp

Parent

classes (module)

Location

src/classes/clunit-test-suite.lisp

Internal Definitions

clunit-test-suite (class)


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.8 clunit/src/classes/clunit-test-report.lisp

Parent

classes (module)

Location

src/classes/clunit-test-report.lisp

Exported Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.9 clunit/src/functions/assertion-functions.lisp

Parent

functions (module)

Location

src/functions/assertion-functions.lisp

Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.10 clunit/src/functions/generic-functions.lisp

Parent

functions (module)

Location

src/functions/generic-functions.lisp

Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.11 clunit/src/functions/test-case-functions.lisp

Parent

functions (module)

Location

src/functions/test-case-functions.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.12 clunit/src/functions/test-suite-functions.lisp

Parent

functions (module)

Location

src/functions/test-suite-functions.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.13 clunit/src/functions/rerun-failed-tests.lisp

Parent

functions (module)

Location

src/functions/rerun-failed-tests.lisp

Exported Definitions

rerun-failed-tests (function)


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.14 clunit/src/functions/progress-report-functions.lisp

Parent

functions (module)

Location

src/functions/progress-report-functions.lisp

Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.15 clunit/src/report-formats/report-format-default.lisp

Parent

report-formats (module)

Location

src/report-formats/report-format-default.lisp

Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.16 clunit/src/report-formats/report-format-tap.lisp

Parent

report-formats (module)

Location

src/report-formats/report-format-tap.lisp

Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.17 clunit/src/report-formats/print-object.lisp

Parent

report-formats (module)

Location

src/report-formats/print-object.lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.18 clunit/src/macros/utility-macros.lisp

Parent

macros (module)

Location

src/macros/utility-macros.lisp

Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.19 clunit/src/macros/assertion-macros.lisp

Dependency

utility-macros.lisp (file)

Parent

macros (module)

Location

src/macros/assertion-macros.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.20 clunit/src/macros/deffixture.lisp

Dependency

assertion-macros.lisp (file)

Parent

macros (module)

Location

src/macros/deffixture.lisp

Exported Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.21 clunit/src/macros/defsuite.lisp

Dependency

deffixture.lisp (file)

Parent

macros (module)

Location

src/macros/defsuite.lisp

Exported Definitions

Previous: , Up: Lisp files   [Contents][Index]

4.1.22 clunit/src/macros/deftest.lisp

Dependency

defsuite.lisp (file)

Parent

macros (module)

Location

src/macros/deftest.lisp

Exported Definitions

Next: , Previous: , Up: Top   [Contents][Index]

5 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

5.1 clunit

Source

package.lisp (file)

Use List

common-lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

6 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

6.1 Exported definitions


Next: , Previous: , Up: Exported definitions   [Contents][Index]

6.1.1 Special variables

Special Variable: *clunit-equality-test*

The equality test used to compare values by the ASSERT-EQUALITY macro.

Package

clunit

Source

specials.lisp (file)

Special Variable: *clunit-report-format*

Controls the output format of the unit test results. Possible values are :default, :tap or NIL.

Package

clunit

Source

specials.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

6.1.2 Macros

Macro: assert-condition CONDITION EXPRESSION &body FORMS

Evaluates EXPRESSION as an assertion, an assertion passes if EXPRESSION signals CONDITION. FORMS and their values are printed if the test fails.

Package

clunit

Source

assertion-macros.lisp (file)

Macro: assert-eq VALUE EXPRESSION &body FORMS

Evaluates EXPRESSION as an assertion, an assertion passes if (EQ VALUE EXPRESSION) returns true. FORMS and their values are printed if the test fails.

Package

clunit

Source

assertion-macros.lisp (file)

Macro: assert-eql VALUE EXPRESSION &body FORMS

Evaluates EXPRESSION as an assertion, an assertion passes if (EQL VALUE EXPRESSION) returns true. FORMS and their values are printed if the test fails.

Package

clunit

Source

assertion-macros.lisp (file)

Macro: assert-equal VALUE EXPRESSION &body FORMS

Evaluates EXPRESSION as an assertion, an assertion passes if (EQUAL VALUE EXPRESSION) returns true. FORMS and their values are printed if the test fails.

Package

clunit

Source

assertion-macros.lisp (file)

Macro: assert-equality TEST VALUE EXPRESSION &body FORMS

Evaluates EXPRESSION as an assertion, an assertion passes if (FUNCALL TEST VALUE EXPRESSION) returns true. FORMS and their values are printed if the test fails.

Package

clunit

Source

assertion-macros.lisp (file)

Macro: assert-equality* VALUE EXPRESSION &body FORMS

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.

Package

clunit

Source

assertion-macros.lisp (file)

Macro: assert-equalp VALUE EXPRESSION &body FORMS

Evaluates EXPRESSION as an assertion, an assertion passes if (EQUALP VALUE EXPRESSION) returns true. FORMS and their values are printed if the test fails.

Package

clunit

Source

assertion-macros.lisp (file)

Macro: assert-expands EXPANSION EXPRESSION &body FORMS

Evaluates EXPRESSION as an assertion, an assertion passes if (EQUALP EXPANSION (MACROEXPAND-1 EXPRESSION)) returns true. FORMS and their values are printed if the test fails.

Package

clunit

Source

assertion-macros.lisp (file)

Macro: assert-false EXPRESSION &body FORMS

Evaluates EXPRESSION as an assertion, an assertion passes if it returns false. FORMS and their values are printed if the test fails.

Package

clunit

Source

assertion-macros.lisp (file)

Macro: assert-true EXPRESSION &body FORMS

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.

Package

clunit

Source

assertion-macros.lisp (file)

Macro: deffixture SUITE (PLUG) &body BODY

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.

Package

clunit

Source

deffixture.lisp (file)

Macro: defsuite NAME PARENTS

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.

Package

clunit

Source

defsuite.lisp (file)

Macro: deftest NAME DECLARATIONS &body BODY

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.

Package

clunit

Source

deftest.lisp (file)

Macro: undeffixture NAME

Remove a fixture definition.

Package

clunit

Source

deffixture.lisp (file)

Macro: undefsuite NAME
Package

clunit

Source

defsuite.lisp (file)

Macro: undeftest NAME
Package

clunit

Source

deftest.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

6.1.3 Functions

Function: assert-fail FORMAT-STRING &rest ARGS
Package

clunit

Source

assertion-macros.lisp (file)

Function: defined-suite-p SUITE-NAME

Returns T if a test suite called SUITE-NAME is defined, otherwise returns NIL.

Package

clunit

Source

test-suite-functions.lisp (file)

Function: defined-test-p TEST-NAME

Returns T if a test case called TEST-NAME is defined, otherwise returns NIL.

Package

clunit

Source

test-case-functions.lisp (file)

Function: get-child-suites SUITE-NAME

Returns a list of all test suite names that are children of the suite called SUITE-NAME.

Package

clunit

Source

test-suite-functions.lisp (file)

Function: get-child-tests SUITE-NAME

Returns a list of all test case names that are children of the suite called SUITE-NAME.

Package

clunit

Source

test-suite-functions.lisp (file)

Function: get-defined-suites ()

Returns a list of all defined test suite names.

Package

clunit

Source

test-suite-functions.lisp (file)

Function: get-defined-tests ()

Returns a list of all defined test case names.

Package

clunit

Source

test-case-functions.lisp (file)

Function: rerun-failed-tests &key USE-DEBUGGER REPORT-PROGRESS STOP-ON-FAIL LAST-REPORT

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.

Package

clunit

Source

rerun-failed-tests.lisp (file)

Function: run-suite SUITE &key USE-DEBUGGER REPORT-PROGRESS STOP-ON-FAIL

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.

Package

clunit

Source

test-suite-functions.lisp (file)

Function: run-test TEST &key USE-DEBUGGER REPORT-PROGRESS STOP-ON-FAIL

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.

Package

clunit

Source

test-case-functions.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

6.1.4 Generic functions

Generic Function: test-report-name OBJECT
Package

clunit

Methods
Method: test-report-name (CLUNIT-TEST-REPORT clunit-test-report)

automatically generated reader method

Source

clunit-test-report.lisp (file)

Generic Function: test-report-passed-p OBJECT
Package

clunit

Methods
Method: test-report-passed-p (CLUNIT-TEST-REPORT clunit-test-report)

automatically generated reader method

Source

clunit-test-report.lisp (file)

Generic Function: test-reports OBJECT
Package

clunit

Methods
Method: test-reports (CLUNIT-REPORT clunit-report)

automatically generated reader method

Source

clunit-report.lisp (file)


Previous: , Up: Exported definitions   [Contents][Index]

6.1.5 Classes

Class: clunit-report ()
Package

clunit

Source

clunit-report.lisp (file)

Direct superclasses

standard-object (class)

Direct methods
Direct slots
Slot: errors
Initargs

:errors

Initform

0

Slot: failed
Initargs

:failed

Initform

0

Slot: passed
Initargs

:passed

Initform

0

Slot: skipped
Initargs

:skipped

Initform

0

Slot: test-reports
Initform

(list)

Readers

test-reports (generic function)

Class: clunit-test-report ()
Package

clunit

Source

clunit-test-report.lisp (file)

Direct superclasses

standard-object (class)

Direct methods
Direct slots
Slot: test-name
Initargs

:test-name

Readers

test-report-name (generic function)

Slot: passed-p
Initargs

:passed-p

Initform

t

Readers

test-report-passed-p (generic function)

Slot: skipped-p
Initargs

:skipped-p

Slot: suite-list
Initargs

:suite-list

Initform

(list)

Slot: assertion-conditions
Initform

(list)


Previous: , Up: Definitions   [Contents][Index]

6.2 Internal definitions


Next: , Previous: , Up: Internal definitions   [Contents][Index]

6.2.1 Special variables

Special Variable: *clunit-report*

Holds a CLUNIT-REPORT object during a test run, used to store aggregated test reports.

Package

clunit

Source

specials.lisp (file)

Special Variable: *clunit-test-report*

Holds a CLUNIT-TEST-REPORT object for each executing test case.

Package

clunit

Source

specials.lisp (file)

Special Variable: *last-clunit-report*

Holds the last returned CLUNIT-REPORT object. Default optional argument to the function RERUN-FAILED-TESTS.

Package

clunit

Source

specials.lisp (file)

Special Variable: *queued-test-reports*

A list of queued CLUNIT-TEST-REPORT objects whose test case execution has been deferred until their dependencies requirements are met.

Package

clunit

Source

specials.lisp (file)

Special Variable: *report-progress*

This variable switches on progress reporting if set to true.

Package

clunit

Source

specials.lisp (file)

Special Variable: *stop-on-fail*

If any assertion fails or an error condition occurs, stop the unit test.

Package

clunit

Source

specials.lisp (file)

Special Variable: *suite-name*

Holds a list of suite symbol names in their current calling order. First called suite at the front, currently executing suite at the back.

Package

clunit

Source

specials.lisp (file)

Special Variable: *tab-width*

Number of tab columns to use for indentation (in the reporting functions).

Package

clunit

Source

specials.lisp (file)

Special Variable: *tap-test-num*

Counter used in these printing functions

Package

clunit

Source

report-format-tap.lisp (file)

Special Variable: *test-case-hashtable*

Holds CLUNIT-TEST-CASE instances. The key of each test case object is the symbol name.

Package

clunit

Source

specials.lisp (file)

Special Variable: *test-name*

Holds the name of the test currently executing.

Package

clunit

Source

specials.lisp (file)

Special Variable: *test-suite-hashtable*

Holds CLUNIT-TEST-SUITE instances. The key of each test suite object is the symbol name.

Package

clunit

Source

specials.lisp (file)

Special Variable: *use-debugger*

If set to true, the debugger is invoked whenever an assertion fails.

Package

clunit

Source

specials.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

6.2.2 Macros

Macro: with-assert-restart &body BODY

WITH-ASSERT-RESTART places a restart called SKIP-ASSERTION around an assertion form.

Package

clunit

Source

utility-macros.lisp (file)

Macro: with-gensyms SYMS &body BODY

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.

Package

clunit

Source

utility-macros.lisp (file)

Macro: with-test-restart &body BODY
Package

clunit

Source

utility-macros.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

6.2.3 Functions

Function: assertion-expander &key RESULT TEST RESULT-EXPRESSION REPORT-EXPRESSION EXPECTED FORMS

Expands an assertion macro call.

Package

clunit

Source

assertion-macros.lisp (file)

Function: delete-test-case NAME

Deletes the TEST-CASE instance associated with the key NAME in the hash table *TEST-CASES*

Package

clunit

Source

test-case-functions.lisp (file)

Function: delete-test-suite NAME

Deletes the TEST-SUITE instance associated with the key NAME in the hash table *TEST-SUITES*

Package

clunit

Source

test-suite-functions.lisp (file)

Function: execute-test-case TEST-CASE
Package

clunit

Source

test-case-functions.lisp (file)

Function: execute-test-suite TEST-SUITE
Package

clunit

Source

test-suite-functions.lisp (file)

Function: form-expander FORMS
Package

clunit

Source

assertion-macros.lisp (file)

Function: get-test-case NAME

Retrieves the TEST-CASE instance associated with the key NAME in the hash table *TEST-CASES*

Package

clunit

Source

test-case-functions.lisp (file)

Writer

(setf get-test-case) (function)

Function: (setf get-test-case) NEW-TEST-CASE NAME

Adds NEW-TEST-CASE in the hash table *TEST-CASES* under the key NAME.

Package

clunit

Source

test-case-functions.lisp (file)

Reader

get-test-case (function)

Function: get-test-suite NAME

Retrieves the TEST-SUITE instance associated with the key NAME in the hash table *TEST-SUITES*

Package

clunit

Source

test-suite-functions.lisp (file)

Writer

(setf get-test-suite) (function)

Function: (setf get-test-suite) NEW-TEST-SUITE NAME

Adds NEW-TEST-SUITE in the hash table *TEST-SUITES* under the key NAME.

Package

clunit

Source

test-suite-functions.lisp (file)

Reader

get-test-suite (function)

Function: handle-assertion CONDITION

Records the result of assertion tests and records any errors that occur.

Package

clunit

Source

assertion-functions.lisp (file)

Function: handle-error ERROR
Package

clunit

Source

assertion-functions.lisp (file)

Function: process-queued-tests ()
Package

clunit

Source

test-case-functions.lisp (file)

Function: queue-test-case ()
Package

clunit

Source

test-case-functions.lisp (file)

Function: report-assertion-progress TYPE
Package

clunit

Source

progress-report-functions.lisp (file)

Function: report-suite-progress SUITE SUITE-LIST
Package

clunit

Source

progress-report-functions.lisp (file)

Function: report-test-progress TEST-NAME SUITE-LIST
Package

clunit

Source

progress-report-functions.lisp (file)

Function: signal-assertion TYPE &key EXPRESSION EXPECTED RETURNED FORMS MESSAGE FORMAT-STRING ARGS
Package

clunit

Source

assertion-functions.lisp (file)

Function: skip-test-case ()
Package

clunit

Source

test-case-functions.lisp (file)

Function: test-case-execution-action TEST-CASE

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.

Package

clunit

Source

test-case-functions.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

6.2.4 Generic functions

Generic Function: expand-fixture SUITE BODY

Expands out a fixture body for the given test suite.

Package

clunit

Source

generic-functions.lisp (file)

Methods
Method: expand-fixture SUITE BODY
Generic Function: print-format OBJECT FORMAT STREAM

Outputs the OBJECT report to STREAM in the given FORMAT. FORMAT can be :default, :tap or NIL.

Package

clunit

Source

generic-functions.lisp (file)

Methods
Method: print-format (CONDITION assertion-fail-forced) (FORMAT (eql tap)) STREAM
Source

report-format-tap.lisp (file)

Method: print-format (CONDITION assertion-failed) (FORMAT (eql tap)) STREAM
Source

report-format-tap.lisp (file)

Method: print-format (CONDITION assertion-error) (FORMAT (eql tap)) STREAM
Source

report-format-tap.lisp (file)

Method: print-format (REPORT clunit-test-report) (FORMAT (eql tap)) STREAM
Source

report-format-tap.lisp (file)

Method: print-format (CLUNIT-REPORT clunit-report) (FORMAT (eql tap)) STREAM
Source

report-format-tap.lisp (file)

Method: print-format (CONDITION assertion-fail-forced) (FORMAT (eql default)) STREAM
Source

report-format-default.lisp (file)

Method: print-format (CONDITION assertion-failed) (FORMAT (eql default)) STREAM
Source

report-format-default.lisp (file)

Method: print-format (CONDITION assertion-error) (FORMAT (eql default)) STREAM
Source

report-format-default.lisp (file)

Method: print-format (REPORT clunit-test-report) (FORMAT (eql default)) STREAM
Source

report-format-default.lisp (file)

Method: print-format (CLUNIT-REPORT clunit-report) (FORMAT (eql default)) STREAM
Source

report-format-default.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

6.2.5 Conditions

Condition: assertion-condition ()
Package

clunit

Source

assertion-conditions.lisp (file)

Direct superclasses

condition (condition)

Direct subclasses
Direct methods

print-object (method)

Condition: assertion-error ()
Package

clunit

Source

assertion-conditions.lisp (file)

Direct superclasses

assertion-condition (condition)

Direct methods
Direct slots
Slot: message

This is a special case, if an unexpected condition is signalled outside an assertion test, store the condition description here.

Initargs

:message

Initform

(quote "")

Condition: assertion-fail-forced ()
Package

clunit

Source

assertion-conditions.lisp (file)

Direct superclasses

assertion-condition (condition)

Direct methods
Direct slots
Slot: format-string

The format string argument passed to FORMAT.

Initargs

:format-string

Initform

(quote "")

Slot: args

The format string arguments.

Initargs

:args

Initform

(quote "")

Condition: assertion-failed ()
Package

clunit

Source

assertion-conditions.lisp (file)

Direct superclasses

assertion-condition (condition)

Direct methods
Direct slots
Slot: expression

The expression that was tested.

Initargs

:expression

Initform

(quote nil)

Slot: forms

Holds a list of FORM-VALUE pairs, see function EXPAND-FORMS for more detail.

Initargs

:forms

Initform

(quote nil)

Slot: expected

The value the expression was expected to return.

Initargs

:expected

Initform

(quote nil)

Slot: returned

The result that was returned from evaluating the expression.

Initargs

:returned

Initform

(quote nil)

Condition: assertion-passed ()
Package

clunit

Source

assertion-conditions.lisp (file)

Direct superclasses

assertion-condition (condition)


Previous: , Up: Internal definitions   [Contents][Index]

6.2.6 Classes

Class: clunit-test-case ()
Package

clunit

Source

clunit-test-case.lisp (file)

Direct superclasses

standard-object (class)

Direct slots
Slot: name
Initargs

:name

Slot: dependencies
Initargs

:dependencies

Initform

(list)

Slot: test-function
Initargs

:test-function

Class: clunit-test-suite ()
Package

clunit

Source

clunit-test-suite.lisp (file)

Direct superclasses

standard-object (class)

Direct slots
Slot: name
Initargs

:name

Slot: test-cases
Initargs

:test-cases

Initform

(list)

Slot: child-suites
Initargs

:child-suites

Initform

(list)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   C   F   L   M  
Index Entry  Section

C
clunit.asd: The clunit<dot>asd file
clunit/src: The clunit/src module
clunit/src/classes: The clunit/src/classes module
clunit/src/classes/assertion-conditions.lisp: The clunit/src/classes/assertion-conditions<dot>lisp file
clunit/src/classes/clunit-report.lisp: The clunit/src/classes/clunit-report<dot>lisp file
clunit/src/classes/clunit-test-case.lisp: The clunit/src/classes/clunit-test-case<dot>lisp file
clunit/src/classes/clunit-test-report.lisp: The clunit/src/classes/clunit-test-report<dot>lisp file
clunit/src/classes/clunit-test-suite.lisp: The clunit/src/classes/clunit-test-suite<dot>lisp file
clunit/src/functions: The clunit/src/functions module
clunit/src/functions/assertion-functions.lisp: The clunit/src/functions/assertion-functions<dot>lisp file
clunit/src/functions/generic-functions.lisp: The clunit/src/functions/generic-functions<dot>lisp file
clunit/src/functions/progress-report-functions.lisp: The clunit/src/functions/progress-report-functions<dot>lisp file
clunit/src/functions/rerun-failed-tests.lisp: The clunit/src/functions/rerun-failed-tests<dot>lisp file
clunit/src/functions/test-case-functions.lisp: The clunit/src/functions/test-case-functions<dot>lisp file
clunit/src/functions/test-suite-functions.lisp: The clunit/src/functions/test-suite-functions<dot>lisp file
clunit/src/macros: The clunit/src/macros module
clunit/src/macros/assertion-macros.lisp: The clunit/src/macros/assertion-macros<dot>lisp file
clunit/src/macros/deffixture.lisp: The clunit/src/macros/deffixture<dot>lisp file
clunit/src/macros/defsuite.lisp: The clunit/src/macros/defsuite<dot>lisp file
clunit/src/macros/deftest.lisp: The clunit/src/macros/deftest<dot>lisp file
clunit/src/macros/utility-macros.lisp: The clunit/src/macros/utility-macros<dot>lisp file
clunit/src/package.lisp: The clunit/src/package<dot>lisp file
clunit/src/report-formats: The clunit/src/report-formats module
clunit/src/report-formats/print-object.lisp: The clunit/src/report-formats/print-object<dot>lisp file
clunit/src/report-formats/report-format-default.lisp: The clunit/src/report-formats/report-format-default<dot>lisp file
clunit/src/report-formats/report-format-tap.lisp: The clunit/src/report-formats/report-format-tap<dot>lisp file
clunit/src/specials.lisp: The clunit/src/specials<dot>lisp file

F
File, Lisp, clunit.asd: The clunit<dot>asd file
File, Lisp, clunit/src/classes/assertion-conditions.lisp: The clunit/src/classes/assertion-conditions<dot>lisp file
File, Lisp, clunit/src/classes/clunit-report.lisp: The clunit/src/classes/clunit-report<dot>lisp file
File, Lisp, clunit/src/classes/clunit-test-case.lisp: The clunit/src/classes/clunit-test-case<dot>lisp file
File, Lisp, clunit/src/classes/clunit-test-report.lisp: The clunit/src/classes/clunit-test-report<dot>lisp file
File, Lisp, clunit/src/classes/clunit-test-suite.lisp: The clunit/src/classes/clunit-test-suite<dot>lisp file
File, Lisp, clunit/src/functions/assertion-functions.lisp: The clunit/src/functions/assertion-functions<dot>lisp file
File, Lisp, clunit/src/functions/generic-functions.lisp: The clunit/src/functions/generic-functions<dot>lisp file
File, Lisp, clunit/src/functions/progress-report-functions.lisp: The clunit/src/functions/progress-report-functions<dot>lisp file
File, Lisp, clunit/src/functions/rerun-failed-tests.lisp: The clunit/src/functions/rerun-failed-tests<dot>lisp file
File, Lisp, clunit/src/functions/test-case-functions.lisp: The clunit/src/functions/test-case-functions<dot>lisp file
File, Lisp, clunit/src/functions/test-suite-functions.lisp: The clunit/src/functions/test-suite-functions<dot>lisp file
File, Lisp, clunit/src/macros/assertion-macros.lisp: The clunit/src/macros/assertion-macros<dot>lisp file
File, Lisp, clunit/src/macros/deffixture.lisp: The clunit/src/macros/deffixture<dot>lisp file
File, Lisp, clunit/src/macros/defsuite.lisp: The clunit/src/macros/defsuite<dot>lisp file
File, Lisp, clunit/src/macros/deftest.lisp: The clunit/src/macros/deftest<dot>lisp file
File, Lisp, clunit/src/macros/utility-macros.lisp: The clunit/src/macros/utility-macros<dot>lisp file
File, Lisp, clunit/src/package.lisp: The clunit/src/package<dot>lisp file
File, Lisp, clunit/src/report-formats/print-object.lisp: The clunit/src/report-formats/print-object<dot>lisp file
File, Lisp, clunit/src/report-formats/report-format-default.lisp: The clunit/src/report-formats/report-format-default<dot>lisp file
File, Lisp, clunit/src/report-formats/report-format-tap.lisp: The clunit/src/report-formats/report-format-tap<dot>lisp file
File, Lisp, clunit/src/specials.lisp: The clunit/src/specials<dot>lisp file

L
Lisp File, clunit.asd: The clunit<dot>asd file
Lisp File, clunit/src/classes/assertion-conditions.lisp: The clunit/src/classes/assertion-conditions<dot>lisp file
Lisp File, clunit/src/classes/clunit-report.lisp: The clunit/src/classes/clunit-report<dot>lisp file
Lisp File, clunit/src/classes/clunit-test-case.lisp: The clunit/src/classes/clunit-test-case<dot>lisp file
Lisp File, clunit/src/classes/clunit-test-report.lisp: The clunit/src/classes/clunit-test-report<dot>lisp file
Lisp File, clunit/src/classes/clunit-test-suite.lisp: The clunit/src/classes/clunit-test-suite<dot>lisp file
Lisp File, clunit/src/functions/assertion-functions.lisp: The clunit/src/functions/assertion-functions<dot>lisp file
Lisp File, clunit/src/functions/generic-functions.lisp: The clunit/src/functions/generic-functions<dot>lisp file
Lisp File, clunit/src/functions/progress-report-functions.lisp: The clunit/src/functions/progress-report-functions<dot>lisp file
Lisp File, clunit/src/functions/rerun-failed-tests.lisp: The clunit/src/functions/rerun-failed-tests<dot>lisp file
Lisp File, clunit/src/functions/test-case-functions.lisp: The clunit/src/functions/test-case-functions<dot>lisp file
Lisp File, clunit/src/functions/test-suite-functions.lisp: The clunit/src/functions/test-suite-functions<dot>lisp file
Lisp File, clunit/src/macros/assertion-macros.lisp: The clunit/src/macros/assertion-macros<dot>lisp file
Lisp File, clunit/src/macros/deffixture.lisp: The clunit/src/macros/deffixture<dot>lisp file
Lisp File, clunit/src/macros/defsuite.lisp: The clunit/src/macros/defsuite<dot>lisp file
Lisp File, clunit/src/macros/deftest.lisp: The clunit/src/macros/deftest<dot>lisp file
Lisp File, clunit/src/macros/utility-macros.lisp: The clunit/src/macros/utility-macros<dot>lisp file
Lisp File, clunit/src/package.lisp: The clunit/src/package<dot>lisp file
Lisp File, clunit/src/report-formats/print-object.lisp: The clunit/src/report-formats/print-object<dot>lisp file
Lisp File, clunit/src/report-formats/report-format-default.lisp: The clunit/src/report-formats/report-format-default<dot>lisp file
Lisp File, clunit/src/report-formats/report-format-tap.lisp: The clunit/src/report-formats/report-format-tap<dot>lisp file
Lisp File, clunit/src/specials.lisp: The clunit/src/specials<dot>lisp file

M
Module, clunit/src: The clunit/src module
Module, clunit/src/classes: The clunit/src/classes module
Module, clunit/src/functions: The clunit/src/functions module
Module, clunit/src/macros: The clunit/src/macros module
Module, clunit/src/report-formats: The clunit/src/report-formats module

Jump to:   C   F   L   M  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   (  
A   D   E   F   G   H   M   P   Q   R   S   T   U   W  
Index Entry  Section

(
(setf get-test-case): Internal functions
(setf get-test-suite): Internal functions

A
assert-condition: Exported macros
assert-eq: Exported macros
assert-eql: Exported macros
assert-equal: Exported macros
assert-equality: Exported macros
assert-equality*: Exported macros
assert-equalp: Exported macros
assert-expands: Exported macros
assert-fail: Exported functions
assert-false: Exported macros
assert-true: Exported macros
assertion-expander: Internal functions

D
deffixture: Exported macros
defined-suite-p: Exported functions
defined-test-p: Exported functions
defsuite: Exported macros
deftest: Exported macros
delete-test-case: Internal functions
delete-test-suite: Internal functions

E
execute-test-case: Internal functions
execute-test-suite: Internal functions
expand-fixture: Internal generic functions
expand-fixture: Internal generic functions

F
form-expander: Internal functions
Function, (setf get-test-case): Internal functions
Function, (setf get-test-suite): Internal functions
Function, assert-fail: Exported functions
Function, assertion-expander: Internal functions
Function, defined-suite-p: Exported functions
Function, defined-test-p: Exported functions
Function, delete-test-case: Internal functions
Function, delete-test-suite: Internal functions
Function, execute-test-case: Internal functions
Function, execute-test-suite: Internal functions
Function, form-expander: Internal functions
Function, get-child-suites: Exported functions
Function, get-child-tests: Exported functions
Function, get-defined-suites: Exported functions
Function, get-defined-tests: Exported functions
Function, get-test-case: Internal functions
Function, get-test-suite: Internal functions
Function, handle-assertion: Internal functions
Function, handle-error: Internal functions
Function, process-queued-tests: Internal functions
Function, queue-test-case: Internal functions
Function, report-assertion-progress: Internal functions
Function, report-suite-progress: Internal functions
Function, report-test-progress: Internal functions
Function, rerun-failed-tests: Exported functions
Function, run-suite: Exported functions
Function, run-test: Exported functions
Function, signal-assertion: Internal functions
Function, skip-test-case: Internal functions
Function, test-case-execution-action: Internal functions

G
Generic Function, expand-fixture: Internal generic functions
Generic Function, print-format: Internal generic functions
Generic Function, test-report-name: Exported generic functions
Generic Function, test-report-passed-p: Exported generic functions
Generic Function, test-reports: Exported generic functions
get-child-suites: Exported functions
get-child-tests: Exported functions
get-defined-suites: Exported functions
get-defined-tests: Exported functions
get-test-case: Internal functions
get-test-suite: Internal functions

H
handle-assertion: Internal functions
handle-error: Internal functions

M
Macro, assert-condition: Exported macros
Macro, assert-eq: Exported macros
Macro, assert-eql: Exported macros
Macro, assert-equal: Exported macros
Macro, assert-equality: Exported macros
Macro, assert-equality*: Exported macros
Macro, assert-equalp: Exported macros
Macro, assert-expands: Exported macros
Macro, assert-false: Exported macros
Macro, assert-true: Exported macros
Macro, deffixture: Exported macros
Macro, defsuite: Exported macros
Macro, deftest: Exported macros
Macro, undeffixture: Exported macros
Macro, undefsuite: Exported macros
Macro, undeftest: Exported macros
Macro, with-assert-restart: Internal macros
Macro, with-gensyms: Internal macros
Macro, with-test-restart: Internal macros
Method, expand-fixture: Internal generic functions
Method, print-format: Internal generic functions
Method, print-format: Internal generic functions
Method, print-format: Internal generic functions
Method, print-format: Internal generic functions
Method, print-format: Internal generic functions
Method, print-format: Internal generic functions
Method, print-format: Internal generic functions
Method, print-format: Internal generic functions
Method, print-format: Internal generic functions
Method, print-format: Internal generic functions
Method, test-report-name: Exported generic functions
Method, test-report-passed-p: Exported generic functions
Method, test-reports: Exported generic functions

P
print-format: Internal generic functions
print-format: Internal generic functions
print-format: Internal generic functions
print-format: Internal generic functions
print-format: Internal generic functions
print-format: Internal generic functions
print-format: Internal generic functions
print-format: Internal generic functions
print-format: Internal generic functions
print-format: Internal generic functions
print-format: Internal generic functions
process-queued-tests: Internal functions

Q
queue-test-case: Internal functions

R
report-assertion-progress: Internal functions
report-suite-progress: Internal functions
report-test-progress: Internal functions
rerun-failed-tests: Exported functions
run-suite: Exported functions
run-test: Exported functions

S
signal-assertion: Internal functions
skip-test-case: Internal functions

T
test-case-execution-action: Internal functions
test-report-name: Exported generic functions
test-report-name: Exported generic functions
test-report-passed-p: Exported generic functions
test-report-passed-p: Exported generic functions
test-reports: Exported generic functions
test-reports: Exported generic functions

U
undeffixture: Exported macros
undefsuite: Exported macros
undeftest: Exported macros

W
with-assert-restart: Internal macros
with-gensyms: Internal macros
with-test-restart: Internal macros

Jump to:   (  
A   D   E   F   G   H   M   P   Q   R   S   T   U   W  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   *  
A   C   D   E   F   M   N   P   R   S   T  
Index Entry  Section

*
*clunit-equality-test*: Exported special variables
*clunit-report*: Internal special variables
*clunit-report-format*: Exported special variables
*clunit-test-report*: Internal special variables
*last-clunit-report*: Internal special variables
*queued-test-reports*: Internal special variables
*report-progress*: Internal special variables
*stop-on-fail*: Internal special variables
*suite-name*: Internal special variables
*tab-width*: Internal special variables
*tap-test-num*: Internal special variables
*test-case-hashtable*: Internal special variables
*test-name*: Internal special variables
*test-suite-hashtable*: Internal special variables
*use-debugger*: Internal special variables

A
args: Internal conditions
assertion-conditions: Exported classes

C
child-suites: Internal classes

D
dependencies: Internal classes

E
errors: Exported classes
expected: Internal conditions
expression: Internal conditions

F
failed: Exported classes
format-string: Internal conditions
forms: Internal conditions

M
message: Internal conditions

N
name: Internal classes
name: Internal classes

P
passed: Exported classes
passed-p: Exported classes

R
returned: Internal conditions

S
skipped: Exported classes
skipped-p: Exported classes
Slot, args: Internal conditions
Slot, assertion-conditions: Exported classes
Slot, child-suites: Internal classes
Slot, dependencies: Internal classes
Slot, errors: Exported classes
Slot, expected: Internal conditions
Slot, expression: Internal conditions
Slot, failed: Exported classes
Slot, format-string: Internal conditions
Slot, forms: Internal conditions
Slot, message: Internal conditions
Slot, name: Internal classes
Slot, name: Internal classes
Slot, passed: Exported classes
Slot, passed-p: Exported classes
Slot, returned: Internal conditions
Slot, skipped: Exported classes
Slot, skipped-p: Exported classes
Slot, suite-list: Exported classes
Slot, test-cases: Internal classes
Slot, test-function: Internal classes
Slot, test-name: Exported classes
Slot, test-reports: Exported classes
Special Variable, *clunit-equality-test*: Exported special variables
Special Variable, *clunit-report*: Internal special variables
Special Variable, *clunit-report-format*: Exported special variables
Special Variable, *clunit-test-report*: Internal special variables
Special Variable, *last-clunit-report*: Internal special variables
Special Variable, *queued-test-reports*: Internal special variables
Special Variable, *report-progress*: Internal special variables
Special Variable, *stop-on-fail*: Internal special variables
Special Variable, *suite-name*: Internal special variables
Special Variable, *tab-width*: Internal special variables
Special Variable, *tap-test-num*: Internal special variables
Special Variable, *test-case-hashtable*: Internal special variables
Special Variable, *test-name*: Internal special variables
Special Variable, *test-suite-hashtable*: Internal special variables
Special Variable, *use-debugger*: Internal special variables
suite-list: Exported classes

T
test-cases: Internal classes
test-function: Internal classes
test-name: Exported classes
test-reports: Exported classes

Jump to:   *  
A   C   D   E   F   M   N   P   R   S   T  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   A   C   P   S  
Index Entry  Section

A
assertion-condition: Internal conditions
assertion-error: Internal conditions
assertion-fail-forced: Internal conditions
assertion-failed: Internal conditions
assertion-passed: Internal conditions

C
Class, clunit-report: Exported classes
Class, clunit-test-case: Internal classes
Class, clunit-test-report: Exported classes
Class, clunit-test-suite: Internal classes
clunit: The clunit system
clunit: The clunit package
clunit-report: Exported classes
clunit-test-case: Internal classes
clunit-test-report: Exported classes
clunit-test-suite: Internal classes
Condition, assertion-condition: Internal conditions
Condition, assertion-error: Internal conditions
Condition, assertion-fail-forced: Internal conditions
Condition, assertion-failed: Internal conditions
Condition, assertion-passed: Internal conditions

P
Package, clunit: The clunit package

S
System, clunit: The clunit system

Jump to:   A   C   P   S