Safe Haskell | None |
---|
This module defines the basic test type, HClTest, which is a monad. It also provides functions for creating and running tests.
- newtype HClTest w a = HClTest {}
- data Config = Config {}
- runHClTest :: Double -> HClTest Trace () -> IO (Bool, String)
- runHClTestTrace :: Double -> HClTest Trace () -> IO (Bool, DList Trace)
- failTest :: a -> HClTest a b
- testStep :: String -> HClTest String a -> HClTest Trace a
- traceMsg :: a -> HClTest a ()
- testIO :: String -> IO Bool -> HClTest Trace ()
- randomParallel :: Int -> [HClTest Trace ()] -> HClTest Trace ()
- timeoutFactor :: Iso' Config Double
Documentation
The config is passed in a Reader to the test cases.
MonadReader Config (HClTest w) |
runHClTest :: Double -> HClTest Trace () -> IO (Bool, String)Source
Like runHClTestTrace, but already shows the trace so that you get a string.
runHClTestTrace :: Double -> HClTest Trace () -> IO (Bool, DList Trace)Source
Run a HClTest. The first argument is the timeout for waiting for output of the process, in milliseconds. The second argument is the test case.
This will run the test in a temporary working directory. Use the functions in Test.HClTest.Setup to setup the environment.
Returns True when the test succeeded, False otherwise.
failTest :: a -> HClTest a bSource
This is a HClTest action that always fails. The first argument is the trace to leave.
If you want to fail without leaving a trace, you can just use mzero
.
testIO :: String -> IO Bool -> HClTest Trace ()Source
Run an IO action, and fail if that action returns false. The first argument is a description of the IO action which will be used for the trace messages.