File tree Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -122,22 +122,31 @@ Test coverage
122122
123123This library aims to have full coverage of the reachable lines and branches.
124124
125- To create a test coverage report, configure with ` --enable- coverage` (use of GCC is necessary):
125+ To create a test coverage report, configure for coverage analysis (use of GCC is necessary), build and run the tests :
126126
127- $ ./configure --enable-coverage
127+ * using Autotools-based build system:
128128
129- Run the tests:
129+ ```
130+ $ ./configure --enable-coverage
131+ $ make check
132+ ```
130133
131- $ make check
134+ * using CMake-based build system:
135+
136+ ```
137+ $ cmake --preset coverage -S . -B build
138+ $ cmake --build build
139+ $ ctest --test-dir build
140+ ```
132141
133142To create a report, ` gcovr ` is recommended, as it includes branch coverage reporting:
134143
135- $ gcovr --exclude 'src/bench*' --print-summary
144+ $ gcovr --exclude 'build/*' --exclude ' src/bench*' --print-summary
136145
137146To create a HTML report with coloured and annotated source code:
138147
139148 $ mkdir -p coverage
140- $ gcovr --exclude 'src/bench*' --html --html-details -o coverage/coverage.html
149+ $ gcovr --exclude 'build/*' --exclude ' src/bench*' --html --html-details -o coverage/coverage.html
141150
142151Benchmark
143152------------
You can’t perform that action at this time.
0 commit comments