Represents a listener which will be notified about events that occur during a test run.

Example of simple listener, which triggers alarm whenever test fails.

shared class RingingListener() satisfies TestListener {
    shared actual void testError(TestErrorEvent event) => alarm.ring();
}

… such listener can be used directly when creating TestRunner

TestRunner runner = createTestRunner{
    sources = [`module com.acme`];
    extensions = [RingingListener()];};

… or better declaratively with usage of testExtension() annotation

testExtension(`class RingingListener`)
module com.acme;

no type hierarchy

Inherited Attributes
Attributes inherited from: Object
Attributes inherited from: TestExtension
Methods
testAbortedSource Codeshared default void testAborted(TestAbortedEvent event)

Called when a test has been aborted, because its assumption wasn't met.

Parameters:
  • event

    The event object.

testErrorSource Codeshared default void testError(TestErrorEvent event)

Called when a test will not be run, because some error has occurred. For example a invalid test function signature.

Parameters:
  • event

    The event object.

testExcludedSource Codeshared default void testExcluded(TestExcludedEvent event)

Called when a test is excluded from the test run due TestFilter

Parameters:
  • event

    The event object.

testFinishedSource Codeshared default void testFinished(TestFinishedEvent event)

Called when a test has finished, whether the test succeeds or not.

Parameters:
  • event

    The event object.

testRunFinishedSource Codeshared default void testRunFinished(TestRunFinishedEvent event)

Called after all tests have finished.

Parameters:
  • event

    The event object.

testRunStartedSource Codeshared default void testRunStarted(TestRunStartedEvent event)

Called before any tests have been run.

Parameters:
  • event

    The event object.

testSkippedSource Codeshared default void testSkipped(TestSkippedEvent event)

Called when a test has been skipped, because its condition wasn't fullfiled.

Parameters:
  • event

    The event object.

testStartedSource Codeshared default void testStarted(TestStartedEvent event)

Called when a test is about to be started.

Parameters:
  • event

    The event object.

Inherited Methods
Methods inherited from: Object