Statistics
| Branch: | Tag: | Revision:

root / htest / test.hs @ ef3ad027

History | View | Annotate | Download (3 kB)

1
{-| Unittest runner for ganeti-htools.
2

    
3
-}
4

    
5
{-
6

    
7
Copyright (C) 2009, 2011, 2012 Google Inc.
8

    
9
This program is free software; you can redistribute it and/or modify
10
it under the terms of the GNU General Public License as published by
11
the Free Software Foundation; either version 2 of the License, or
12
(at your option) any later version.
13

    
14
This program is distributed in the hope that it will be useful, but
15
WITHOUT ANY WARRANTY; without even the implied warranty of
16
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17
General Public License for more details.
18

    
19
You should have received a copy of the GNU General Public License
20
along with this program; if not, write to the Free Software
21
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
22
02110-1301, USA.
23

    
24
-}
25

    
26
module Main(main) where
27

    
28
import Data.Monoid (mappend)
29
import Test.Framework
30
import System.Environment (getArgs)
31

    
32
import Test.Ganeti.TestImports ()
33
import Test.Ganeti.BasicTypes
34
import Test.Ganeti.Confd.Utils
35
import Test.Ganeti.Common
36
import Test.Ganeti.Daemon
37
import Test.Ganeti.Errors
38
import Test.Ganeti.HTools.CLI
39
import Test.Ganeti.HTools.Cluster
40
import Test.Ganeti.HTools.Container
41
import Test.Ganeti.HTools.Loader
42
import Test.Ganeti.HTools.Instance
43
import Test.Ganeti.HTools.Node
44
import Test.Ganeti.HTools.PeerMap
45
import Test.Ganeti.HTools.Simu
46
import Test.Ganeti.HTools.Text
47
import Test.Ganeti.HTools.Types
48
import Test.Ganeti.Jobs
49
import Test.Ganeti.JSON
50
import Test.Ganeti.Luxi
51
import Test.Ganeti.Objects
52
import Test.Ganeti.OpCodes
53
import Test.Ganeti.Query.Filter
54
import Test.Ganeti.Query.Language
55
import Test.Ganeti.Query.Query
56
import Test.Ganeti.Rpc
57
import Test.Ganeti.Ssconf
58
import Test.Ganeti.Utils
59

    
60
-- | Our default test options, overring the built-in test-framework
61
-- ones (but not the supplied command line parameters).
62
defOpts :: TestOptions
63
defOpts = TestOptions
64
       { topt_seed                               = Nothing
65
       , topt_maximum_generated_tests            = Just 500
66
       , topt_maximum_unsuitable_generated_tests = Just 5000
67
       , topt_maximum_test_size                  = Nothing
68
       , topt_maximum_test_depth                 = Nothing
69
       , topt_timeout                            = Nothing
70
       }
71

    
72
-- | All our defined tests.
73
allTests :: [Test]
74
allTests =
75
  [ testBasicTypes
76
  , testCommon
77
  , testConfd_Utils
78
  , testDaemon
79
  , testErrors
80
  , testHTools_CLI
81
  , testHTools_Cluster
82
  , testHTools_Container
83
  , testHTools_Instance
84
  , testHTools_Loader
85
  , testHTools_Node
86
  , testHTools_PeerMap
87
  , testHTools_Simu
88
  , testHTools_Text
89
  , testHTools_Types
90
  , testJSON
91
  , testJobs
92
  , testLuxi
93
  , testObjects
94
  , testOpCodes
95
  , testQuery_Filter
96
  , testQuery_Language
97
  , testQuery_Query
98
  , testRpc
99
  , testSsconf
100
  , testUtils
101
  ]
102

    
103
-- | Main function. Note we don't use defaultMain since we want to
104
-- control explicitly our test sizes (and override the default).
105
main :: IO ()
106
main = do
107
  ropts <- getArgs >>= interpretArgsOrExit
108
  let opts = maybe defOpts (defOpts `mappend`) $ ropt_test_options ropts
109
  defaultMainWithOpts allTests (ropts { ropt_test_options = Just opts })