summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
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()