pqc-0.8: Parallel batch driver for QuickCheck

Portabilitynon-portable (uses Control.Concurrent, GHC.Conc )
Stabilityexperimental
Maintainershelarcy <shelarcy@gmail.com>
Safe HaskellTrustworthy

Test.QuickCheck.Parallel

Description

A parallel batch driver for running QuickCheck on threaded or SMP systems. See the Example.hs file for a complete overview.

Synopsis

Documentation

pRun :: Depth -> [Test] -> IO ()Source

Run a list of QuickCheck properties in parallel chunks, and test to a depth of d (first argument). Parallel Chunks is Haskell thread that can run truly simultaneously (on separate physical processors) at any given time.

Compile your application with '-threaded' and run with the SMP runtime's '-N4' (or however many OS threads you want to donate), for best results.

 import Test.QuickCheck.Parallel

 pRun 1000
    [ ("sort1", pDet prop_sort1)
    , ("sort2", pDet prop_sort2) ]

with SMP runtime's '-N[n]' flag will run n threads over the property list, to depth 1000. (see getNumCapabilities for more details.)

pRunAllProcessors :: Depth -> [Test] -> IO ()Source

Variant of pRun. Run a list of QuickCheck properties in parallel chunks, using all Processors.

pRunWithNum :: Int -> Depth -> [Test] -> IO ()Source

Variant of pRun. Run a list of QuickCheck properties in parallel chunks, using n Haskell threads (first argument), and test to a depth of d (second argument). Compile your application with '-threaded' and run with the SMP runtime's '-N4' (or however many OS threads you want to donate), for best results.

 import Test.QuickCheck.Parallel

 do n <- getArgs >>= readIO . head
    pRunWithNum n 1000 [ ("sort1", pDet prop_sort1) ]

Will run n threads over the property list, to depth 1000.

If you want to specify n by using '-N[n]' or setNumCapabilities, use pRun instead of this function.

type Name = StringSource

A name or description for test

type Depth = IntSource

Maximum number of successful test values

type Test = (Name, Depth -> IO Result)Source

Test case for parallel batch driver

pDet :: Testable a => a -> Depth -> IO ResultSource

Wrap a property, and run it on a deterministic set of data

pNon :: Testable a => a -> Depth -> IO ResultSource

Wrap a property, and run it on a non-deterministic set of data