Safe Haskell | None |
---|---|
Language | Haskell2010 |
Test.Tasty.Ingredients.ConsoleReporter
Description
Console reporter ingredient
Synopsis
- consoleTestReporter :: Ingredient
- newtype Quiet = Quiet Bool
- newtype HideSuccesses = HideSuccesses Bool
- data UseColor
- useColor :: UseColor -> Bool -> Bool
- data Statistics = Statistics {
- statTotal :: !Int
- statFailures :: !Int
- printStatistics :: (?colors :: Bool) => Statistics -> Time -> IO ()
- printStatisticsNoTime :: (?colors :: Bool) => Statistics -> IO ()
- data TestOutput
- = PrintTest String (IO ()) (Result -> IO ())
- | PrintHeading String (IO ()) TestOutput
- | Skip
- | Seq TestOutput TestOutput
- buildTestOutput :: (?colors :: Bool) => OptionSet -> TestTree -> TestOutput
- foldTestOutput :: Monoid b => (String -> IO () -> IO Result -> (Result -> IO ()) -> b) -> (String -> IO () -> b -> b) -> TestOutput -> StatusMap -> b
Documentation
consoleTestReporter :: Ingredient Source #
A simple console UI
Do not print test results (see README for details)
Constructors
Quiet Bool |
Instances
Eq Quiet Source # | |
Ord Quiet Source # | |
IsOption Quiet Source # | |
Defined in Test.Tasty.Ingredients.ConsoleReporter Methods defaultValue :: Quiet Source # parseValue :: String -> Maybe Quiet Source # optionName :: Tagged Quiet String Source # optionHelp :: Tagged Quiet String Source # optionCLParser :: Parser Quiet Source # |
newtype HideSuccesses Source #
Report only failed tests
Constructors
HideSuccesses Bool |
Instances
Eq HideSuccesses Source # | |
Defined in Test.Tasty.Ingredients.ConsoleReporter | |
Ord HideSuccesses Source # | |
Defined in Test.Tasty.Ingredients.ConsoleReporter Methods compare :: HideSuccesses -> HideSuccesses -> Ordering (<) :: HideSuccesses -> HideSuccesses -> Bool (<=) :: HideSuccesses -> HideSuccesses -> Bool (>) :: HideSuccesses -> HideSuccesses -> Bool (>=) :: HideSuccesses -> HideSuccesses -> Bool max :: HideSuccesses -> HideSuccesses -> HideSuccesses min :: HideSuccesses -> HideSuccesses -> HideSuccesses | |
IsOption HideSuccesses Source # | |
Defined in Test.Tasty.Ingredients.ConsoleReporter Methods defaultValue :: HideSuccesses Source # parseValue :: String -> Maybe HideSuccesses Source # optionName :: Tagged HideSuccesses String Source # optionHelp :: Tagged HideSuccesses String Source # optionCLParser :: Parser HideSuccesses Source # |
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
When to use color on the output
Since: 0.11.3
Instances
Eq UseColor Source # | |
Ord UseColor Source # | |
Defined in Test.Tasty.Ingredients.ConsoleReporter | |
IsOption UseColor Source # | Control color output |
Defined in Test.Tasty.Ingredients.ConsoleReporter Methods defaultValue :: UseColor Source # parseValue :: String -> Maybe UseColor Source # optionName :: Tagged UseColor String Source # optionHelp :: Tagged UseColor String Source # optionCLParser :: Parser UseColor Source # |
useColor :: UseColor -> Bool -> Bool Source #
useColor when isTerm
decides if colors should be used,
where isTerm
indicates whether stdout
is a terminal device.
Since: 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: 0.11.3
Constructors
Statistics | |
Fields
|
Instances
Semigroup Statistics Source # | |
Defined in Test.Tasty.Ingredients.ConsoleReporter Methods (<>) :: Statistics -> Statistics -> Statistics sconcat :: NonEmpty Statistics -> Statistics stimes :: Integral b => b -> Statistics -> Statistics | |
Monoid Statistics Source # | |
Defined in Test.Tasty.Ingredients.ConsoleReporter Methods mempty :: Statistics mappend :: Statistics -> Statistics -> Statistics mconcat :: [Statistics] -> Statistics |
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: 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: 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: 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 |
Skip | Inactive test (e.g. not matching the current pattern) |
Seq TestOutput TestOutput | Two sets of |
Instances
Semigroup TestOutput Source # | |
Defined in Test.Tasty.Ingredients.ConsoleReporter Methods (<>) :: TestOutput -> TestOutput -> TestOutput sconcat :: NonEmpty TestOutput -> TestOutput stimes :: Integral b => b -> TestOutput -> TestOutput | |
Monoid TestOutput Source # | |
Defined in Test.Tasty.Ingredients.ConsoleReporter Methods mempty :: TestOutput mappend :: TestOutput -> TestOutput -> TestOutput mconcat :: [TestOutput] -> TestOutput |
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: 0.11.3
Arguments
:: Monoid b | |
=> (String -> IO () -> IO Result -> (Result -> IO ()) -> b) | Eliminator for test cases. The |
-> (String -> IO () -> b -> b) | Eliminator for test groups. The |
-> TestOutput | The |
-> StatusMap | The |
-> b |
Fold function for the TestOutput
tree into a Monoid
.
Since: 0.12