24th September 2020: PostgreSQL 13 Released!
Supported Versions: Current (13) / 12 / 11 / 10 / 9.6 / 9.5
Development Versions: devel
Unsupported versions: 9.4 / 9.3 / 9.2 / 9.1 / 9.0 / 8.4
This documentation is for an unsupported version of PostgreSQL.
You may want to view the same page for the current version, or one of the other supported versions listed above instead.

29.4. 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:

./configure --enable-coverage ... OTHER OPTIONS ...
gmake check # or other test suite
gmake coverage-html

Then point your HTML browser to coverage/index.html.

To reset the execution counts between test runs, run:

gmake coverage-clean