]> granicus.if.org Git - icinga2/blob - test/CMakeLists.txt
Add more unit tests
[icinga2] / test / CMakeLists.txt
1 # Icinga 2
2 # Copyright (C) 2012-2016 Icinga Development Team (https://www.icinga.org/)
3 #
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software Foundation
16 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
17
18 include(BoostTestTargets)
19
20 set(base_test_SOURCES
21   base-array.cpp base-convert.cpp base-dictionary.cpp base-fifo.cpp
22   base-json.cpp base-match.cpp base-netstring.cpp base-object.cpp
23   base-serialize.cpp base-shellescape.cpp base-stacktrace.cpp
24   base-stream.cpp base-string.cpp base-timer.cpp base-type.cpp
25   base-value.cpp config-ops.cpp icinga-checkresult.cpp icinga-macros.cpp
26   icinga-perfdata.cpp remote-base64.cpp remote-url.cpp
27 )
28
29 if(ICINGA2_UNITY_BUILD)
30     mkunity_target(base test base_test_SOURCES)
31 endif()
32
33 add_boost_test(base
34   SOURCES base-test.cpp ${base_test_SOURCES}
35   LIBRARIES base config icinga
36   TESTS base_array/construct
37         base_array/getset
38         base_array/resize
39         base_array/insert
40         base_array/remove
41         base_array/foreach
42         base_array/clone
43         base_array/json
44         base_convert/tolong
45         base_convert/todouble
46         base_convert/tostring
47         base_convert/tobool
48         base_dictionary/construct
49         base_dictionary/get1
50         base_dictionary/get2
51         base_dictionary/foreach
52         base_dictionary/remove
53         base_dictionary/clone
54         base_dictionary/json
55         base_fifo/construct
56         base_fifo/io
57         base_json/invalid1
58         base_match/tolong
59         base_netstring/netstring
60         base_object/construct
61         base_object/getself
62         base_serialize/scalar
63         base_serialize/array
64         base_serialize/dictionary
65         base_serialize/object
66         base_shellescape/escape_basic
67         base_shellescape/escape_quoted
68         base_stacktrace/stacktrace
69         base_stream/readline_stdio
70         base_string/construct
71         base_string/equal
72         base_string/clear
73         base_string/append
74         base_string/trim
75         base_string/contains
76         base_string/replace
77         base_string/index
78         base_string/find
79         base_timer/construct
80         base_timer/interval
81         base_timer/invoke
82         base_timer/scope
83         base_type/gettype
84         base_type/assign
85         base_type/byname
86         base_type/instantiate
87         base_value/scalar
88         base_value/convert
89         base_value/format
90         config_ops/simple
91         config_ops/advanced
92         icinga_checkresult/host_1attempt
93         icinga_checkresult/host_2attempts
94         icinga_checkresult/host_3attempts
95         icinga_checkresult/service_1attempt
96         icinga_checkresult/service_2attempts
97         icinga_checkresult/service_3attempts
98         icinga_macros/simple
99         icinga_perfdata/empty
100         icinga_perfdata/simple
101         icinga_perfdata/quotes
102         icinga_perfdata/multiple
103         icinga_perfdata/uom
104         icinga_perfdata/warncritminmax
105         icinga_perfdata/ignore_invalid_warn_crit_min_max
106         icinga_perfdata/invalid
107         icinga_perfdata/multi
108         remote_base64/base64
109         remote_url/id_and_path
110         remote_url/parameters
111         remote_url/get_and_set
112         remote_url/format
113         remote_url/illegal_legal_strings
114 )
115
116 if(ICINGA2_WITH_LIVESTATUS)
117   set(livestatus_test_SOURCES
118     livestatus.cpp
119   )
120
121   if(ICINGA2_UNITY_BUILD)
122       mkunity_target(livestatus test livestatus_test_SOURCES)
123   endif()
124
125   add_boost_test(livestatus
126     SOURCES livestatus-test.cpp ${livestatus_test_SOURCES}
127     LIBRARIES base config icinga livestatus
128     DEPENDENCIES methods
129     TESTS livestatus/hosts livestatus/services
130   )
131 endif()