Copyright | (c) John Maraist 2022 |
---|---|
License | GPL3 |
Maintainer | haskell-tlt@maraist.org |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
Main state and monad definitions for the TLT
testing system. See
TLT
for more information.
Synopsis
- type TLTstate = (TLTopts, TRBuf)
- newtype Monad m => TLT m r = TLT {}
- class (Monad m, Monad n) => MonadTLT m n | m -> n where
- runTLT :: Monad m => TLT m r -> m (TLTopts, [TestResult])
- reportAllTestResults :: MonadTLT m n => Bool -> m ()
- setExitAfterFailDisplay :: MonadTLT m n => Bool -> m ()
- tltFail :: MonadTLT m n => String -> String -> m ()
- inGroup :: MonadTLT m n => String -> m a -> m a
Documentation
newtype Monad m => TLT m r Source #
Monad transformer for TLT tests. This layer stores the results from tests as they are executed.
class (Monad m, Monad n) => MonadTLT m n | m -> n where Source #
Extending TLT
operations across other monad transformers. For
easiest and most flexible testing, declare the monad transformers
of your application as instances of this class.
liftTLT :: TLT n a -> m a Source #
Lift TLT operations within a monad transformer stack. Note that
with enough transformer types included in this class, the
liftTLT
function should usually be unnecessary: the commands in
this module which actually configure testing, or specify a test,
already liftTLT
their own result. So they will all act as
top-level transformers in MonadTLT
.
Instances
MonadTLT m n => MonadTLT (MaybeT m) n Source # | |
MonadTLT m n => MonadTLT (ResourceT m) n Source # | |
Monad m => MonadTLT (TLT m) m Source # | |
MonadTLT m n => MonadTLT (STT s m) n Source # | |
MonadTLT m n => MonadTLT (IdentityT m) n Source # | |
(MonadTLT m n, Functor f) => MonadTLT (FreeT f m) n Source # | |
MonadTLT m n => MonadTLT (ReaderT r m) n Source # | |
MonadTLT m n => MonadTLT (StateT s m) n Source # | |
MonadTLT m n => MonadTLT (StateT s m) n Source # | |
(MonadTLT m n, Monoid w) => MonadTLT (WriterT w m) n Source # | |
(MonadTLT m n, Monoid w) => MonadTLT (WriterT w m) n Source # | |
runTLT :: Monad m => TLT m r -> m (TLTopts, [TestResult]) Source #
Execute the tests specified in a TLT
monad without output
side-effects, returning the final options and result reports.
This function is primarily useful when calling TLT from some other
package. If you are using TLT itself as your test framework, and
wishing to see its human-oriented output directly, consider using
tlt
instead.
reportAllTestResults :: MonadTLT m n => Bool -> m () Source #
This function controls whether tlt
will report only
tests which fail, suppressing any display of tests which pass, or
else report the results of all tests. The default is the former:
the idea is that no news should be good news, with the programmer
bothered only with problems which need fixing.
setExitAfterFailDisplay :: MonadTLT m n => Bool -> m () Source #
This function controls whether the main tlt
executable
should exit after displaying test results which include at least
one failing test. By default, it will exit in this situation. The
idea is that a test suite can be broken into parts when it makes
sense to run the latter parts only when the former parts all pass.