HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Moduletasty-1.5.3Haskell2010

Test.Tasty.Options

Extensible options. They are used for provider-specific settings, ingredient-specific settings and core settings (such as the test name pattern).

  • 2 types
  • 1 class
  • 10 values
  • Packagetasty-1.5.3
  • Exports13
  • LanguageHaskell2010
  • LicenceMIT
  • SourceOptions.hs

IsOption class

1 declaration
classclass Typeable v => IsOption v where
#

An option is a data type that inhabits the IsOption type class.

Methods

  • defaultValue :: v

    The value to use if the option was not supplied explicitly

  • parseValue :: String -> Maybe v

    Try to parse an option value from a string. Consider using safeReadBool for boolean options and safeRead for numeric options.

  • optionName :: Tagged v String

    The option name. It is used to form the command line option name, for instance. Therefore, it had better not contain spaces or other fancy characters. It is recommended to use dashes instead of spaces.

  • optionHelp :: Tagged v String

    The option description or help string. This can be an arbitrary string.

  • showDefaultValue :: v -> Maybe String

    How a defaultValue should be displayed in the help string. Nothing (the default implementation) will result in nothing being displayed, while Just def will result in def being advertised as the default in the help string.

  • optionCLParser :: Parser v

    A command-line option parser.

    It has a default implementation in terms of the other methods. You may want to override it in some cases (e.g. add a short flag) and flagCLParser, mkFlagCLParser and mkOptionCLParser might come in handy.

    Even if you override this, you still should implement all the methods above, to allow alternative interfaces.

    Do not supply a default value (e.g., with the value function) here for this parser! This is because if no value was provided on the command line we may lookup the option e.g. in the environment. But if the parser always succeeds, we have no way to tell whether the user really provided the option on the command line.

    Similarly, do not use showDefaultWith here, as it will be ignored. Use the showDefaultValue method of IsOption instead.

Instances11IsOption, …
  • IsOption ExecutionModeDefined in tasty-1.5.3 · Test.Tasty.Core

    Determines mode of execution of a TestGroup. Note that this option is not exposed as a command line argument.

  • IsOption AnsiTricksDefined in tasty-1.5.3 · Test.Tasty.Ingredients.ConsoleReporter
  • IsOption HideSuccessesDefined in tasty-1.5.3 · Test.Tasty.Ingredients.ConsoleReporter
  • IsOption MinDurationToReportDefined in tasty-1.5.3 · Test.Tasty.Ingredients.ConsoleReporter
  • IsOption QuietDefined in tasty-1.5.3 · Test.Tasty.Ingredients.ConsoleReporter
  • IsOption UseColorDefined in tasty-1.5.3 · Test.Tasty.Ingredients.ConsoleReporter

    Control color output

  • IsOption ListTestsDefined in tasty-1.5.3 · Test.Tasty.Ingredients.ListTests
  • IsOption HideProgressDefined in tasty-1.5.3 · Test.Tasty.Options.Core
  • IsOption NumThreadsDefined in tasty-1.5.3 · Test.Tasty.Options.Core
  • IsOption TimeoutDefined in tasty-1.5.3 · Test.Tasty.Options.Core
  • IsOption TestPatternDefined in tasty-1.5.3 · Test.Tasty.Patterns

    Since tasty-1.5, this option can be specified multiple times on the command line. Only the tests matching all given patterns will be selected.

Option sets and operations

7 declarations
newtypenewtype OptionSet
#

A set of options. Only one option of each type can be kept.

If some option has not been explicitly set, the default value is used.

Instances2Semigroup, Monoid

Utilities

5 declarations