File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -46,7 +46,8 @@ include(cmake/CompileOptions.cmake)
4646
4747# Code coverage - Debug only
4848# NOTE: Code coverage results with an optimized (non-Debug) build may be misleading
49- if (CMAKE_BUILD_TYPE MATCHES Debug AND CMAKE_COMPILER_IS_GNUCXX)
49+ option (BUILD_COVERAGE "Build code coverage" OFF )
50+ if (CMAKE_BUILD_TYPE MATCHES Debug AND CMAKE_COMPILER_IS_GNUCXX AND BUILD_COVERAGE)
5051 include (CodeCoverage )
5152 setup_target_for_coverage (${PROJECT_NAME } _coverage unit_tests coverage )
5253endif ()
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ sudo apt-get install -yq lcov curl
88
99mkdir build
1010cd build
11- cmake .. -DCMAKE_BUILD_TYPE=Debug
11+ cmake .. -DCMAKE_BUILD_TYPE=Debug -DBUILD_COVERAGE=ON
1212make unit_tests
1313lcov -c -i -d src/tests/unit_tests -o base.info
1414bin/unit_tests
You can’t perform that action at this time.
0 commit comments