]> granicus.if.org Git - icinga2/blob - test/CMakeLists.txt
Fix dependencies for the unit tests
[icinga2] / test / CMakeLists.txt
1 # Icinga 2
2 # Copyright (C) 2012-2016 Icinga Development Team (https://www.icinga.org/)
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   base-array.cpp base-convert.cpp base-dictionary.cpp base-fifo.cpp
22   base-json.cpp base-match.cpp base-netstring.cpp base-object.cpp
23   base-serialize.cpp base-shellescape.cpp base-stacktrace.cpp
24   base-stream.cpp base-string.cpp base-timer.cpp base-type.cpp
25   base-value.cpp config-ops.cpp icinga-macros.cpp
26   icinga-perfdata.cpp base-test.cpp 
27   remote-base64.cpp remote-url.cpp
28 )
29
30 set(livestatus_test_SOURCES
31   livestatus.cpp
32   livestatus-test.cpp
33 )
34
35 set_property(SOURCE test.cpp PROPERTY EXCLUDE_UNITY_BUILD TRUE)
36
37 if(ICINGA2_UNITY_BUILD)
38     mkunity_target(test base_test_SOURCES)
39 endif()
40
41 add_boost_test(base
42   SOURCES base-test.cpp ${base_test_SOURCES}
43   LIBRARIES base config icinga
44   TESTS base_array/construct
45         base_array/getset
46         base_array/resize
47         base_array/insert
48         base_array/remove
49         base_array/foreach
50         base_array/clone
51         base_array/json
52         base_convert/tolong
53         base_convert/todouble
54         base_convert/tostring
55         base_convert/tobool
56         base_dictionary/construct
57         base_dictionary/get1
58         base_dictionary/get2
59         base_dictionary/foreach
60         base_dictionary/remove
61         base_dictionary/clone
62         base_dictionary/json
63         base_fifo/construct
64         base_fifo/io
65         base_json/invalid1
66         base_match/tolong
67         base_netstring/netstring
68         base_object/construct
69         base_object/getself
70         base_serialize/scalar
71         base_serialize/array
72         base_serialize/dictionary
73         base_serialize/object
74         base_shellescape/escape_basic
75         base_shellescape/escape_quoted
76         base_stacktrace/stacktrace
77         base_stream/readline_stdio
78         base_string/construct
79         base_string/equal
80         base_string/clear
81         base_string/append
82         base_string/trim
83         base_string/contains
84         base_string/replace
85         base_string/index
86         base_string/find
87         base_timer/construct
88         base_timer/interval
89         base_timer/invoke
90         base_timer/scope
91         base_type/gettype
92         base_type/assign
93         base_type/byname
94         base_type/instantiate
95         base_value/scalar
96         base_value/convert
97         base_value/format
98         config_ops/simple
99         config_ops/advanced
100         icinga_macros/simple
101         icinga_perfdata/empty
102         icinga_perfdata/simple
103         icinga_perfdata/quotes
104         icinga_perfdata/multiple
105         icinga_perfdata/uom
106         icinga_perfdata/warncritminmax
107         icinga_perfdata/ignore_invalid_warn_crit_min_max
108         icinga_perfdata/invalid
109         icinga_perfdata/multi
110         remote_base64/base64
111         remote_url/id_and_path
112         remote_url/parameters
113         remote_url/get_and_set
114         remote_url/format
115         remote_url/illegal_legal_strings
116 )
117
118 if(ICINGA2_WITH_LIVESTATUS)
119   add_boost_test(livestatus
120     SOURCES livestatus-test.cpp ${livestatus_test_SOURCES}
121     LIBRARIES base config icinga cli livestatus
122     DEPENDENCIES methods
123     TESTS livestatus/hosts livestatus/services
124   )
125 endif()