summaryrefslogtreecommitdiff
path: root/cmake/tests.cmake
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri@ouroboros.rocks>2026-01-09 13:13:26 +0100
committerSander Vrijders <sander@ouroboros.rocks>2026-01-12 08:12:45 +0100
commit3f373b06b05083d9395250379a2978b5f6085002 (patch)
treec6edaa135feac5336ec0e6601772ad6f513c8a2f /cmake/tests.cmake
parent5b11550644b0ce7a79b967b6aabb1a59b86d5ca2 (diff)
downloadouroboros-3f373b06b05083d9395250379a2978b5f6085002.tar.gz
ouroboros-3f373b06b05083d9395250379a2978b5f6085002.zip
build: Add build target to generate coverage report
This adds a 'make coverage' option to conveniently summarize test coverage. If lcov is installed, it will also automatically generate the HTML summary. Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
Diffstat (limited to 'cmake/tests.cmake')
-rw-r--r--cmake/tests.cmake5
1 files changed, 5 insertions, 0 deletions
diff --git a/cmake/tests.cmake b/cmake/tests.cmake
index fb81c5f9..01dd2ecd 100644
--- a/cmake/tests.cmake
+++ b/cmake/tests.cmake
@@ -12,10 +12,15 @@ if (BUILD_TESTS)
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND})
add_dependencies(check build_tests)
+ # Add test subdirectories
add_subdirectory(src/lib/tests)
add_subdirectory(src/irmd/tests)
add_subdirectory(src/ipcpd/unicast/pff/tests)
add_subdirectory(src/ipcpd/unicast/routing/tests)
add_subdirectory(src/ipcpd/unicast/dir/tests)
add_subdirectory(src/irmd/reg/tests)
+
+ # Create coverage target if gcov is available
+ include(utils/GenCoverage)
+ create_coverage_target()
endif ()