summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2019-10-26 08:29:37 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2019-10-26 08:29:53 +0000
commitd608b19e0d3b3f4d84fcfcdd72bb7e64c86b6f01 (patch)
tree8c283d1c81d718e64d87d9a2d1132c89f3915939 /CMakeLists.txt
parentReleasing debian version 1.18.0-1. (diff)
downloadnetdata-d608b19e0d3b3f4d84fcfcdd72bb7e64c86b6f01.tar.xz
netdata-d608b19e0d3b3f4d84fcfcdd72bb7e64c86b6f01.zip
Merging upstream version 1.18.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt23
1 files changed, 23 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 75a5427a3..857f5b9af 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -302,6 +302,7 @@ set(LIBNETDATA_FILES
libnetdata/inlined.h
libnetdata/libnetdata.c
libnetdata/libnetdata.h
+ libnetdata/required_dummies.h
libnetdata/locks/locks.c
libnetdata/locks/locks.h
libnetdata/log/log.c
@@ -876,3 +877,25 @@ IF(ENABLE_PLUGIN_CGROUP_NETWORK)
ELSE()
message(STATUS "cgroup-network: disabled (requires Linux)")
ENDIF()
+
+
+# -----------------------------------------------------------------------------
+# Unit tests
+
+if(UNIT_TESTING)
+ message(STATUS "Looking for CMocka which is required for unit testing")
+ find_package(CMocka REQUIRED)
+ include(CTest)
+
+if(BUILD_TESTING)
+ add_executable(str2ld_testdriver libnetdata/tests/test_str2ld.c)
+ target_link_libraries(str2ld_testdriver libnetdata ${NETDATA_COMMON_LIBRARIES} ${CMOCKA_LIBRARIES})
+ add_test(NAME test_str2ld COMMAND str2ld_testdriver)
+
+ add_executable(storage_number_testdriver libnetdata/storage_number/tests/test_storage_number.c)
+ target_link_libraries(storage_number_testdriver libnetdata ${NETDATA_COMMON_LIBRARIES} ${CMOCKA_LIBRARIES})
+ add_test(NAME test_storage_number COMMAND storage_number_testdriver)
+
+ set_target_properties(str2ld_testdriver storage_number_testdriver PROPERTIES RUNTIME_OUTPUT_DIRECTORY tests)
+endif()
+endif()