summaryrefslogtreecommitdiff
path: root/cmake/dependencies/gcov.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/dependencies/gcov.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/dependencies/gcov.cmake')
-rw-r--r--cmake/dependencies/gcov.cmake11
1 files changed, 11 insertions, 0 deletions
diff --git a/cmake/dependencies/gcov.cmake b/cmake/dependencies/gcov.cmake
new file mode 100644
index 00000000..c4d1caf0
--- /dev/null
+++ b/cmake/dependencies/gcov.cmake
@@ -0,0 +1,11 @@
+find_program(GCOV_PATH gcov)
+
+if (GCOV_PATH)
+ set(HAVE_GCOV TRUE CACHE INTERNAL "")
+ message(STATUS "gcov found - coverage analysis available")
+else ()
+ set(HAVE_GCOV FALSE CACHE INTERNAL "")
+ message(STATUS "gcov not found - coverage analysis not available")
+endif ()
+
+mark_as_advanced(GCOV_PATH)