Next: , Previous: , Up: srfi testing spec   [Index]


2.27.3.3 Test runner

A test-runner is an object that runs a test-suite, and manages the state. The test group path, and the sets skip and expected–fail specifiers are part of the test-runner. A test-runner will also typically accumulate statistics about executed tests,

Function: test-runner? value

True iff value is a test-runner object.

Function: test-runner-current
Function: test-runner-current runner

Get or set the current test-runner. If an implementation supports parameter objects (as in SRFI-39), then test-runner-current can be a parameter object. Alternatively, test-runner-current may be implemented as a macro or function that uses a fluid or thread–local variable, or a plain global variable.

Function: test-runner-get

Same as (test-runner-current), buth throws an exception if there is no current test-runner.

Function: test-runner-simple

Create a new simple test-runner, that prints errors and a summary on the standard output port.

Function: test-runner-null

Create a new test-runner, that does nothing with the test results. This is mainly meant for extending when writing a custom runner.

Implementations may provide other test-runners, perhaps a (test-runner-gui).

Function: test-runner-create

Create a new test-runner. Equivalent to:

((test-runner-factory))
Function: test-runner-factory
Function: test-runner-factory factory

Get or set the current test-runner factory. A factory is a zero–argument function that creates a new test-runner. The default value is test-runner-simple, but implementations may provide a way to override the default. As with test-runner-current, this may be a parameter object, or use a per–thread, fluid, or global variable.

Running specific tests with a specified runner

Function: test-apply specifier ... procedure
Function: test-apply runner specifier ... procedure

Call procedure with no arguments using the specified runner as the current test-runner. If runner is omitted, then (test-runner-current) is used. (If there is no current runner, one is created as in test-begin.)

If one or more specifiers are listed then only tests matching the specifiers are executed. A specifier has the same form as one used for test-skip. A test is executed if it matches any of the specifiers in the test-apply and does not match any active test-skip specifiers.

Function: test-with-runner runner decl-or-expr ...

Execute each decl-or-expr in order in a context where the current test-runner is runner.


Next: , Previous: , Up: srfi testing spec   [Index]