Revision 3fea6959 test.hs
b/test.hs | ||
---|---|---|
25 | 25 |
|
26 | 26 |
module Main(main) where |
27 | 27 |
|
28 |
import Control.Monad |
|
29 | 28 |
import Data.IORef |
30 | 29 |
import Test.QuickCheck.Batch |
31 | 30 |
import System.IO |
... | ... | |
33 | 32 |
|
34 | 33 |
import Ganeti.HTools.QC |
35 | 34 |
|
36 |
options :: TestOptions
|
|
37 |
options = TestOptions
|
|
38 |
{ no_of_tests = 500 |
|
39 |
, length_of_tests = 10 |
|
40 |
, debug_tests = False } |
|
35 |
fastOptions :: TestOptions
|
|
36 |
fastOptions = TestOptions
|
|
37 |
{ no_of_tests = 500
|
|
38 |
, length_of_tests = 10
|
|
39 |
, debug_tests = False }
|
|
41 | 40 |
|
41 |
slowOptions :: TestOptions |
|
42 |
slowOptions = TestOptions |
|
43 |
{ no_of_tests = 50 |
|
44 |
, length_of_tests = 100 |
|
45 |
, debug_tests = False } |
|
42 | 46 |
|
43 | 47 |
incIORef :: IORef Int -> IO () |
44 | 48 |
incIORef ir = atomicModifyIORef ir (\x -> (x + 1, ())) |
... | ... | |
59 | 63 |
main = do |
60 | 64 |
errs <- newIORef 0 |
61 | 65 |
let wrap = map (wrapTest errs) |
62 |
runTests "PeerMap" options $ wrap testPeerMap
|
|
63 |
runTests "Container" options $ wrap testContainer
|
|
64 |
runTests "Instance" options $ wrap testInstance
|
|
65 |
runTests "Node" options $ wrap testNode
|
|
66 |
runTests "Text" options $ wrap testText
|
|
67 |
runTests "Cluster" options $ wrap testCluster
|
|
66 |
runTests "PeerMap" fastOptions $ wrap testPeerMap
|
|
67 |
runTests "Container" fastOptions $ wrap testContainer
|
|
68 |
runTests "Instance" fastOptions $ wrap testInstance
|
|
69 |
runTests "Node" fastOptions $ wrap testNode
|
|
70 |
runTests "Text" fastOptions $ wrap testText
|
|
71 |
runTests "Cluster" slowOptions $ wrap testCluster
|
|
68 | 72 |
terr <- readIORef errs |
69 | 73 |
(if terr > 0 |
70 | 74 |
then do |
Also available in: Unified diff