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