]> granicus.if.org Git - icinga2/blob - test/CMakeLists.txt
Merge pull request #5921 from widhalmt/feature/director-check-in-itl-5920
[icinga2] / test / CMakeLists.txt
1 # Icinga 2
2 # Copyright (C) 2012-2018 Icinga Development Team (https://www.icinga.com/)
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 set(Boost_USE_STATIC_LIBS OFF)
19
20 include(BoostTestTargets)
21
22 set(base_test_SOURCES
23   base-array.cpp
24   base-base64.cpp
25   base-convert.cpp
26   base-dictionary.cpp
27   base-fifo.cpp
28   base-json.cpp
29   base-match.cpp
30   base-netstring.cpp
31   base-object.cpp
32   base-serialize.cpp
33   base-shellescape.cpp
34   base-stacktrace.cpp
35   base-stream.cpp
36   base-string.cpp
37   base-timer.cpp
38   base-type.cpp
39   base-value.cpp
40   config-ops.cpp
41   icinga-checkresult.cpp
42   icinga-legacytimeperiod.cpp
43   icinga-macros.cpp
44   icinga-notification.cpp
45   icinga-perfdata.cpp
46   remote-url.cpp
47 )
48
49 if(ICINGA2_UNITY_BUILD)
50     mkunity_target(base test base_test_SOURCES)
51 endif()
52
53 add_boost_test(base
54   SOURCES test-runner.cpp ${base_test_SOURCES}
55   TESTS base_array/construct
56         base_array/getset
57         base_array/resize
58         base_array/insert
59         base_array/remove
60         base_array/foreach
61         base_array/clone
62         base_array/json
63         base_base64/base64
64         base_convert/tolong
65         base_convert/todouble
66         base_convert/tostring
67         base_convert/tobool
68         base_dictionary/construct
69         base_dictionary/get1
70         base_dictionary/get2
71         base_dictionary/foreach
72         base_dictionary/remove
73         base_dictionary/clone
74         base_dictionary/json
75         base_fifo/construct
76         base_fifo/io
77         base_json/invalid1
78         base_match/tolong
79         base_netstring/netstring
80         base_object/construct
81         base_object/getself
82         base_serialize/scalar
83         base_serialize/array
84         base_serialize/dictionary
85         base_serialize/object
86         base_shellescape/escape_basic
87         base_shellescape/escape_quoted
88         base_stacktrace/stacktrace
89         base_stream/readline_stdio
90         base_string/construct
91         base_string/equal
92         base_string/clear
93         base_string/append
94         base_string/trim
95         base_string/contains
96         base_string/replace
97         base_string/index
98         base_string/find
99         base_timer/construct
100         base_timer/interval
101         base_timer/invoke
102         base_timer/scope
103         base_type/gettype
104         base_type/assign
105         base_type/byname
106         base_type/instantiate
107         base_value/scalar
108         base_value/convert
109         base_value/format
110         config_ops/simple
111         config_ops/advanced
112         icinga_checkresult/host_1attempt
113         icinga_checkresult/host_2attempts
114         icinga_checkresult/host_3attempts
115         icinga_checkresult/service_1attempt
116         icinga_checkresult/service_2attempts
117         icinga_checkresult/service_3attempts
118         icinga_checkresult/host_flapping_notification
119         icinga_checkresult/service_flapping_notification
120         icinga_notification/state_filter
121         icinga_notification/type_filter
122         icinga_macros/simple
123         icinga_legacytimeperiod/simple
124         icinga_perfdata/empty
125         icinga_perfdata/simple
126         icinga_perfdata/quotes
127         icinga_perfdata/multiple
128         icinga_perfdata/uom
129         icinga_perfdata/warncritminmax
130         icinga_perfdata/ignore_invalid_warn_crit_min_max
131         icinga_perfdata/invalid
132         icinga_perfdata/multi
133         remote_url/id_and_path
134         remote_url/parameters
135         remote_url/get_and_set
136         remote_url/format
137         remote_url/illegal_legal_strings
138 )
139
140 add_whole_static_library(${base_TARGET_NAME} base)
141 add_whole_static_library(${base_TARGET_NAME} config)
142 add_whole_static_library(${base_TARGET_NAME} icinga)
143
144 if(ICINGA2_WITH_LIVESTATUS)
145   set(livestatus_test_SOURCES
146     livestatus-fixture.cpp
147     livestatus.cpp
148   )
149
150   if(ICINGA2_UNITY_BUILD)
151       mkunity_target(livestatus test livestatus_test_SOURCES)
152   endif()
153
154   add_boost_test(livestatus
155     SOURCES test-runner.cpp ${livestatus_test_SOURCES}
156     TESTS livestatus/hosts livestatus/services
157   )
158
159   add_whole_static_library(${livestatus_TARGET_NAME} base)
160   add_whole_static_library(${livestatus_TARGET_NAME} config)
161   add_whole_static_library(${livestatus_TARGET_NAME} icinga)
162   add_whole_static_library(${livestatus_TARGET_NAME} livestatus)
163   add_whole_static_library(${livestatus_TARGET_NAME} methods)
164 endif()
165
166 set(icinga_checkable_test_SOURCES
167   icinga-checkable-fixture.cpp
168   icinga-checkable-flapping.cpp
169 )
170
171 if(ICINGA2_UNITY_BUILD)
172     mkunity_target(icinga_checkable test icinga_checkable_test_SOURCES)
173 endif()
174
175 add_boost_test(icinga_checkable
176   SOURCES test-runner.cpp ${icinga_checkable_test_SOURCES}
177   TESTS icinga_checkable_flapping/host_not_flapping
178         icinga_checkable_flapping/host_flapping
179         icinga_checkable_flapping/host_flapping_recover
180         icinga_checkable_flapping/host_flapping_docs_example
181 )
182
183 add_whole_static_library(${icinga_checkable_TARGET_NAME} base)
184 add_whole_static_library(${icinga_checkable_TARGET_NAME} config)
185 add_whole_static_library(${icinga_checkable_TARGET_NAME} icinga)
186 add_whole_static_library(${icinga_checkable_TARGET_NAME} cli)