root / htest / test.hs @ a52f8e72
History | View | Annotate | Download (3.2 kB)
1 | 525bfb36 | Iustin Pop | {-| Unittest runner for ganeti-htools. |
---|---|---|---|
2 | 15f4c8ca | Iustin Pop | |
3 | 15f4c8ca | Iustin Pop | -} |
4 | 15f4c8ca | Iustin Pop | |
5 | e2fa2baf | Iustin Pop | {- |
6 | e2fa2baf | Iustin Pop | |
7 | e1dde6ad | Iustin Pop | Copyright (C) 2009, 2011, 2012 Google Inc. |
8 | e2fa2baf | Iustin Pop | |
9 | e2fa2baf | Iustin Pop | This program is free software; you can redistribute it and/or modify |
10 | e2fa2baf | Iustin Pop | it under the terms of the GNU General Public License as published by |
11 | e2fa2baf | Iustin Pop | the Free Software Foundation; either version 2 of the License, or |
12 | e2fa2baf | Iustin Pop | (at your option) any later version. |
13 | e2fa2baf | Iustin Pop | |
14 | e2fa2baf | Iustin Pop | This program is distributed in the hope that it will be useful, but |
15 | e2fa2baf | Iustin Pop | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | e2fa2baf | Iustin Pop | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
17 | e2fa2baf | Iustin Pop | General Public License for more details. |
18 | e2fa2baf | Iustin Pop | |
19 | e2fa2baf | Iustin Pop | You should have received a copy of the GNU General Public License |
20 | e2fa2baf | Iustin Pop | along with this program; if not, write to the Free Software |
21 | e2fa2baf | Iustin Pop | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
22 | e2fa2baf | Iustin Pop | 02110-1301, USA. |
23 | e2fa2baf | Iustin Pop | |
24 | e2fa2baf | Iustin Pop | -} |
25 | e2fa2baf | Iustin Pop | |
26 | 15f4c8ca | Iustin Pop | module Main(main) where |
27 | 15f4c8ca | Iustin Pop | |
28 | 95f6c931 | Iustin Pop | import Data.Monoid (mappend) |
29 | 95f6c931 | Iustin Pop | import Test.Framework |
30 | 7345b69b | Iustin Pop | import System.Environment (getArgs) |
31 | 38f536cb | Iustin Pop | |
32 | b88fcdd0 | Iustin Pop | import Test.Ganeti.TestImports () |
33 | 43b3b5c1 | Michele Tartara | import Test.Ganeti.Attoparsec |
34 | 1493a93b | Iustin Pop | import Test.Ganeti.BasicTypes |
35 | a52f8e72 | Michele Tartara | import Test.Ganeti.Block.Drbd.Parser |
36 | 51000365 | Iustin Pop | import Test.Ganeti.Common |
37 | f51eacf3 | Iustin Pop | import Test.Ganeti.Confd.Utils |
38 | 51000365 | Iustin Pop | import Test.Ganeti.Daemon |
39 | ef3ad027 | Iustin Pop | import Test.Ganeti.Errors |
40 | 879d9290 | Iustin Pop | import Test.Ganeti.HTools.Backend.Simu |
41 | 879d9290 | Iustin Pop | import Test.Ganeti.HTools.Backend.Text |
42 | e1ee7d5a | Iustin Pop | import Test.Ganeti.HTools.CLI |
43 | e1ee7d5a | Iustin Pop | import Test.Ganeti.HTools.Cluster |
44 | e1ee7d5a | Iustin Pop | import Test.Ganeti.HTools.Container |
45 | e1ee7d5a | Iustin Pop | import Test.Ganeti.HTools.Instance |
46 | f51eacf3 | Iustin Pop | import Test.Ganeti.HTools.Loader |
47 | e1ee7d5a | Iustin Pop | import Test.Ganeti.HTools.Node |
48 | e1ee7d5a | Iustin Pop | import Test.Ganeti.HTools.PeerMap |
49 | e1ee7d5a | Iustin Pop | import Test.Ganeti.HTools.Types |
50 | 2d87bd0a | Iustin Pop | import Test.Ganeti.JSON |
51 | f51eacf3 | Iustin Pop | import Test.Ganeti.Jobs |
52 | aed2325f | Iustin Pop | import Test.Ganeti.Luxi |
53 | e5a29b6c | Iustin Pop | import Test.Ganeti.Objects |
54 | aed2325f | Iustin Pop | import Test.Ganeti.OpCodes |
55 | 90171729 | Iustin Pop | import Test.Ganeti.Query.Filter |
56 | aed2325f | Iustin Pop | import Test.Ganeti.Query.Language |
57 | b9bdc10e | Iustin Pop | import Test.Ganeti.Query.Query |
58 | 305e174c | Iustin Pop | import Test.Ganeti.Rpc |
59 | aed2325f | Iustin Pop | import Test.Ganeti.Ssconf |
60 | f51eacf3 | Iustin Pop | import Test.Ganeti.THH |
61 | 5e9deac0 | Iustin Pop | import Test.Ganeti.Types |
62 | 26d62e4c | Iustin Pop | import Test.Ganeti.Utils |
63 | 509809db | Iustin Pop | |
64 | 95f6c931 | Iustin Pop | -- | Our default test options, overring the built-in test-framework |
65 | 44be51aa | Iustin Pop | -- ones (but not the supplied command line parameters). |
66 | 44be51aa | Iustin Pop | defOpts :: TestOptions |
67 | 44be51aa | Iustin Pop | defOpts = TestOptions |
68 | 95f6c931 | Iustin Pop | { topt_seed = Nothing |
69 | 95f6c931 | Iustin Pop | , topt_maximum_generated_tests = Just 500 |
70 | 95f6c931 | Iustin Pop | , topt_maximum_unsuitable_generated_tests = Just 5000 |
71 | 95f6c931 | Iustin Pop | , topt_maximum_test_size = Nothing |
72 | 95f6c931 | Iustin Pop | , topt_maximum_test_depth = Nothing |
73 | 95f6c931 | Iustin Pop | , topt_timeout = Nothing |
74 | 8e4f6d56 | Iustin Pop | } |
75 | 15f4c8ca | Iustin Pop | |
76 | 95f6c931 | Iustin Pop | -- | All our defined tests. |
77 | f842aecd | Iustin Pop | allTests :: [Test] |
78 | 06fe0cea | Iustin Pop | allTests = |
79 | 44be51aa | Iustin Pop | [ testBasicTypes |
80 | 43b3b5c1 | Michele Tartara | , testAttoparsec |
81 | 44be51aa | Iustin Pop | , testCommon |
82 | 44be51aa | Iustin Pop | , testConfd_Utils |
83 | 44be51aa | Iustin Pop | , testDaemon |
84 | a52f8e72 | Michele Tartara | , testBlock_DRBDParser |
85 | ef3ad027 | Iustin Pop | , testErrors |
86 | 879d9290 | Iustin Pop | , testHTools_Backend_Simu |
87 | 879d9290 | Iustin Pop | , testHTools_Backend_Text |
88 | 44be51aa | Iustin Pop | , testHTools_CLI |
89 | 44be51aa | Iustin Pop | , testHTools_Cluster |
90 | 44be51aa | Iustin Pop | , testHTools_Container |
91 | 44be51aa | Iustin Pop | , testHTools_Instance |
92 | 44be51aa | Iustin Pop | , testHTools_Loader |
93 | 44be51aa | Iustin Pop | , testHTools_Node |
94 | 44be51aa | Iustin Pop | , testHTools_PeerMap |
95 | 44be51aa | Iustin Pop | , testHTools_Types |
96 | 44be51aa | Iustin Pop | , testJSON |
97 | 44be51aa | Iustin Pop | , testJobs |
98 | 44be51aa | Iustin Pop | , testLuxi |
99 | 44be51aa | Iustin Pop | , testObjects |
100 | 44be51aa | Iustin Pop | , testOpCodes |
101 | 44be51aa | Iustin Pop | , testQuery_Filter |
102 | 44be51aa | Iustin Pop | , testQuery_Language |
103 | 44be51aa | Iustin Pop | , testQuery_Query |
104 | 44be51aa | Iustin Pop | , testRpc |
105 | 44be51aa | Iustin Pop | , testSsconf |
106 | f51eacf3 | Iustin Pop | , testTHH |
107 | 5e9deac0 | Iustin Pop | , testTypes |
108 | 26d62e4c | Iustin Pop | , testUtils |
109 | 06fe0cea | Iustin Pop | ] |
110 | 06fe0cea | Iustin Pop | |
111 | 95f6c931 | Iustin Pop | -- | Main function. Note we don't use defaultMain since we want to |
112 | 95f6c931 | Iustin Pop | -- control explicitly our test sizes (and override the default). |
113 | 38f536cb | Iustin Pop | main :: IO () |
114 | 15f4c8ca | Iustin Pop | main = do |
115 | 95f6c931 | Iustin Pop | ropts <- getArgs >>= interpretArgsOrExit |
116 | 44be51aa | Iustin Pop | let opts = maybe defOpts (defOpts `mappend`) $ ropt_test_options ropts |
117 | f842aecd | Iustin Pop | defaultMainWithOpts allTests (ropts { ropt_test_options = Just opts }) |