xo-umbrella2/xo-indentlog/BUILD.md
Roland Conybeare 966c3903e1 git subrepo clone git@github.com:Rconybea/xo-indentlog.git xo-indentlog
subrepo:
  subdir:   "xo-indentlog"
  merged:   "0834c6ad"
upstream:
  origin:   "git@github.com:Rconybea/xo-indentlog.git"
  branch:   "main"
  commit:   "0834c6ad"
git-subrepo:
  version:  "0.4.9"
  origin:   "???"
  commit:   "???"
2026-06-06 21:30:17 -04:00

47 lines
1.3 KiB
Markdown

# 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]
```
![lcov_output](img/lcov1.png)
## Implementation Notes
- coverage builds creates `.gcno` files alongside `.o` object files
- running coverage-enabled executables creates/appends to `.gcda` files
- e.g. see `ccov/utest/CMakeFiles/utest.indentlog.dir`
- coverage feature enabled globally in top-level `CMakeLists.txt` by:
```
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 `AUTO` opts in to the `ccov` target; `ALL` opts in to the `ccov-all` target