Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Options
- defaultOptions :: Options
- optionsTestArtifactsDirectory :: Options -> TestArtifactsDirectory
- data TestArtifactsDirectory
- optionsSavedLogLevel :: Options -> Maybe LogLevel
- optionsMemoryLogLevel :: Options -> Maybe LogLevel
- optionsLogFormatter :: Options -> LogEntryFormatter
- type LogEntryFormatter = UTCTime -> Loc -> LogSource -> LogLevel -> LogStr -> ByteString
- optionsFormatters :: Options -> [SomeFormatter]
- data SomeFormatter = forall f.(Formatter f, Typeable f) => SomeFormatter f
- class Formatter f where
- formatterName :: f -> String
- runFormatter :: (MonadIO m, MonadLogger m, MonadUnliftIO m, MonadCatch m) => f -> [RunNode BaseContext] -> Maybe (CommandLineOptions ()) -> BaseContext -> m ()
- finalizeFormatter :: (MonadIO m, MonadLogger m, MonadCatch m) => f -> [RunNode BaseContext] -> BaseContext -> m ()
- optionsFilterTree :: Options -> Maybe TreeFilter
- newtype TreeFilter = TreeFilter String
- optionsTestTimerType :: Options -> TestTimerType
- optionsProjectRoot :: Options -> Maybe FilePath
Documentation
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.
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. |
|
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.
type LogEntryFormatter = UTCTime -> Loc -> LogSource -> LogLevel -> LogStr -> ByteString Source #
Formatting
optionsFormatters :: Options -> [SomeFormatter] Source #
Which formatters to use to output the results of the tests.
data SomeFormatter Source #
An existential wrapper around Formatter
s
forall f.(Formatter f, Typeable f) => SomeFormatter f |
class Formatter f where Source #
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
Instances
Formatter TerminalUIFormatter Source # | |
Defined in Test.Sandwich.Formatters.TerminalUI formatterName :: TerminalUIFormatter -> String Source # runFormatter :: (MonadIO m, MonadLogger m, MonadUnliftIO m, MonadCatch m) => TerminalUIFormatter -> [RunNode BaseContext] -> Maybe (CommandLineOptions ()) -> BaseContext -> m () Source # finalizeFormatter :: (MonadIO m, MonadLogger m, MonadCatch m) => TerminalUIFormatter -> [RunNode BaseContext] -> BaseContext -> m () Source # |
Filtering
optionsFilterTree :: Options -> Maybe TreeFilter Source #
Filter to apply to the text tree before running.
newtype TreeFilter Source #
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.