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