Common Lisp Package: XP-TEST-FRAMEWORK

This is the XP TestSuite Framework.

README:

FUNCTION

Public

FAILURE (FORMAT-STR &REST ARGS)

Signal a test failure and exit the test.

MACRO

Public

DEF-TEST-FIXTURE (NAME SUPERS SLOTDEFS &REST CLASS-OPTIONS)

Define a new test-fixture class. Works just like defclass, but ensure that test-fixture is a super.

MAKE-TEST-CASE (NAME FIXTURE &KEY (TEST-THUNK 'PERFORM-TEST) (TEST-SUITE NIL) (DESCRIPTION No description.))

Create a test-case which is an instance of FIXTURE. TEST-THUNK is the method that will be invoked when perfoming this test, and can be a symbol or a lambda taking a single argument, the test-fixture instance. DESCRIPTION is obviously what it says it is.

MAKE-TEST-SUITE (NAME DESCRIPTION &REST TESTSPECS)

Returns a new test-suite. TESTSPECS are just like lists of arguments to MAKE-TEST-CASE.

Private

Undocumented

HANDLER-CASE-IF (TEST FORM &BODY CASES)

TEST-ASSERT (TEST)

UNWIND-PROTECT-IF (TEST PROTECTED CLEANUP)

GENERIC-FUNCTION

Public

Undocumented

ADD-TEST (TEST SUITE)

PERFORM-TEST (TEST)

REMOVE-TEST (TEST SUITE)

REPORT-RESULT (RESULT &KEY (VERBOSE NIL) (STREAM T))

RUN-TEST (TEST &KEY (HANDLE-ERRORS T))

SETUP (TEST)

SETUP-TESTSUITE-NAMED (NAME)

TEARDOWN (TEST)

TEARDOWN-TESTSUITE-NAMED (NAME)

TEST-NAMED (NAME SUITE)

TESTS (SUITE)

SLOT-ACCESSOR

Private

DESCRIPTION (OBJECT)

Short description of this test-case, uses in reports

TEST-NAME (OBJECT)

The name of this test-case, used in reports.

TEST-THUNK (OBJECT)

A thunk or symbol which will be applied to this instance, a test-case, to perform that test-case. Defaults to 'perform-test

Undocumented

RESULT-TEST (OBJECT)

START-TIME (OBJECT)

STOP-TIME (OBJECT)

TEST-ERRORS (OBJECT)

TEST-FAILURES (OBJECT)

TEST-SUITE-NAME (OBJECT)

TESTS-HASH (OBJECT)

SETFTESTS-HASH (NEW-VALUE OBJECT)

CLASS

Public

TEST-RESULT

The result of applying a test

Private

TEST-FIXTURE

Base class for test-fixtures. Test-cases are instances of test-fixtures.

Undocumented

TEST-SUITE

CONDITION

Public

TEST-FAILURE

Base class for all test failures.