Added coverage report

This commit is contained in:
matlabbe
2026-05-16 21:11:02 -07:00
parent f6ba3e6d7d
commit f40ea246f5
15 changed files with 397 additions and 92 deletions
+12
View File
@@ -185,6 +185,17 @@ if(BUILD_TESTING)
set(TEST_DATA_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/data")
endif()
OPTION(ENABLE_COVERAGE "Build with gcov/llvm coverage instrumentation (for CI)" OFF)
IF(ENABLE_COVERAGE)
IF(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
MESSAGE(STATUS "Coverage instrumentation enabled")
ADD_COMPILE_OPTIONS(--coverage -O0 -g)
ADD_LINK_OPTIONS(--coverage)
ELSE()
MESSAGE(WARNING "ENABLE_COVERAGE is only supported with GCC or Clang")
ENDIF()
ENDIF()
####### DEPENDENCIES #######
IF(MOBILE_BUILD)
option(WITH_QT "Include Qt support" OFF)
@@ -1472,6 +1483,7 @@ MESSAGE(STATUS " BUILD_APP = ${BUILD_APP}")
MESSAGE(STATUS " BUILD_TOOLS = ${BUILD_TOOLS}")
MESSAGE(STATUS " BUILD_EXAMPLES = ${BUILD_EXAMPLES}")
MESSAGE(STATUS " BUILD_TESTING = ${BUILD_TESTING}")
MESSAGE(STATUS " ENABLE_COVERAGE = ${ENABLE_COVERAGE}")
IF(NOT WIN32)
# see comment above for the BUILD_SHARED_LIBS option on Windows
MESSAGE(STATUS " BUILD_SHARED_LIBS = ${BUILD_SHARED_LIBS}")