tasty-1.5.3: Modern and extensible testing framework

Safe Haskell | None
Language | Haskell2010

Test.Tasty.Ingredients.Basic

Contents

- Console test reporter
- Listing tests
- Adding options

Description

This module exports the basic ingredients defined in the `tasty` packages.

Note that if `defaultIngredients` from Test.Tasty suits your needs, use that instead of importing this module.

Since: 0.8

Synopsis

- consoleTestReporter :: Ingredient
- newtype Quiet = Quiet Bool
- newtype HideSuccesses = HideSuccesses Bool
- newtype AnsiTricks = AnsiTricks {
  - getAnsiTricks :: Bool
  }
- listingTests :: Ingredient
- newtype ListTests = ListTests Bool
- testsNames :: OptionSet -> TestTree -> [TestName]
- includingOptions :: [OptionDescription] -> Ingredient

## Console test reporter

consoleTestReporter :: Ingredient Source #

A simple console UI.

Since: 0.4

newtype Quiet Source #

Do not print test results (see README for details).

Since: 0.8

Constructors

Quiet Bool |

#### Instances

Instances details

Eq Quiet Source # |
Instance details Defined in Test.Tasty.Ingredients.ConsoleReporter Methods (==) :: Quiet -> Quiet -> Bool Source # (/=) :: Quiet -> Quiet -> Bool Source #
Ord Quiet Source # |
Instance details Defined in Test.Tasty.Ingredients.ConsoleReporter Methods compare :: Quiet -> Quiet -> Ordering Source # (<) :: Quiet -> Quiet -> Bool Source # (<=) :: Quiet -> Quiet -> Bool Source # (>) :: Quiet -> Quiet -> Bool Source # (>=) :: Quiet -> Quiet -> Bool Source # max :: Quiet -> Quiet -> Quiet Source # min :: Quiet -> Quiet -> Quiet Source #
IsOption Quiet Source # |
Instance details 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 # showDefaultValue :: Quiet -> Maybe String Source # optionCLParser :: Parser Quiet Source #

newtype HideSuccesses Source #

Report only failed tests.

At the moment, this option only works globally. As an argument to `localOption`, it does nothing.

Since: 0.8

Constructors

HideSuccesses Bool |

#### Instances

Instances details

Eq HideSuccesses Source # |
Instance details Defined in Test.Tasty.Ingredients.ConsoleReporter Methods (==) :: HideSuccesses -> HideSuccesses -> Bool Source # (/=) :: HideSuccesses -> HideSuccesses -> Bool Source #
Ord HideSuccesses Source # |

Instance details

Defined in Test.Tasty.Ingredients.ConsoleReporter

Methods

compare :: HideSuccesses -> HideSuccesses -> Ordering Source #

(<) :: HideSuccesses -> HideSuccesses -> Bool Source #

(<=) :: HideSuccesses -> HideSuccesses -> Bool Source #

(>) :: HideSuccesses -> HideSuccesses -> Bool Source #

(>=) :: HideSuccesses -> HideSuccesses -> Bool Source #

max :: HideSuccesses -> HideSuccesses -> HideSuccesses Source #

min :: HideSuccesses -> HideSuccesses -> HideSuccesses Source #

IsOption HideSuccesses Source # |
Instance details 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 # showDefaultValue :: HideSuccesses -> Maybe String Source # optionCLParser :: Parser HideSuccesses Source #

newtype AnsiTricks Source #

By default, when the option `--hide-successes` is given and the output goes to an ANSI-capable terminal, we employ some ANSI terminal tricks to display the name of the currently running test and then erase it if it succeeds.

These tricks sometimes fail, however—in particular, when the test names happen to be longer than the width of the terminal window. See

- https://github.com/UnkindPartition/tasty/issues/152
- https://github.com/UnkindPartition/tasty/issues/250

When that happens, this option can be used to disable the tricks. In that case, the test name will be printed only once the test fails.

Since: 1.3

Constructors

AnsiTricks |

Fields

- getAnsiTricks :: Bool

#### Instances

Instances details

IsOption AnsiTricks Source # |
Instance details Defined in Test.Tasty.Ingredients.ConsoleReporter Methods defaultValue :: AnsiTricks Source # parseValue :: String -> Maybe AnsiTricks Source # optionName :: Tagged AnsiTricks String Source # optionHelp :: Tagged AnsiTricks String Source # showDefaultValue :: AnsiTricks -> Maybe String Source # optionCLParser :: Parser AnsiTricks Source #

## Listing tests

listingTests :: Ingredient Source #

The ingredient that provides the test listing functionality.

Since: 0.4

newtype ListTests Source #

This option, when set to `True`, specifies that we should run in the «list tests» mode.

Since: 0.4

Constructors

ListTests Bool |

#### Instances

Instances details

Eq ListTests Source # |
Instance details Defined in Test.Tasty.Ingredients.ListTests Methods (==) :: ListTests -> ListTests -> Bool Source # (/=) :: ListTests -> ListTests -> Bool Source #
Ord ListTests Source # |

Instance details

Defined in Test.Tasty.Ingredients.ListTests

Methods

compare :: ListTests -> ListTests -> Ordering Source #

(<) :: ListTests -> ListTests -> Bool Source #

(<=) :: ListTests -> ListTests -> Bool Source #

(>) :: ListTests -> ListTests -> Bool Source #

(>=) :: ListTests -> ListTests -> Bool Source #

max :: ListTests -> ListTests -> ListTests Source #

min :: ListTests -> ListTests -> ListTests Source #

IsOption ListTests Source # |
Instance details Defined in Test.Tasty.Ingredients.ListTests Methods defaultValue :: ListTests Source # parseValue :: String -> Maybe ListTests Source # optionName :: Tagged ListTests String Source # optionHelp :: Tagged ListTests String Source # showDefaultValue :: ListTests -> Maybe String Source # optionCLParser :: Parser ListTests Source #

testsNames :: OptionSet -> TestTree -> [TestName] Source #

Obtain the list of all tests in the suite.

Since: 0.4

## Adding options

includingOptions :: [OptionDescription] -> Ingredient Source #

This ingredient doesn't do anything apart from registering additional options.

The option values can be accessed using `askOption`.

Since: 0.6