Skip to content

Commit 214bd6e

Browse files
committed
[docs] Add gcov instructions in readme and contributing
1 parent c011d15 commit 214bd6e

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

CONTRIBUTING.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,3 +202,19 @@ New dependency: dependency_name
202202
license: SPDX license tag
203203
origin: https://dependency_origin.com
204204
```
205+
206+
## Code coverage
207+
208+
After adding new functionality add tests and check coverage before and after change.
209+
To do this, enable coverage instrumentation by turning on the USE_GCOV flag in CMake.
210+
An example flow might look like the following:
211+
212+
```bash
213+
$ cmake -B build -DUSE_GCOV=1 -DCMAKE_BUILD_TYPE=Debug
214+
$ cmake --build build -j
215+
$ cd build
216+
$ ctest
217+
$ apt install lcov
218+
$ lcov --capture --directory . --output-file coverage.info
219+
$ genhtml -o html_report coverage.info
220+
```

0 commit comments

Comments
 (0)