-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Easy unit test driver framework -- -- testrunner is a framework to run unit tests. It has the following -- distinguishing features: * It can run unit tests in parallel. * It can -- run QuickCheck and HUnit tests as well as simple boolean expressions. -- * It comes with a ready-made main function for your unit test -- executable. * This main function recognizes command-line arguments to -- select tests by name and replay QuickCheck tests. @package testrunner @version 0.9.1 -- | Test.Runner.Backends contains the types and functions that make it -- possible to run tests constructed with different test packages with -- the same driver framework from Test.Runner.Driver. module Test.Runner.Backends -- | A TestRunnerTest is a data type that hides the actual type of the test -- - QuickCheck, plain IO action, or any other RunnableTest. This is -- required to be able to put tests of different types in a single list. data TestRunnerTest TestRunnerTest :: a -> TestRunnerTest -- | The class of all types that testrunner can treat as a test. The method -- run should return Nothing if the test succeeds, or -- Just s if the test fails, where s is a -- human-readable description of the failure. class RunnableTest a run :: RunnableTest a => a -> IO (Maybe String) runWithArgs :: RunnableTest a => Args -> a -> IO (Maybe String) -- | RunWithQuickCheck turns a QuickCheck test into something that -- can be run with testrunner. This type-level indirection is necessary -- to please the type checker. data RunWithQuickCheck RunWithQuickCheck :: a -> RunWithQuickCheck -- | Convenience function to go from something testable by QuickCheck to a -- TestRunnerTest in one step. runWithQuickCheck :: Testable a => a -> TestRunnerTest instance RunnableTest Test instance RunnableTest RunWithQuickCheck instance RunnableTest (IO Bool) instance RunnableTest Bool -- | Test.Runner.Driver contains the functions that determine which tests -- are run, with which parameters and by how many threads. module Test.Runner.Driver -- | Run a list of named tests. runTests :: [(String, TestRunnerTest)] -> IO Result -- | Uses multiple threads to run a set of unit tests. runTestsParallel :: Int -> [(String, TestRunnerTest)] -> IO Result -- | Run a list of named tests, using the given QuickCheck Args -- for the QuickCHeck tests. runTestsWithArgs :: Args -> [(String, TestRunnerTest)] -> IO Result -- | Use multiple threads to run a set of unit tests, and run the -- QuickCheck tests with the given QuickCheck Args. runTestsParallelWithArgs :: Int -> Args -> [(String, TestRunnerTest)] -> IO Result -- | The result of the test runner mentions how many tests passed, and the -- names and failure messages of the tests that failed. data Result Result :: Int -> [(String, String)] -> Result numPassed :: Result -> Int failures :: Result -> [(String, String)] instance Show Result instance Eq Result instance Ord Result -- | Test.Runner.Frontend contains the code for the prefabricated unit test -- executable, like command-line argument parsing and handling. module Test.Runner.Frontend -- | testRunnerMain is intended to be used as the main function of a unit -- test program. It takes as an argument the complete list of unit tests -- for a package. testRunnerMain :: [(String, TestRunnerTest)] -> IO () module Test.Runner