HTF- The Haskell Test Framework

Safe HaskellNone



This module defines the commandline options of the test driver provided by HTF.



data CmdlineOptions Source

Commandline options for running tests.




opts_quiet :: Bool

Be quiet or not.

opts_filter :: TestFilter

Run only tests matching this filter.

opts_help :: Bool

If True, display a help message and exit.

opts_negated :: [String]

Regular expressions matching test names which should not run.

opts_threads :: Maybe Int

Use Just i for parallel execution with i threads, Nothing for sequential execution.

opts_shuffle :: Bool

If True (the default), shuffle tests when running them in parallel.

opts_machineOutput :: Bool

Format output for machines (JSON format) or humans. See JsonOutput for a definition of the JSON format.

opts_machineOutputXml :: Maybe FilePath

Output file for junit-style XML output. See XmlOutput for a definition of the XML format.

opts_useColors :: Maybe Bool

Use Just b to enable/disable use of colors, Nothing infers the use of colors.

opts_outputFile :: Maybe FilePath

The output file, defaults to stdout

opts_listTests :: Bool

If True, lists all tests available and exits.

opts_split :: Bool

If True, each message is sent to a new ouput file (derived by appending an index to opts_outputFile).

parseTestArgs :: [String] -> Either String CmdlineOptionsSource

Parse commandline arguments into CmdlineOptions. Here's a synopsis of the format of the commandline arguments:


   where PATTERN is a posix regular expression matching
   the names of the tests to run.

   -q          --quiet             only display errors
   -n PATTERN  --not=PATTERN       tests to exclude
   -l          --list              list all matching tests
   -j[N]       --threads[=N]       run N tests in parallel, default N=4
               --deterministic     do not shuffle tests when executing them in parallel.
   -o FILE     --output-file=FILE  name of output file
               --json              output results in machine-readable JSON format (incremental)
               --xml=FILE          output results in junit-style XML format
               --split             splits results in separate files to avoid file locking (requires -o/--output-file)
               --colors=BOOL       use colors or not
   -h          --help              display this message

helpString :: StringSource

The string displayed for the --help option.