1.3 KiB
1.3 KiB
indentlog build details
mac osx
Note: ~ expansion doesn't work in a pure build environment.
Test Coverage
enable coverage build
$ cd indentlog
$ mkdir ccov
$ cd ccov
$ cmake -DCODE_COVERAGE=ON .. # prepares coverage build
build + generate test coverage
$ make ccov # builds + runs unit tests
$ make ccov-all # generates .html report
view coverage report
$ firefox
[navigate to coverage report; path something like file://home/roland/proj/indentlog/ccov/ccov/all-merged/index.html]
Implementation Notes
- coverage builds creates
.gcnofiles alongside.oobject files - running coverage-enabled executables creates/appends to
.gcdafiles - e.g. see
ccov/utest/CMakeFiles/utest.indentlog.dir - coverage feature enabled globally in top-level
CMakeLists.txtby:
include(cmake/code-coverage.cmake)
add_code_coverage()
add_code_coverage_all_targets()
- looks like these need to appear before executable targets are introduced
- also need to opt-in individual executables, e.g. in
utest/CMakeLists.txt:
target_code_coverage(${SELF_EXECUTABLE_NAME} AUTO ALL)
- here
AUTOopts in to theccovtarget;ALLopts in to theccov-alltarget
