| QuickCheck-1.1.0.0: Automatic testing of Haskell programs | Contents | Index

Test.QuickCheck.Batch |

Portability | non-portable (uses Control.Exception, Control.Concurrent)
Stability | experimental
Maintainer | libraries@haskell.org

Description
A batch driver for running QuickCheck. Note: in GHC only, it is possible to place a time limit on each test, to ensure that testing terminates.
Synopsis

run :: Testable a => a -> TestOptions -> IO TestResult
runTests :: String -> TestOptions -> [TestOptions -> IO TestResult] -> IO ()
defOpt :: TestOptions
data TestOptions = TestOptions {

no_of_tests :: Int
length_of_tests :: Int
debug_tests :: Bool

}

data TestResult

= TestOk String Int [[String]]
| TestExausted String Int [[String]]
| TestFailed [String] Int
| TestAborted Exception

isBottom :: a -> Bool
bottom :: a

Documentation
run :: Testable a => a -> TestOptions -> IO TestResult
Run the test. Here we use the same random number each time, so we get reproducable results!
runTests :: String -> TestOptions -> [TestOptions -> IO TestResult] -> IO ()
Prints a one line summary of various tests with common theme
defOpt :: TestOptions
data TestOptions

Constructors

TestOptions |

no_of_tests :: Int | number of tests to run.
length_of_tests :: Int | time limit for test, in seconds. If zero, no time limit. Note: only GHC supports time limits.
debug_tests :: Bool |

data TestResult

Constructors

TestOk String Int [[String]] |
TestExausted String Int [[String]] |
TestFailed [String] Int |
TestAborted Exception |

isBottom :: a -> Bool
Look out behind you! These can be misused badly. However, in the context of a batch tester, can also be very useful. Examples of use of bottom and isBottom:
    	{- test for abort -}
    	prop_head2 = isBottom (head [])
    	{- test for strictness -}
    	prop_head3 = isBottom (head bottom)
bottom :: a
Produced by Haddock version 0.8