tasty-1.1.0.4: Modern and extensible testing framework

Safe HaskellNone
LanguageHaskell2010

Test.Tasty.Ingredients.ConsoleReporter

Contents

Description

Console reporter ingredient

Synopsis

Documentation

consoleTestReporter :: Ingredient Source #

A simple console UI

newtype Quiet Source #

Do not print test results (see README for details)

Constructors

Quiet Bool 

Internals

The following functions and datatypes are internals that are exposed to simplify the task of rolling your own custom console reporter UI.

Output colouring

data UseColor Source #

When to use color on the output

Since: tasty-0.11.3

Constructors

Never 
Always 
Auto

Only if stdout is an ANSI color supporting terminal

useColor :: UseColor -> Bool -> Bool Source #

useColor when isTerm decides if colors should be used, where isTerm indicates whether stdout is a terminal device.

Since: tasty-0.11.3

Test failure statistics

data Statistics Source #

Track the number of tests that were run and failures of a TestTree or sub-tree.

Since: tasty-0.11.3

Constructors

Statistics 

Fields

  • statTotal :: !Int

    Number of active tests (e.g., that match the pattern specified on the commandline), inactive tests are not counted.

  • statFailures :: !Int

    Number of active tests that failed.

printStatistics :: (?colors :: Bool) => Statistics -> Time -> IO () Source #

printStatistics reports test success/failure statistics and time it took to run. The Time results is intended to be filled in by the TestReporter callback. The colors ImplicitParam controls whether coloured output is used.

Since: tasty-0.11.3

printStatisticsNoTime :: (?colors :: Bool) => Statistics -> IO () Source #

printStatisticsNoTime reports test success/failure statistics The colors ImplicitParam controls whether coloured output is used.

Since: tasty-0.12

Outputting results

data TestOutput Source #

TestOutput is an intermediary between output formatting and output printing. It lets us have several different printing modes (normal; print failures only; quiet).

Since: tasty-0.12

Constructors

PrintTest String (IO ()) (Result -> IO ())

Name of a test, an action that prints the test name, and an action that renders the result of the action.

PrintHeading String (IO ()) TestOutput

Name of a test group, an action that prints the heading of a test group and the TestOutput for that test group.

Skip

Inactive test (e.g. not matching the current pattern)

Seq TestOutput TestOutput

Two sets of TestOuput on the same level

buildTestOutput :: (?colors :: Bool) => OptionSet -> TestTree -> TestOutput Source #

Build the TestOutput for a TestTree and OptionSet. The colors ImplicitParam controls whether the output is colored.

Since: tasty-0.11.3

foldTestOutput Source #

Arguments

:: Monoid b 
=> (String -> IO () -> IO Result -> (Result -> IO ()) -> b)

Eliminator for test cases. The IO () prints the testname. The IO Result blocks until the test is finished, returning it's Result. The Result -> IO () function prints the formatted output.

-> (String -> IO () -> b -> b)

Eliminator for test groups. The IO () prints the test group's name. The b is the result of folding the test group.

-> TestOutput

The TestOutput being rendered.

-> StatusMap

The StatusMap received by the TestReporter

-> b 

Fold function for the TestOutput tree into a Monoid.

Since: tasty-0.12