Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Functions for retrieving context information from within tests.
Synopsis
- getContext :: (Monad m, HasLabel context l a, HasCallStack, MonadReader context m) => Label l a -> m a
- getRunRoot :: (Monad m, HasBaseContext context, MonadReader context m) => m (Maybe FilePath)
- getCurrentFolder :: (HasBaseContext context, MonadReader context m, MonadIO m) => m (Maybe FilePath)
- getCommandLineOptions :: forall a context m. (HasCommandLineOptions context a, MonadReader context m, MonadIO m) => m (CommandLineOptions a)
- getUserCommandLineOptions :: (HasCommandLineOptions context a, MonadReader context m, MonadIO m) => m a
Documentation
getContext :: (Monad m, HasLabel context l a, HasCallStack, MonadReader context m) => Label l a -> m a Source #
Get a context by its label.
getRunRoot :: (Monad m, HasBaseContext context, MonadReader context m) => m (Maybe FilePath) Source #
Get the root folder of the on-disk test tree for the current run.
Will be Nothing
if the run isn't configured to use the disk.
getCurrentFolder :: (HasBaseContext context, MonadReader context m, MonadIO m) => m (Maybe FilePath) Source #
Get the on-disk folder corresponding to the current node.
Will be Nothing
if the run isn't configured to use the disk, or if the current node is configured
not to create a folder.
getCommandLineOptions :: forall a context m. (HasCommandLineOptions context a, MonadReader context m, MonadIO m) => m (CommandLineOptions a) Source #
Get the command line options, if configured.
Using the runSandwichWithCommandLineArgs
family of main functions will introduce these, or you can
introduce them manually
getUserCommandLineOptions :: (HasCommandLineOptions context a, MonadReader context m, MonadIO m) => m a Source #
Get the user command line options, if configured.
This just calls getCommandLineOptions
and pulls out the user options.