The unit-test Reference Manual

Table of Contents

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

The unit-test Reference Manual

This is the unit-test Reference Manual, generated automatically by Declt version 2.4 "Will Decker" on Wed Jun 20 12:43:56 2018 GMT+0.


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

1 Systems

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


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

1.1 unit-test

Description

unit-testing framework for common lisp

Source

unit-test.asd (file)

Component

unit-test.lisp (file)


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

2 Files

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


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

2.1 Lisp


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

2.1.1 unit-test.asd

Location

unit-test.asd

Systems

unit-test (system)

Packages

unit-test.system


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

2.1.2 unit-test/unit-test.lisp

Parent

unit-test (system)

Location

unit-test.lisp

Packages

unit-test

Exported Definitions
Internal Definitions

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

3 Packages

Packages are listed by definition order.


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

3.1 unit-test.system

Source

unit-test.asd

Use List

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

3.2 unit-test

Source

unit-test.lisp (file)

Use List

common-lisp

Exported Definitions
Internal Definitions

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

4 Definitions

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


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

4.1 Exported definitions


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

4.1.1 Special variables

Special Variable: *unit-test-debug*

(Setq *unit-test-debug* t) for debugging

Package

unit-test

Source

unit-test.lisp (file)


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

4.1.2 Macros

Macro: define-test-class CLASS-NAME &optional SLOTS

Define a new test class. SLOTS are specified as normal CLOS slots.

Package

unit-test

Source

unit-test.lisp (file)

Macro: deftest UNIT NAME &rest BODY

Create an instance of a unit test called NAME for UNIT.

Package

unit-test

Source

unit-test.lisp (file)

Macro: test-assert FORM &optional REASON
Package

unit-test

Source

unit-test.lisp (file)

Macro: test-condition FORM EXPECTED-CONDITION
Package

unit-test

Source

unit-test.lisp (file)

Macro: test-equal VALUE FORM &key TEST
Package

unit-test

Source

unit-test.lisp (file)


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

4.1.3 Functions

Function: get-test-by-name NAME
Package

unit-test

Source

unit-test.lisp (file)

Function: run-all-tests &key VERBOSE OUTPUT UNIT
Package

unit-test

Source

unit-test.lisp (file)


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

4.1.4 Generic functions

Generic Function: run-test TEST &optional OUTPUT
Package

unit-test

Source

unit-test.lisp (file)

Methods
Method: run-test (TEST unit-test) &optional OUTPUT

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

4.1.5 Classes

Class: test-condition-result ()
Package

unit-test

Source

unit-test.lisp (file)

Direct superclasses

test-result (class)

Direct methods
Direct slots
Slot: result
Initargs

:result

Readers

test-result-result (generic function)

Class: test-equal-result ()
Package

unit-test

Source

unit-test.lisp (file)

Direct superclasses

test-result (class)

Direct methods
Direct slots
Slot: value
Initargs

:value

Readers

test-result-value (generic function)

Slot: real-value
Initargs

:real-value

Readers

test-result-real-value (generic function)

Class: test-error-result ()
Package

unit-test

Source

unit-test.lisp (file)

Direct superclasses

test-result (class)

Direct methods
Direct slots
Slot: error
Initargs

:error

Readers

test-result-error (generic function)

Class: test-result ()
Package

unit-test

Source

unit-test.lisp (file)

Direct superclasses

standard-object (class)

Direct subclasses
Direct methods
Direct slots
Slot: form
Initargs

:form

Readers

test-result-form (generic function)

Slot: status

one of :pass, :fail, :crash

Initargs

:status

Readers

test-result-status (generic function)

Slot: reason
Initargs

:reason

Readers

test-result-reason (generic function)


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

4.2 Internal definitions


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

4.2.1 Special variables

Special Variable: *unit-test-results*

Collects the results of the running tests.

Package

unit-test

Source

unit-test.lisp (file)

Special Variable: *unit-tests*

This contains all unit tests. Tests are added simply by creating instances of test objects.

Package

unit-test

Source

unit-test.lisp (file)


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

4.2.2 Functions

Function: delete-all-tests ()

Throw away all tests from test suite.

Package

unit-test

Source

unit-test.lisp (file)

Function: delete-tests-for UNIT

Blow away all tests for UNIT from test set.

Package

unit-test

Source

unit-test.lisp (file)

Function: test-crashed-p TEST
Package

unit-test

Source

unit-test.lisp (file)

Function: test-failed-p TEST
Package

unit-test

Source

unit-test.lisp (file)

Function: test-fails &optional REASON

Used to signal that the test has failed. REASON may be a string or symbol which will be noted in the test report.

Package

unit-test

Source

unit-test.lisp (file)

Function: test-passed-p TEST
Package

unit-test

Source

unit-test.lisp (file)

Function: test-passes ()

Used to signal that the test has passed.

Package

unit-test

Source

unit-test.lisp (file)


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

4.2.3 Generic functions

Generic Function: print-result RESULT STREAM
Package

unit-test

Source

unit-test.lisp (file)

Methods
Method: print-result (RESULT test-result) STREAM
Generic Function: print-result-form RESULT STREAM
Package

unit-test

Source

unit-test.lisp (file)

Methods
Method: print-result-form (RESULT test-condition-result) STREAM
Method: print-result-form (RESULT test-error-result) STREAM
Method: print-result-form (RESULT test-equal-result) STREAM
Method: print-result-form (RESULT test-assert-result) STREAM
Method: print-result-form (RESULT test-result) STREAM
Generic Function: print-result-status RESULT STATUS STREAM
Package

unit-test

Source

unit-test.lisp (file)

Methods
Method: print-result-status (RESULT test-equal-result) (STATUS (eql fail)) STREAM
Method: print-result-status (RESULT test-condition-result) (STATUS (eql fail)) STREAM
Method: print-result-status (RESULT test-error-result) (STATUS (eql crash)) STREAM
Method: print-result-status (RESULT test-result) (STATUS (eql crash)) STREAM
Method: print-result-status (RESULT test-result) (STATUS (eql pass)) STREAM
Method: print-result-status (RESULT test-result) (STATUS (eql fail)) STREAM
Generic Function: test-result-error OBJECT
Package

unit-test

Methods
Method: test-result-error (TEST-ERROR-RESULT test-error-result)

automatically generated reader method

Source

unit-test.lisp (file)

Generic Function: test-result-form OBJECT
Package

unit-test

Methods
Method: test-result-form (TEST-RESULT test-result)

automatically generated reader method

Source

unit-test.lisp (file)

Generic Function: test-result-real-value OBJECT
Package

unit-test

Methods
Method: test-result-real-value (TEST-EQUAL-RESULT test-equal-result)

automatically generated reader method

Source

unit-test.lisp (file)

Generic Function: test-result-reason OBJECT
Package

unit-test

Methods
Method: test-result-reason (TEST-RESULT test-result)

automatically generated reader method

Source

unit-test.lisp (file)

Generic Function: test-result-result OBJECT
Package

unit-test

Methods
Method: test-result-result (TEST-CONDITION-RESULT test-condition-result)

automatically generated reader method

Source

unit-test.lisp (file)

Generic Function: test-result-status OBJECT
Package

unit-test

Methods
Method: test-result-status (TEST-RESULT test-result)

one of :pass, :fail, :crash

Source

unit-test.lisp (file)

Generic Function: test-result-value OBJECT
Package

unit-test

Methods
Method: test-result-value (TEST-EQUAL-RESULT test-equal-result)

automatically generated reader method

Source

unit-test.lisp (file)

Generic Function: unit-test-body OBJECT
Package

unit-test

Methods
Method: unit-test-body (UNIT-TEST unit-test)

automatically generated reader method

Source

unit-test.lisp (file)

Generic Function: unit-test-failed-form OBJECT
Generic Function: (setf unit-test-failed-form) NEW-VALUE OBJECT
Package

unit-test

Methods
Method: unit-test-failed-form (UNIT-TEST unit-test)

automatically generated reader method

Source

unit-test.lisp (file)

Method: (setf unit-test-failed-form) NEW-VALUE (UNIT-TEST unit-test)

automatically generated writer method

Source

unit-test.lisp (file)

Generic Function: unit-test-name OBJECT
Package

unit-test

Methods
Method: unit-test-name (UNIT-TEST unit-test)

automatically generated reader method

Source

unit-test.lisp (file)

Generic Function: unit-test-unit OBJECT
Package

unit-test

Methods
Method: unit-test-unit (UNIT-TEST unit-test)

Name of unit being tested. Used to group related tests.

Source

unit-test.lisp (file)


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

4.2.4 Classes

Class: test-assert-result ()
Package

unit-test

Source

unit-test.lisp (file)

Direct superclasses

test-result (class)

Direct methods

print-result-form (method)

Class: unit-test ()

The base class for all unit tests. When tests are defined,
they will be stored in a global list of tests which can be run at any time with RUN-ALL-TESTS.

Package

unit-test

Source

unit-test.lisp (file)

Direct superclasses

standard-object (class)

Direct methods
Direct slots
Slot: unit

Name of unit being tested. Used to group related tests.

Initargs

:unit

Readers

unit-test-unit (generic function)

Slot: name
Initargs

:name

Initform

"unknown test"

Readers

unit-test-name (generic function)

Slot: body
Initargs

:body

Readers

unit-test-body (generic function)

Slot: failed-form
Initform

"unknown form"

Readers

unit-test-failed-form (generic function)

Writers

(setf unit-test-failed-form) (generic function)


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

Appendix A Indexes


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

A.1 Concepts

Jump to:   F   L   U  
Index Entry  Section

F
File, Lisp, unit-test.asd: The unit-test<dot>asd file
File, Lisp, unit-test/unit-test.lisp: The unit-test/unit-test<dot>lisp file

L
Lisp File, unit-test.asd: The unit-test<dot>asd file
Lisp File, unit-test/unit-test.lisp: The unit-test/unit-test<dot>lisp file

U
unit-test.asd: The unit-test<dot>asd file
unit-test/unit-test.lisp: The unit-test/unit-test<dot>lisp file

Jump to:   F   L   U  

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

A.2 Functions

Jump to:   (  
D   F   G   M   P   R   T   U  
Index Entry  Section

(
(setf unit-test-failed-form): Internal generic functions
(setf unit-test-failed-form): Internal generic functions

D
define-test-class: Exported macros
deftest: Exported macros
delete-all-tests: Internal functions
delete-tests-for: Internal functions

F
Function, delete-all-tests: Internal functions
Function, delete-tests-for: Internal functions
Function, get-test-by-name: Exported functions
Function, run-all-tests: Exported functions
Function, test-crashed-p: Internal functions
Function, test-failed-p: Internal functions
Function, test-fails: Internal functions
Function, test-passed-p: Internal functions
Function, test-passes: Internal functions

G
Generic Function, (setf unit-test-failed-form): Internal generic functions
Generic Function, print-result: Internal generic functions
Generic Function, print-result-form: Internal generic functions
Generic Function, print-result-status: Internal generic functions
Generic Function, run-test: Exported generic functions
Generic Function, test-result-error: Internal generic functions
Generic Function, test-result-form: Internal generic functions
Generic Function, test-result-real-value: Internal generic functions
Generic Function, test-result-reason: Internal generic functions
Generic Function, test-result-result: Internal generic functions
Generic Function, test-result-status: Internal generic functions
Generic Function, test-result-value: Internal generic functions
Generic Function, unit-test-body: Internal generic functions
Generic Function, unit-test-failed-form: Internal generic functions
Generic Function, unit-test-name: Internal generic functions
Generic Function, unit-test-unit: Internal generic functions
get-test-by-name: Exported functions

M
Macro, define-test-class: Exported macros
Macro, deftest: Exported macros
Macro, test-assert: Exported macros
Macro, test-condition: Exported macros
Macro, test-equal: Exported macros
Method, (setf unit-test-failed-form): Internal generic functions
Method, print-result: Internal generic functions
Method, print-result-form: Internal generic functions
Method, print-result-form: Internal generic functions
Method, print-result-form: Internal generic functions
Method, print-result-form: Internal generic functions
Method, print-result-form: Internal generic functions
Method, print-result-status: Internal generic functions
Method, print-result-status: Internal generic functions
Method, print-result-status: Internal generic functions
Method, print-result-status: Internal generic functions
Method, print-result-status: Internal generic functions
Method, print-result-status: Internal generic functions
Method, run-test: Exported generic functions
Method, test-result-error: Internal generic functions
Method, test-result-form: Internal generic functions
Method, test-result-real-value: Internal generic functions
Method, test-result-reason: Internal generic functions
Method, test-result-result: Internal generic functions
Method, test-result-status: Internal generic functions
Method, test-result-value: Internal generic functions
Method, unit-test-body: Internal generic functions
Method, unit-test-failed-form: Internal generic functions
Method, unit-test-name: Internal generic functions
Method, unit-test-unit: Internal generic functions

P
print-result: Internal generic functions
print-result: Internal generic functions
print-result-form: Internal generic functions
print-result-form: Internal generic functions
print-result-form: Internal generic functions
print-result-form: Internal generic functions
print-result-form: Internal generic functions
print-result-form: Internal generic functions
print-result-status: Internal generic functions
print-result-status: Internal generic functions
print-result-status: Internal generic functions
print-result-status: Internal generic functions
print-result-status: Internal generic functions
print-result-status: Internal generic functions
print-result-status: Internal generic functions

R
run-all-tests: Exported functions
run-test: Exported generic functions
run-test: Exported generic functions

T
test-assert: Exported macros
test-condition: Exported macros
test-crashed-p: Internal functions
test-equal: Exported macros
test-failed-p: Internal functions
test-fails: Internal functions
test-passed-p: Internal functions
test-passes: Internal functions
test-result-error: Internal generic functions
test-result-error: Internal generic functions
test-result-form: Internal generic functions
test-result-form: Internal generic functions
test-result-real-value: Internal generic functions
test-result-real-value: Internal generic functions
test-result-reason: Internal generic functions
test-result-reason: Internal generic functions
test-result-result: Internal generic functions
test-result-result: Internal generic functions
test-result-status: Internal generic functions
test-result-status: Internal generic functions
test-result-value: Internal generic functions
test-result-value: Internal generic functions

U
unit-test-body: Internal generic functions
unit-test-body: Internal generic functions
unit-test-failed-form: Internal generic functions
unit-test-failed-form: Internal generic functions
unit-test-name: Internal generic functions
unit-test-name: Internal generic functions
unit-test-unit: Internal generic functions
unit-test-unit: Internal generic functions

Jump to:   (  
D   F   G   M   P   R   T   U  

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

A.3 Variables

Jump to:   *  
B   E   F   N   R   S   U   V  
Index Entry  Section

*
*unit-test-debug*: Exported special variables
*unit-test-results*: Internal special variables
*unit-tests*: Internal special variables

B
body: Internal classes

E
error: Exported classes

F
failed-form: Internal classes
form: Exported classes

N
name: Internal classes

R
real-value: Exported classes
reason: Exported classes
result: Exported classes

S
Slot, body: Internal classes
Slot, error: Exported classes
Slot, failed-form: Internal classes
Slot, form: Exported classes
Slot, name: Internal classes
Slot, real-value: Exported classes
Slot, reason: Exported classes
Slot, result: Exported classes
Slot, status: Exported classes
Slot, unit: Internal classes
Slot, value: Exported classes
Special Variable, *unit-test-debug*: Exported special variables
Special Variable, *unit-test-results*: Internal special variables
Special Variable, *unit-tests*: Internal special variables
status: Exported classes

U
unit: Internal classes

V
value: Exported classes

Jump to:   *  
B   E   F   N   R   S   U   V  

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

A.4 Data types

Jump to:   C   P   S   T   U  
Index Entry  Section

C
Class, test-assert-result: Internal classes
Class, test-condition-result: Exported classes
Class, test-equal-result: Exported classes
Class, test-error-result: Exported classes
Class, test-result: Exported classes
Class, unit-test: Internal classes

P
Package, unit-test: The unit-test package
Package, unit-test.system: The unit-test<dot>system package

S
System, unit-test: The unit-test system

T
test-assert-result: Internal classes
test-condition-result: Exported classes
test-equal-result: Exported classes
test-error-result: Exported classes
test-result: Exported classes

U
unit-test: The unit-test system
unit-test: The unit-test package
unit-test: Internal classes
unit-test.system: The unit-test<dot>system package

Jump to:   C   P   S   T   U