HUnit-Plus-2.0.0: A test framework building on HUnit.

Safe HaskellSafe
LanguageHaskell2010

Test.HUnitPlus.Reporting

Description

Reporting functionality for HUnit-Plus. Test reporting is now defined using a set of events. A Reporter contains handlers for these events, which have access to and update a Reporter-defined state value. The handlers in a Reporter are called at appropriate points during text execution.

This module also contains a basic defaultReporter that simply passes the state value through unchanged. It also defines combinedReporter, which facilitates "gluing" two Reporters together.

Synopsis

Documentation

data Node Source #

Composed into Paths.

Constructors

Label Text 

data State Source #

Keeps track of the remaining tests and the results of the performed tests. As each test is performed, the path is removed and the counts are updated as appropriate.

Constructors

State 

Fields

data Counts Source #

A record that holds the results of tests that have been performed up until this point.

Constructors

Counts 

Fields

data Reporter us Source #

Report generator. This record type contains a number of functions that are called at various points throughout a test run.

Constructors

Reporter 

Fields

type Path = [Node] Source #

Uniquely describes the location of a test within a test hierarchy. Node order is from test case to root.

zeroCounts :: Counts Source #

A Counts with all zero counts.

showPath :: Path -> Text Source #

Converts a test case path to a string, separating adjacent elements by a dot ('.'). An element of the path is quoted (as with show) when there is potential ambiguity.

showQualName :: State -> Text Source #

Gewerate a string showing the entire qualified name from the reporting state.

defaultReporter :: Reporter a Source #

A reporter containing default actions, which are to do nothing and return the user state unmodified.

combinedReporter :: Reporter us1 -> Reporter us2 -> Reporter (us1, us2) Source #

Combines two Reporters into a single reporter that calls both.