]> granicus.if.org Git - icinga2/blob - test/CMakeLists.txt
Merge pull request #6662 from Icinga/bugfix/keep-http-connection-open-until-stream-eof
[icinga2] / test / CMakeLists.txt
1 # Icinga 2
2 # Copyright (C) 2012-2018 Icinga Development Team (https://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-object-packer.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   ${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/unique
67     base_array/foreach
68     base_array/clone
69     base_array/json
70     base_base64/base64
71     base_convert/tolong
72     base_convert/todouble
73     base_convert/tostring
74     base_convert/tobool
75     base_dictionary/construct
76     base_dictionary/get1
77     base_dictionary/get2
78     base_dictionary/foreach
79     base_dictionary/remove
80     base_dictionary/clone
81     base_dictionary/json
82     base_fifo/construct
83     base_fifo/io
84     base_json/invalid1
85     base_object_packer/pack_null
86     base_object_packer/pack_false
87     base_object_packer/pack_true
88     base_object_packer/pack_number
89     base_object_packer/pack_string
90     base_object_packer/pack_array
91     base_object_packer/pack_object
92     base_match/tolong
93     base_netstring/netstring
94     base_object/construct
95     base_object/getself
96     base_serialize/scalar
97     base_serialize/array
98     base_serialize/dictionary
99     base_serialize/object
100     base_shellescape/escape_basic
101     base_shellescape/escape_quoted
102     base_stacktrace/stacktrace
103     base_stream/readline_stdio
104     base_string/construct
105     base_string/equal
106     base_string/clear
107     base_string/append
108     base_string/trim
109     base_string/contains
110     base_string/replace
111     base_string/index
112     base_string/find
113     base_timer/construct
114     base_timer/interval
115     base_timer/invoke
116     base_timer/scope
117     base_type/gettype
118     base_type/assign
119     base_type/byname
120     base_type/instantiate
121     base_value/scalar
122     base_value/convert
123     base_value/format
124     config_ops/simple
125     config_ops/advanced
126     icinga_checkresult/host_1attempt
127     icinga_checkresult/host_2attempts
128     icinga_checkresult/host_3attempts
129     icinga_checkresult/service_1attempt
130     icinga_checkresult/service_2attempts
131     icinga_checkresult/service_3attempts
132     icinga_checkresult/host_flapping_notification
133     icinga_checkresult/service_flapping_notification
134     icinga_notification/state_filter
135     icinga_notification/type_filter
136     icinga_macros/simple
137     icinga_legacytimeperiod/simple
138     icinga_perfdata/empty
139     icinga_perfdata/simple
140     icinga_perfdata/quotes
141     icinga_perfdata/multiple
142     icinga_perfdata/uom
143     icinga_perfdata/warncritminmax
144     icinga_perfdata/ignore_invalid_warn_crit_min_max
145     icinga_perfdata/invalid
146     icinga_perfdata/multi
147     remote_url/id_and_path
148     remote_url/parameters
149     remote_url/get_and_set
150     remote_url/format
151     remote_url/illegal_legal_strings
152 )
153
154 if(ICINGA2_WITH_LIVESTATUS)
155   set(livestatus_test_SOURCES
156     icingaapplication-fixture.cpp
157     livestatus-fixture.cpp
158     livestatus.cpp
159     ${base_OBJS}
160     $<TARGET_OBJECTS:config>
161     $<TARGET_OBJECTS:remote>
162     $<TARGET_OBJECTS:icinga>
163     $<TARGET_OBJECTS:livestatus>
164     $<TARGET_OBJECTS:methods>
165   )
166
167   if(ICINGA2_UNITY_BUILD)
168       mkunity_target(livestatus test livestatus_test_SOURCES)
169   endif()
170
171   add_boost_test(livestatus
172     SOURCES test-runner.cpp ${livestatus_test_SOURCES}
173     LIBRARIES ${base_DEPS}
174     TESTS livestatus/hosts livestatus/services
175   )
176 endif()
177
178 set(icinga_checkable_test_SOURCES
179   icingaapplication-fixture.cpp
180   icinga-checkable-fixture.cpp
181   icinga-checkable-flapping.cpp
182   ${base_OBJS}
183   $<TARGET_OBJECTS:config>
184   $<TARGET_OBJECTS:remote>
185   $<TARGET_OBJECTS:icinga>
186   $<TARGET_OBJECTS:cli>
187 )
188
189 if(ICINGA2_UNITY_BUILD)
190     mkunity_target(icinga_checkable test icinga_checkable_test_SOURCES)
191 endif()
192
193 add_boost_test(icinga_checkable
194   SOURCES test-runner.cpp ${icinga_checkable_test_SOURCES}
195   LIBRARIES ${base_DEPS}
196   TESTS icinga_checkable_flapping/host_not_flapping
197         icinga_checkable_flapping/host_flapping
198         icinga_checkable_flapping/host_flapping_recover
199         icinga_checkable_flapping/host_flapping_docs_example
200 )