32.5. Test Coverage Examination
The PostgreSQL source code can be compiled with coverage testing instrumentation, so that it becomes possible to examine which parts of the code are covered by the regression tests or any other test suite that is run with the code. This is currently supported when compiling with GCC and requires the gcov and lcov programs.
A typical workflow would look like this:
1
./configure --enable-coverage ... OTHER OPTIONS ...
2
make
3
make check # or other test suite
4
make coverage-html
Copied!
Then point your HTML browser to coverage/index.html. The make commands also work in subdirectories.
To reset the execution counts between test runs, run:
1
make coverage-clean
Copied!
Last modified 2mo ago
Export as PDF
Copy link
Edit on GitHub