]> granicus.if.org Git - icinga2/blobdiff - test/CMakeLists.txt
Merge pull request #6602 from Icinga/fix/improve-tls-handshake-exception-logging
[icinga2] / test / CMakeLists.txt
index 5a36e892d72457c187fc40b4a9ee00da29e13863..df291e6dc1ddc813a95ebba72e8b84e8fd5a6adb 100644 (file)
@@ -1,5 +1,5 @@
 # Icinga 2
-# Copyright (C) 2012-2016 Icinga Development Team (https://www.icinga.org/)
+# Copyright (C) 2012-2018 Icinga Development Team (https://www.icinga.com/)
 #
 # This program is free software; you can redistribute it and/or
 # modify it under the terms of the GNU General Public License
 # along with this program; if not, write to the Free Software Foundation
 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
 
-set(Boost_USE_STATIC_LIBS OFF)
-
 include(BoostTestTargets)
 
 set(base_test_SOURCES
-  base-array.cpp base-convert.cpp base-dictionary.cpp base-fifo.cpp
-  base-json.cpp base-match.cpp base-netstring.cpp base-object.cpp
-  base-serialize.cpp base-shellescape.cpp base-stacktrace.cpp
-  base-stream.cpp base-string.cpp base-timer.cpp base-type.cpp
-  base-value.cpp config-ops.cpp icinga-checkresult.cpp icinga-macros.cpp
-  icinga-perfdata.cpp remote-base64.cpp remote-url.cpp
+  icingaapplication-fixture.cpp
+  base-array.cpp
+  base-base64.cpp
+  base-convert.cpp
+  base-dictionary.cpp
+  base-fifo.cpp
+  base-json.cpp
+  base-match.cpp
+  base-netstring.cpp
+  base-object.cpp
+  base-object-packer.cpp
+  base-serialize.cpp
+  base-shellescape.cpp
+  base-stacktrace.cpp
+  base-stream.cpp
+  base-string.cpp
+  base-timer.cpp
+  base-type.cpp
+  base-value.cpp
+  config-ops.cpp
+  icinga-checkresult.cpp
+  icinga-legacytimeperiod.cpp
+  icinga-macros.cpp
+  icinga-notification.cpp
+  icinga-perfdata.cpp
+  remote-url.cpp
+  ${base_OBJS}
+  $<TARGET_OBJECTS:config>
+  $<TARGET_OBJECTS:remote>
+  $<TARGET_OBJECTS:icinga>
 )
 
 if(ICINGA2_UNITY_BUILD)
-    mkunity_target(base test base_test_SOURCES)
+  mkunity_target(base test base_test_SOURCES)
 endif()
 
 add_boost_test(base
   SOURCES test-runner.cpp ${base_test_SOURCES}
-  LIBRARIES base config icinga
-  TESTS base_array/construct
-        base_array/getset
-        base_array/resize
-        base_array/insert
-        base_array/remove
-        base_array/foreach
-        base_array/clone
-        base_array/json
-        base_convert/tolong
-        base_convert/todouble
-        base_convert/tostring
-        base_convert/tobool
-        base_dictionary/construct
-        base_dictionary/get1
-        base_dictionary/get2
-        base_dictionary/foreach
-        base_dictionary/remove
-        base_dictionary/clone
-        base_dictionary/json
-        base_fifo/construct
-        base_fifo/io
-        base_json/invalid1
-        base_match/tolong
-        base_netstring/netstring
-        base_object/construct
-        base_object/getself
-        base_serialize/scalar
-        base_serialize/array
-        base_serialize/dictionary
-        base_serialize/object
-        base_shellescape/escape_basic
-        base_shellescape/escape_quoted
-        base_stacktrace/stacktrace
-        base_stream/readline_stdio
-        base_string/construct
-        base_string/equal
-        base_string/clear
-        base_string/append
-        base_string/trim
-        base_string/contains
-        base_string/replace
-        base_string/index
-        base_string/find
-        base_timer/construct
-        base_timer/interval
-        base_timer/invoke
-        base_timer/scope
-        base_type/gettype
-        base_type/assign
-        base_type/byname
-        base_type/instantiate
-        base_value/scalar
-        base_value/convert
-        base_value/format
-        config_ops/simple
-        config_ops/advanced
-        icinga_checkresult/host_1attempt
-        icinga_checkresult/host_2attempts
-        icinga_checkresult/host_3attempts
-        icinga_checkresult/service_1attempt
-        icinga_checkresult/service_2attempts
-        icinga_checkresult/service_3attempts
-       icinga_checkresult/host_flapping_notification
-       icinga_checkresult/service_flapping_notification
-        icinga_macros/simple
-        icinga_perfdata/empty
-        icinga_perfdata/simple
-        icinga_perfdata/quotes
-        icinga_perfdata/multiple
-        icinga_perfdata/uom
-        icinga_perfdata/warncritminmax
-        icinga_perfdata/ignore_invalid_warn_crit_min_max
-        icinga_perfdata/invalid
-        icinga_perfdata/multi
-        remote_base64/base64
-        remote_url/id_and_path
-        remote_url/parameters
-        remote_url/get_and_set
-        remote_url/format
-        remote_url/illegal_legal_strings
+  LIBRARIES ${base_DEPS}
+  TESTS
+    base_array/construct
+    base_array/getset
+    base_array/resize
+    base_array/insert
+    base_array/remove
+    base_array/unique
+    base_array/foreach
+    base_array/clone
+    base_array/json
+    base_base64/base64
+    base_convert/tolong
+    base_convert/todouble
+    base_convert/tostring
+    base_convert/tobool
+    base_dictionary/construct
+    base_dictionary/get1
+    base_dictionary/get2
+    base_dictionary/foreach
+    base_dictionary/remove
+    base_dictionary/clone
+    base_dictionary/json
+    base_fifo/construct
+    base_fifo/io
+    base_json/invalid1
+    base_object_packer/pack_null
+    base_object_packer/pack_false
+    base_object_packer/pack_true
+    base_object_packer/pack_number
+    base_object_packer/pack_string
+    base_object_packer/pack_array
+    base_object_packer/pack_object
+    base_match/tolong
+    base_netstring/netstring
+    base_object/construct
+    base_object/getself
+    base_serialize/scalar
+    base_serialize/array
+    base_serialize/dictionary
+    base_serialize/object
+    base_shellescape/escape_basic
+    base_shellescape/escape_quoted
+    base_stacktrace/stacktrace
+    base_stream/readline_stdio
+    base_string/construct
+    base_string/equal
+    base_string/clear
+    base_string/append
+    base_string/trim
+    base_string/contains
+    base_string/replace
+    base_string/index
+    base_string/find
+    base_timer/construct
+    base_timer/interval
+    base_timer/invoke
+    base_timer/scope
+    base_type/gettype
+    base_type/assign
+    base_type/byname
+    base_type/instantiate
+    base_value/scalar
+    base_value/convert
+    base_value/format
+    config_ops/simple
+    config_ops/advanced
+    icinga_checkresult/host_1attempt
+    icinga_checkresult/host_2attempts
+    icinga_checkresult/host_3attempts
+    icinga_checkresult/service_1attempt
+    icinga_checkresult/service_2attempts
+    icinga_checkresult/service_3attempts
+    icinga_checkresult/host_flapping_notification
+    icinga_checkresult/service_flapping_notification
+    icinga_notification/state_filter
+    icinga_notification/type_filter
+    icinga_macros/simple
+    icinga_legacytimeperiod/simple
+    icinga_perfdata/empty
+    icinga_perfdata/simple
+    icinga_perfdata/quotes
+    icinga_perfdata/multiple
+    icinga_perfdata/uom
+    icinga_perfdata/warncritminmax
+    icinga_perfdata/ignore_invalid_warn_crit_min_max
+    icinga_perfdata/invalid
+    icinga_perfdata/multi
+    remote_url/id_and_path
+    remote_url/parameters
+    remote_url/get_and_set
+    remote_url/format
+    remote_url/illegal_legal_strings
 )
 
 if(ICINGA2_WITH_LIVESTATUS)
   set(livestatus_test_SOURCES
+    icingaapplication-fixture.cpp
+    livestatus-fixture.cpp
     livestatus.cpp
+    ${base_OBJS}
+    $<TARGET_OBJECTS:config>
+    $<TARGET_OBJECTS:remote>
+    $<TARGET_OBJECTS:icinga>
+    $<TARGET_OBJECTS:livestatus>
+    $<TARGET_OBJECTS:methods>
   )
 
   if(ICINGA2_UNITY_BUILD)
@@ -127,9 +169,32 @@ if(ICINGA2_WITH_LIVESTATUS)
   endif()
 
   add_boost_test(livestatus
-    SOURCES test-runner.cpp livestatus-fixture.cpp ${livestatus_test_SOURCES}
-    LIBRARIES base config icinga livestatus
-    DEPENDENCIES methods
+    SOURCES test-runner.cpp ${livestatus_test_SOURCES}
+    LIBRARIES ${base_DEPS}
     TESTS livestatus/hosts livestatus/services
   )
 endif()
+
+set(icinga_checkable_test_SOURCES
+  icingaapplication-fixture.cpp
+  icinga-checkable-fixture.cpp
+  icinga-checkable-flapping.cpp
+  ${base_OBJS}
+  $<TARGET_OBJECTS:config>
+  $<TARGET_OBJECTS:remote>
+  $<TARGET_OBJECTS:icinga>
+  $<TARGET_OBJECTS:cli>
+)
+
+if(ICINGA2_UNITY_BUILD)
+    mkunity_target(icinga_checkable test icinga_checkable_test_SOURCES)
+endif()
+
+add_boost_test(icinga_checkable
+  SOURCES test-runner.cpp ${icinga_checkable_test_SOURCES}
+  LIBRARIES ${base_DEPS}
+  TESTS icinga_checkable_flapping/host_not_flapping
+        icinga_checkable_flapping/host_flapping
+        icinga_checkable_flapping/host_flapping_recover
+        icinga_checkable_flapping/host_flapping_docs_example
+)