sandwich-0.1.0.3: Yet another test framework for Haskell
Safe HaskellNone
LanguageHaskell2010

Test.Sandwich.Options

Synopsis

Documentation

data Options Source #

All the options controlling a test run.

defaultOptions :: Options Source #

A reasonable default set of options.

Artifacts

optionsTestArtifactsDirectory :: Options -> TestArtifactsDirectory Source #

Where to save test artifacts (logs, screenshots, failure reports, etc.).

data TestArtifactsDirectory Source #

Control whether test artifacts are stored to a directory.

Constructors

TestArtifactsNone

Do not create a test artifacts directory.

TestArtifactsFixedDirectory

Use the test artifacts directory at the given path, creating it if necessary.

TestArtifactsGeneratedDirectory

Create a new test artifacts directory under '' test artifacts directory at the given path.

Fields

Logging

optionsSavedLogLevel :: Options -> Maybe LogLevel Source #

Minimum test log level to save (has no effect if optionsTestArtifactsDirectory is TestArtifactsNone).

optionsMemoryLogLevel :: Options -> Maybe LogLevel Source #

Test log level to store in memory while tests are running. (These logs are presented in formatters, etc.).

optionsLogFormatter :: Options -> LogEntryFormatter Source #

Formatter function for log entries.

Formatting

optionsFormatters :: Options -> [SomeFormatter] Source #

Which formatters to use to output the results of the tests.

data SomeFormatter Source #

An existential wrapper around Formatters

Constructors

forall f.(Formatter f, Typeable f) => SomeFormatter f 

class Formatter f where Source #

Methods

formatterName :: f -> String Source #

Name of the formatter

runFormatter :: (MonadIO m, MonadLogger m, MonadUnliftIO m, MonadCatch m) => f -> [RunNode BaseContext] -> Maybe (CommandLineOptions ()) -> BaseContext -> m () Source #

The main function, executed while the test tree is running

finalizeFormatter :: (MonadIO m, MonadLogger m, MonadCatch m) => f -> [RunNode BaseContext] -> BaseContext -> m () Source #

Called after the test tree is completed, can be used to print final results

Filtering

optionsFilterTree :: Options -> Maybe TreeFilter Source #

Filter to apply to the text tree before running.

newtype TreeFilter Source #

Constructors

TreeFilter String 

Timing

optionsTestTimerType :: Options -> TestTimerType Source #

Whether to enable the test timer. When the test timer is present, timing information will be emitted to the project root (if present).

Misc

optionsProjectRoot :: Options -> Maybe FilePath Source #

An optional absolute path to the root of the project being tested (i.e. the folder where the cabal file is found). This is useful to provide when the current working directory does not match the project root, for example in multi-project Stack setups. We use this hint to connect CallStack paths (which are relative to the project root) to their actual path on disk.