File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 10
10
- [ Extending public API] ( #extending-public-api )
11
11
- [ License] ( #license )
12
12
- [ Adding new dependency] ( #adding-new-dependency )
13
+ - [ Code coverage] ( #code-coverage )
13
14
14
15
Below you'll find instructions on how to contribute to UMF, either with code changes
15
16
or issues. All contributions are most welcome!
@@ -202,3 +203,20 @@ New dependency: dependency_name
202
203
license: SPDX license tag
203
204
origin: https://dependency_origin.com
204
205
```
206
+
207
+ ## Code coverage
208
+
209
+ After adding a new functionality add tests and check coverage before and after the change.
210
+ To do this, enable coverage instrumentation by turning on the USE_GCOV flag in CMake.
211
+ Coverage instrumentation feature is supported only by GCC and Clang.
212
+ An example flow might look like the following:
213
+
214
+ ``` bash
215
+ $ cmake -B build -DUSE_GCOV=1 -DCMAKE_BUILD_TYPE=Debug
216
+ $ cmake --build build -j
217
+ $ cd build
218
+ $ ctest
219
+ $ apt install lcov
220
+ $ lcov --capture --directory . --output-file coverage.info
221
+ $ genhtml -o html_report coverage.info
222
+ ```
You can’t perform that action at this time.
0 commit comments