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