Common Lisp Package: UNIT-TEST

README:

FUNCTION

Public

Undocumented

GET-TEST-BY-NAME (NAME)

RUN-ALL-TESTS (&KEY (VERBOSE NIL) (OUTPUT *STANDARD-OUTPUT*) (UNIT ALL))

Private

DELETE-ALL-TESTS

Throw away all tests from test suite.

DELETE-TESTS-FOR (UNIT)

Blow away all tests for UNIT from test set.

TEST-FAILS (&OPTIONAL (REASON 'NO-REASON-GIVEN))

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

TEST-PASSES

Used to signal that the test has passed.

Undocumented

TEST-CRASHED-P (TEST)

TEST-FAILED-P (TEST)

TEST-PASSED-P (TEST)

MACRO

Public

DEFINE-TEST-CLASS (CLASS-NAME &OPTIONAL SLOTS)

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

DEFTEST (UNIT NAME &REST BODY)

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

Undocumented

TEST-ASSERT (FORM &OPTIONAL (REASON NIL))

TEST-CONDITION (FORM EXPECTED-CONDITION)

TEST-EQUAL (VALUE FORM &KEY (TEST '#'EQUAL))

GENERIC-FUNCTION

Public

Undocumented

RUN-TEST (TEST &OPTIONAL OUTPUT)

Private

Undocumented

SLOT-ACCESSOR

Private

TEST-RESULT-STATUS (OBJECT)

one of :pass, :fail, :crash

UNIT-TEST-UNIT (OBJECT)

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

Undocumented

TEST-RESULT-ERROR (OBJECT)

TEST-RESULT-FORM (OBJECT)

TEST-RESULT-REAL-VALUE (OBJECT)

TEST-RESULT-REASON (OBJECT)

TEST-RESULT-RESULT (OBJECT)

TEST-RESULT-VALUE (OBJECT)

UNIT-TEST-BODY (OBJECT)

UNIT-TEST-FAILED-FORM (OBJECT)

SETFUNIT-TEST-FAILED-FORM (NEW-VALUE OBJECT)

UNIT-TEST-NAME (OBJECT)

VARIABLE

Public

*UNIT-TEST-DEBUG*

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

Private

*UNIT-TEST-RESULTS*

Collects the results of the running tests.

*UNIT-TESTS*

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

CLASS

Public

Undocumented

TEST-CONDITION-RESULT

TEST-EQUAL-RESULT

TEST-ERROR-RESULT

TEST-RESULT

Private

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.

Undocumented

TEST-ASSERT-RESULT