HTF-0.13.0.0: The Haskell Test Framework

Safe HaskellNone
LanguageHaskell2010

Test.Framework.CmdlineOptions

Description

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

Synopsis

Documentation

data CmdlineOptions Source

Commandline options for running tests.

Constructors

CmdlineOptions 

Fields

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, shuffle tests when running them in parallel. Default: False

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).

opts_historyFile :: Maybe FilePath

History file, default: ..HTFProgramName.history

opts_failFast :: Bool

Fail and terminate test run as soon as the first test fails. Default: False

opts_sortByPrevTime :: Bool

Sort tests by their previous run times (ascending). Default: False

opts_maxPrevTimeMs :: Maybe Milliseconds

Ignore tests with a runtime greater than given in a previous test run.

opts_maxCurTimeMs :: Maybe Milliseconds

Abort tests that run more than the given milliseconds.

opts_prevFactor :: Maybe Double

Warn if a test runs more than N times slower than in a previosu run.

opts_timeoutIsSuccess :: Bool

Do not regard test timeout as an error.

parseTestArgs :: [String] -> Either String CmdlineOptions Source

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

USAGE: COMMAND [OPTION ...] PATTERN ...

  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=1.
              --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.
              --history=FILE              Path to the history file. Default: ./.HTF/<ProgramName>.history
              --fail-fast                 Fail and abort test run as soon as the first test fails.
              --sort-by-prev-time         Sort tests ascending by their execution of the previous test run (if available). Default: false
              --max-prev-ms=MILLISECONDS  Do not try to execute tests that had a execution time greater than MILLISECONDS in a previous test run.
              --max-cur-ms=MILLISECONDS   Abort a test that runs more than MILLISECONDS.
              --prev-factor=DOUBLE        Abort a test that runs more than DOUBLE times slower than in a previous run.
              --timeout-is-success        Do not regard a test timeout as an error.
  -h          --help                      Display this message.

helpString :: String Source

The string displayed for the --help option.