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 #

A simple console UI.

Since: 0.4

newtype Quiet #

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

Since: 0.8

Constructors

Quiet Bool |

#### Instances

Instances details

Eq Quiet # |
Instance details Defined in Test.Tasty.Ingredients.ConsoleReporter Methods (==) :: Quiet -> Quiet -> Bool # (/=) :: Quiet -> Quiet -> Bool #
Ord Quiet # |
Instance details Defined in Test.Tasty.Ingredients.ConsoleReporter Methods compare :: Quiet -> Quiet -> Ordering # (<) :: Quiet -> Quiet -> Bool # (<=) :: Quiet -> Quiet -> Bool # (>) :: Quiet -> Quiet -> Bool # (>=) :: Quiet -> Quiet -> Bool # max :: Quiet -> Quiet -> Quiet # min :: Quiet -> Quiet -> Quiet #
IsOption Quiet # |
Instance details Defined in Test.Tasty.Ingredients.ConsoleReporter Methods defaultValue :: Quiet # parseValue :: String -> Maybe Quiet # optionName :: Tagged Quiet String # optionHelp :: Tagged Quiet String # showDefaultValue :: Quiet -> Maybe String # optionCLParser :: Parser Quiet #

newtype HideSuccesses #

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 # |
Instance details Defined in Test.Tasty.Ingredients.ConsoleReporter Methods (==) :: HideSuccesses -> HideSuccesses -> Bool # (/=) :: HideSuccesses -> HideSuccesses -> Bool #
Ord HideSuccesses # |
Instance details 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 # |
Instance details Defined in Test.Tasty.Ingredients.ConsoleReporter Methods defaultValue :: HideSuccesses # parseValue :: String -> Maybe HideSuccesses # optionName :: Tagged HideSuccesses String # optionHelp :: Tagged HideSuccesses String # showDefaultValue :: HideSuccesses -> Maybe String # optionCLParser :: Parser HideSuccesses #

newtype AnsiTricks #

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 # |
Instance details Defined in Test.Tasty.Ingredients.ConsoleReporter Methods defaultValue :: AnsiTricks # parseValue :: String -> Maybe AnsiTricks # optionName :: Tagged AnsiTricks String # optionHelp :: Tagged AnsiTricks String # showDefaultValue :: AnsiTricks -> Maybe String # optionCLParser :: Parser AnsiTricks #

## Listing tests

listingTests :: Ingredient #

The ingredient that provides the test listing functionality.

Since: 0.4

newtype ListTests #

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 # |
Instance details Defined in Test.Tasty.Ingredients.ListTests Methods (==) :: ListTests -> ListTests -> Bool # (/=) :: ListTests -> ListTests -> Bool #
Ord ListTests # |
Instance details Defined in Test.Tasty.Ingredients.ListTests Methods compare :: ListTests -> ListTests -> Ordering # (<) :: ListTests -> ListTests -> Bool # (<=) :: ListTests -> ListTests -> Bool # (>) :: ListTests -> ListTests -> Bool # (>=) :: ListTests -> ListTests -> Bool # max :: ListTests -> ListTests -> ListTests # min :: ListTests -> ListTests -> ListTests #
IsOption ListTests # |
Instance details Defined in Test.Tasty.Ingredients.ListTests Methods defaultValue :: ListTests # parseValue :: String -> Maybe ListTests # optionName :: Tagged ListTests String # optionHelp :: Tagged ListTests String # showDefaultValue :: ListTests -> Maybe String # optionCLParser :: Parser ListTests #

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

Obtain the list of all tests in the suite.

Since: 0.4

## Adding options

includingOptions :: [OptionDescription] -> Ingredient #

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

The option values can be accessed using `askOption`.

Since: 0.6