The xptest Reference Manual

This is the xptest Reference Manual, version 2003.4.21, generated automatically by Declt version 4.0 beta 2 "William Riker" on Wed May 15 07:22:43 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

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


2.1 xptest

Extreme Programming Testing Suite

Maintainer

Kevin M. Rosenberg <>

Author

Craig Brozensky

License

Public domain

Long Description

The XPTEST package is toolkit for building test suites, very much inspired by the test frameworks that the Extreme Programming crew made available for Smalltalk an other languages.

Version

2003.4.21

Source

xptest.asd.

Child Component

xptestsuite.lisp (file).


3 Files

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


3.1 Lisp


3.1.1 xptest/xptest.asd

Source

xptest.asd.

Parent Component

xptest (system).

ASDF Systems

xptest.

Packages

xptest-system.


3.1.2 xptest/xptestsuite.lisp

Source

xptest.asd.

Parent Component

xptest (system).

Packages

xp-test-framework.

Public Interface
Internals

4 Packages

Packages are listed by definition order.


4.1 xp-test-framework

This is the XP TestSuite Framework.

Source

xptestsuite.lisp.

Nicknames
  • xp-test
  • xptest
Use List

common-lisp.

Public Interface
Internals

4.2 xptest-system

Source

xptest.asd.

Use List
  • asdf/interface.
  • common-lisp.

5 Definitions

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


5.1 Public Interface


5.1.1 Macros

Macro: 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.

Package

xp-test-framework.

Source

xptestsuite.lisp.

Macro: make-test-case (name fixture &key test-thunk test-suite 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.

Package

xp-test-framework.

Source

xptestsuite.lisp.

Macro: make-test-suite (name description &rest testspecs)

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

Package

xp-test-framework.

Source

xptestsuite.lisp.


5.1.2 Ordinary functions

Function: failure (format-str &rest args)

Signal a test failure and exit the test.

Package

xp-test-framework.

Source

xptestsuite.lisp.


5.1.3 Generic functions

Generic Function: add-test (test suite)
Package

xp-test-framework.

Methods
Method: add-test ((test test-suite) (suite test-suite))
Source

xptestsuite.lisp.

Method: add-test ((test test-fixture) (suite test-suite))
Source

xptestsuite.lisp.

Generic Function: perform-test (test)
Package

xp-test-framework.

Methods
Method: perform-test ((test test-fixture))

Default method for performing tests upon a test-fixture.

Source

xptestsuite.lisp.

Generic Function: remove-test (test suite)
Package

xp-test-framework.

Methods
Method: remove-test ((test test-suite) (suite test-suite))
Source

xptestsuite.lisp.

Method: remove-test ((test test-fixture) (suite test-suite))
Source

xptestsuite.lisp.

Generic Function: report-result (result &key stream verbose)
Package

xp-test-framework.

Methods
Method: report-result ((results list) &key stream verbose)
Source

xptestsuite.lisp.

Method: report-result ((result test-result) &key stream verbose)

Print out a test-result object for a report to STREAM, default to standard-output. If VERBOSE is non-nil then will produce a lengthy and informative report, otherwise just prints wether the test passed or failed or errored out.

Source

xptestsuite.lisp.

Generic Function: run-test (test &key handle-errors)
Package

xp-test-framework.

Methods
Method: run-test ((suite test-suite) &key handle-errors)
Source

xptestsuite.lisp.

Method: run-test ((test test-fixture) &key handle-errors)

Perform the test represented by the given test-case or test-suite. Returns one or more test-result objects, one for each test-case performed.

Source

xptestsuite.lisp.

Generic Function: setup (test)
Package

xp-test-framework.

Methods
Method: setup ((test test-fixture))

Method called before performing a test, should set up the environment the test-case needs to operate in.

Source

xptestsuite.lisp.

Generic Function: setup-testsuite-named (name)
Package

xp-test-framework.

Methods
Method: setup-testsuite-named (name)
Source

xptestsuite.lisp.

Generic Function: teardown (test)
Package

xp-test-framework.

Methods
Method: teardown ((test test-fixture))

Method called after performing a test. Should reverse everything that the setup method did for this instance.

Source

xptestsuite.lisp.

Generic Function: teardown-testsuite-named (name)
Package

xp-test-framework.

Methods
Method: teardown-testsuite-named (name)
Source

xptestsuite.lisp.

Generic Function: test-named (name suite)
Package

xp-test-framework.

Methods
Method: test-named ((name string) (suite test-suite))
Source

xptestsuite.lisp.

Generic Function: tests (suite)
Package

xp-test-framework.

Methods
Method: tests ((suite test-suite))
Source

xptestsuite.lisp.


5.1.4 Conditions

Condition: test-failure

Base class for all test failures.

Package

xp-test-framework.

Source

xptestsuite.lisp.

Direct superclasses

simple-condition.


5.1.5 Classes

Class: test-result

The result of applying a test

Package

xp-test-framework.

Source

xptestsuite.lisp.

Direct methods
Direct slots
Slot: start-time
Initargs

:start-time

Readers

start-time.

Writers

This slot is read-only.

Slot: stop-time
Initargs

:stop-time

Readers

stop-time.

Writers

This slot is read-only.

Slot: test
Initargs

:test

Readers

result-test.

Writers

This slot is read-only.

Slot: failures
Initargs

:failures

Readers

test-failures.

Writers

This slot is read-only.

Slot: errors
Initargs

:errors

Readers

test-errors.

Writers

This slot is read-only.


5.2 Internals


5.2.1 Macros

Macro: handler-case-if (test form &body cases)
Package

xp-test-framework.

Source

xptestsuite.lisp.

Macro: test-assert (test)
Package

xp-test-framework.

Source

xptestsuite.lisp.

Macro: unwind-protect-if (test protected cleanup)
Package

xp-test-framework.

Source

xptestsuite.lisp.


5.2.2 Generic functions

Generic Reader: description (object)
Package

xp-test-framework.

Methods
Reader Method: description ((test-suite test-suite))

automatically generated reader method

Source

xptestsuite.lisp.

Target Slot

description.

Reader Method: description ((test-fixture test-fixture))

Short description of this test-case, uses in reports

Source

xptestsuite.lisp.

Target Slot

test-description.

Generic Reader: result-test (object)
Package

xp-test-framework.

Methods
Reader Method: result-test ((test-result test-result))

automatically generated reader method

Source

xptestsuite.lisp.

Target Slot

test.

Generic Reader: start-time (object)
Package

xp-test-framework.

Methods
Reader Method: start-time ((test-result test-result))

automatically generated reader method

Source

xptestsuite.lisp.

Target Slot

start-time.

Generic Reader: stop-time (object)
Package

xp-test-framework.

Methods
Reader Method: stop-time ((test-result test-result))

automatically generated reader method

Source

xptestsuite.lisp.

Target Slot

stop-time.

Generic Reader: test-errors (object)
Package

xp-test-framework.

Methods
Reader Method: test-errors ((test-result test-result))

automatically generated reader method

Source

xptestsuite.lisp.

Target Slot

errors.

Generic Reader: test-failures (object)
Package

xp-test-framework.

Methods
Reader Method: test-failures ((test-result test-result))

automatically generated reader method

Source

xptestsuite.lisp.

Target Slot

failures.

Generic Reader: test-name (object)
Package

xp-test-framework.

Methods
Reader Method: test-name ((test-fixture test-fixture))

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

Source

xptestsuite.lisp.

Target Slot

test-name.

Generic Reader: test-suite-name (object)
Package

xp-test-framework.

Methods
Reader Method: test-suite-name ((test-suite test-suite))

automatically generated reader method

Source

xptestsuite.lisp.

Target Slot

name.

Generic Reader: test-thunk (object)
Package

xp-test-framework.

Methods
Reader Method: test-thunk ((test-fixture test-fixture))

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

Source

xptestsuite.lisp.

Target Slot

test-thunk.

Generic Reader: tests-hash (object)
Package

xp-test-framework.

Methods
Reader Method: tests-hash ((test-suite test-suite))

automatically generated reader method

Source

xptestsuite.lisp.

Target Slot

tests.

Generic Writer: (setf tests-hash) (object)
Package

xp-test-framework.

Methods
Writer Method: (setf tests-hash) ((test-suite test-suite))

automatically generated writer method

Source

xptestsuite.lisp.

Target Slot

tests.


5.2.3 Classes

Class: test-fixture

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

Package

xp-test-framework.

Source

xptestsuite.lisp.

Direct methods
Direct slots
Slot: test-thunk

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

Initform

(quote xp-test-framework:perform-test)

Initargs

:test-thunk

Readers

test-thunk.

Writers

This slot is read-only.

Slot: test-name

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

Initargs

:test-name

Readers

test-name.

Writers

This slot is read-only.

Slot: test-description

Short description of this test-case, uses in reports

Initargs

:description

Readers

description.

Writers

This slot is read-only.

Class: test-suite
Package

xp-test-framework.

Source

xptestsuite.lisp.

Direct methods
Direct slots
Slot: name
Initargs

:name

Readers

test-suite-name.

Writers

This slot is read-only.

Slot: tests
Initform

(make-hash-table :test (quote equal))

Initargs

:tests

Readers

tests-hash.

Writers

(setf tests-hash).

Slot: description
Initform

"no description."

Initargs

:description

Readers

description.

Writers

This slot is read-only.


Appendix A Indexes


A.1 Concepts


A.2 Functions

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

(
(setf tests-hash): Private generic functions
(setf tests-hash): Private generic functions

A
add-test: Public generic functions
add-test: Public generic functions
add-test: Public generic functions

D
def-test-fixture: Public macros
description: Private generic functions
description: Private generic functions
description: Private generic functions

F
failure: Public ordinary functions
Function, failure: Public ordinary functions

G
Generic Function, (setf tests-hash): Private generic functions
Generic Function, add-test: Public generic functions
Generic Function, description: Private generic functions
Generic Function, perform-test: Public generic functions
Generic Function, remove-test: Public generic functions
Generic Function, report-result: Public generic functions
Generic Function, result-test: Private generic functions
Generic Function, run-test: Public generic functions
Generic Function, setup: Public generic functions
Generic Function, setup-testsuite-named: Public generic functions
Generic Function, start-time: Private generic functions
Generic Function, stop-time: Private generic functions
Generic Function, teardown: Public generic functions
Generic Function, teardown-testsuite-named: Public generic functions
Generic Function, test-errors: Private generic functions
Generic Function, test-failures: Private generic functions
Generic Function, test-name: Private generic functions
Generic Function, test-named: Public generic functions
Generic Function, test-suite-name: Private generic functions
Generic Function, test-thunk: Private generic functions
Generic Function, tests: Public generic functions
Generic Function, tests-hash: Private generic functions

H
handler-case-if: Private macros

M
Macro, def-test-fixture: Public macros
Macro, handler-case-if: Private macros
Macro, make-test-case: Public macros
Macro, make-test-suite: Public macros
Macro, test-assert: Private macros
Macro, unwind-protect-if: Private macros
make-test-case: Public macros
make-test-suite: Public macros
Method, (setf tests-hash): Private generic functions
Method, add-test: Public generic functions
Method, add-test: Public generic functions
Method, description: Private generic functions
Method, description: Private generic functions
Method, perform-test: Public generic functions
Method, remove-test: Public generic functions
Method, remove-test: Public generic functions
Method, report-result: Public generic functions
Method, report-result: Public generic functions
Method, result-test: Private generic functions
Method, run-test: Public generic functions
Method, run-test: Public generic functions
Method, setup: Public generic functions
Method, setup-testsuite-named: Public generic functions
Method, start-time: Private generic functions
Method, stop-time: Private generic functions
Method, teardown: Public generic functions
Method, teardown-testsuite-named: Public generic functions
Method, test-errors: Private generic functions
Method, test-failures: Private generic functions
Method, test-name: Private generic functions
Method, test-named: Public generic functions
Method, test-suite-name: Private generic functions
Method, test-thunk: Private generic functions
Method, tests: Public generic functions
Method, tests-hash: Private generic functions

P
perform-test: Public generic functions
perform-test: Public generic functions

R
remove-test: Public generic functions
remove-test: Public generic functions
remove-test: Public generic functions
report-result: Public generic functions
report-result: Public generic functions
report-result: Public generic functions
result-test: Private generic functions
result-test: Private generic functions
run-test: Public generic functions
run-test: Public generic functions
run-test: Public generic functions

S
setup: Public generic functions
setup: Public generic functions
setup-testsuite-named: Public generic functions
setup-testsuite-named: Public generic functions
start-time: Private generic functions
start-time: Private generic functions
stop-time: Private generic functions
stop-time: Private generic functions

T
teardown: Public generic functions
teardown: Public generic functions
teardown-testsuite-named: Public generic functions
teardown-testsuite-named: Public generic functions
test-assert: Private macros
test-errors: Private generic functions
test-errors: Private generic functions
test-failures: Private generic functions
test-failures: Private generic functions
test-name: Private generic functions
test-name: Private generic functions
test-named: Public generic functions
test-named: Public generic functions
test-suite-name: Private generic functions
test-suite-name: Private generic functions
test-thunk: Private generic functions
test-thunk: Private generic functions
tests: Public generic functions
tests: Public generic functions
tests-hash: Private generic functions
tests-hash: Private generic functions

U
unwind-protect-if: Private macros