pqc |
Aboutpqc provides Test.QuickCheck.Parallel, a QuickCheck driver that runs jobs in parallel, and will utilise as many cores as you wish, with the SMP parallel GHC 6.6 runtime. It is simple, scalable replacement for Test.QuickCheck.Batch. An example: import Test.QuickCheck.Parallel import Data.List prop_sort1 xs = sort xs == sortBy compare xs where types = (xs :: [Int]) prop_sort2 xs = (not (null xs)) ==> (head (sort xs) == minimum xs) where types = (xs :: [Int]) main = do pRun 2 1000 [ ("sort1", pDet prop_sort1) , ("sort2", pDet prop_sort2) ] Run it with 1 OS thread:
$ time ./a.out +RTS -N1
2: sort2 : OK, 1000 tests.
1: sort1 : OK, 1000 tests.
./a.out +RTS -N1 0.41s user 0.00s system 97% cpu 0.427 total
Run it with on the SMP runtime with 2 OS threads (just change a command line flag!)
$ time ./a.out +RTS -N2
2: sort2 : OK, 1000 tests.
1: sort1 : OK, 1000 tests.
./a.out +RTS -N2 0.42s user 0.02s system 147% cpu 0.294 total
DocumentationDownloadSourceProject Activity
|