Skip to content

SRFI-64 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,

Scheme Procedure: test-runner? value ​

True if and only if value is a test-runner object.

Scheme Parameter: test-runner-current ​

Scheme Parameter: test-runner-current runner ​

Get or set the current test-runner.

Scheme Procedure: test-runner-get ​

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

Scheme Procedure: test-runner-simple ​

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

Scheme Procedure: test-runner-null ​

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

Scheme Procedure: test-runner-create ​

Create a new test-runner. Equivalent to ‘((test-runner-factory))’.

Scheme Parameter: test-runner-factory ​

Scheme Parameter: 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.

Running specific tests with a specified runner ​

Scheme Procedure: test-apply [runner] specifier … procedure ​

Calls 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.

Scheme Syntax: test-with-runner runner decl-or-expr … ​

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