Skip to content

Commit 6baed54

Browse files
committed
[docs] Add gcov instructions in readme and contributing
1 parent c662cf3 commit 6baed54

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

CONTRIBUTING.md

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

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ List of options provided by CMake:
123123
| USE_TSAN | Enable ThreadSanitizer checks | ON/OFF | OFF |
124124
| USE_MSAN | Enable MemorySanitizer checks | ON/OFF | OFF |
125125
| USE_VALGRIND | Enable Valgrind instrumentation | ON/OFF | OFF |
126+
| USE_GCOV | Enable gcov support | ON/OFF | OFF |
126127

127128
## Architecture: memory pools and providers
128129

0 commit comments

Comments
 (0)