packages feed

pqc 0.6 → 0.7

raw patch · 3 files changed

+27/−23 lines, 3 files

Files

Test/QuickCheck/Parallel.hs view
@@ -58,26 +58,25 @@ -- | Test case for parallel batch driver type Test   = (Name, Depth -> IO Result) --- | Deprecated: Backwards-compatible API-{-# DEPRECATED pRun "use pRun' or pRunAllProcessors, pRunWithNum instead." #-}-pRun :: Int -> Depth -> [Test] -> IO ()-pRun = pRunWithNum---- | Variant of 'pRunWithNum'. Run a list of QuickCheck properties in parallel--- chunks, using number of Haskell threads that can run truly simultaneously--- (on separate physical processors) at any given time. For example, +-- | 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.)+-- with SMP runtime's '-N[n]' flag will run 'n' threads over the property+-- list, to depth 1000. (see 'getNumCapabilities' for more details.) ---pRun'  :: Depth -> [Test] -> IO ()-pRun' depth tests = do+pRun :: Depth -> [Test] -> IO ()+pRun depth tests = do #if __GLASGOW_HASKELL__ >= 704     num <- getNumCapabilities #else@@ -85,7 +84,12 @@ #endif     pRunWithNum num depth tests --- | Variant of 'pRunWithNum'. Run a list of QuickCheck properties in parallel+-- | Deprecated: Backwards-compatible API+{-# DEPRECATED pRun' "use pRun instead." #-}+pRun'  :: Depth -> [Test] -> IO ()+pRun' = pRun++-- | Variant of 'pRun'. Run a list of QuickCheck properties in parallel -- chunks, using all Processors. pRunAllProcessors  :: Depth -> [Test] -> IO () #if   __GLASGOW_HASKELL__ < 704@@ -100,11 +104,11 @@     pRunInternal forkOn pros depth tests #endif --- | 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.+-- | 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 -- >@@ -113,10 +117,10 @@ -- -- Will run 'n' threads over the property list, to depth 1000. ----- If you want to specify 'n' by using '-N[n]', use 'pRun'' instead of--- this function.+-- If you want to specify 'n' by using '-N[n]' or 'setNumCapabilities',+-- use 'pRun' instead of this function. ---pRunWithNum :: Int -> Int -> [Test] -> IO ()+pRunWithNum :: Int -> Depth -> [Test] -> IO () pRunWithNum = pRunInternal (\_ -> forkIO)  pRunInternal :: (Int -> IO () -> IO ThreadId) -> Int -> Int -> [Test] -> IO ()
examples/Example.hs view
@@ -55,7 +55,7 @@ -- Run in x threads (that is specified by +RTS -Nx), to depth of 1000 -- main = do-    pRun'  1000 $ take 100 $ cycle+    pRun 1000 $ take 100 $ cycle         [ ("sort1", pDet prop_sort1)         , ("sort2", pDet prop_sort2)         , ("sort3", pDet prop_sort3)
pqc.cabal view
@@ -1,5 +1,5 @@ name:                pqc-version:             0.6+version:             0.7 description:         Parallel batch driver for QuickCheck synopsis:            Parallel batch driver for QuickCheck category:            Testing