File tree 1 file changed +15
-6
lines changed
1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -122,22 +122,31 @@ Test coverage
122
122
123
123
This library aims to have full coverage of the reachable lines and branches.
124
124
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 :
126
126
127
- $ ./configure --enable-coverage
127
+ * using Autotools-based build system:
128
128
129
- Run the tests:
129
+ ```
130
+ $ ./configure --enable-coverage
131
+ $ make check
132
+ ```
130
133
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
+ ```
132
141
133
142
To create a report, ` gcovr ` is recommended, as it includes branch coverage reporting:
134
143
135
- $ gcovr --exclude 'src/bench*' --print-summary
144
+ $ gcovr --exclude 'build/*' --exclude ' src/bench*' --print-summary
136
145
137
146
To create a HTML report with coloured and annotated source code:
138
147
139
148
$ 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
141
150
142
151
Benchmark
143
152
------------
You can’t perform that action at this time.
0 commit comments