1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-03 20:02:46 +03:00

Code coverage testing with gcov. Documentation is in the regression test

chapter.

Author: Michelle Caisse <Michelle.Caisse@Sun.COM>
This commit is contained in:
Peter Eisentraut
2008-09-05 12:11:18 +00:00
parent 579d9a5201
commit 11f53b1063
7 changed files with 361 additions and 15 deletions

View File

@ -1,4 +1,4 @@
<!-- $PostgreSQL: pgsql/doc/src/sgml/installation.sgml,v 1.312 2008/08/29 13:02:32 petere Exp $ -->
<!-- $PostgreSQL: pgsql/doc/src/sgml/installation.sgml,v 1.313 2008/09/05 12:11:18 petere Exp $ -->
<chapter id="installation">
<title><![%standalone-include[<productname>PostgreSQL</>]]>
@ -1233,6 +1233,21 @@ su - postgres
</listitem>
</varlistentry>
<varlistentry>
<term><option>--enable-coverage</option></term>
<listitem>
<para>
If using GCC, all programs and libraries are compiled with
code coverage testing instrumentation. When run, they
generate files in the build directory with code coverage
metrics.
<![%standalone-ignore[See <xref linkend="regress-coverage">
for more information.]]> This option is for use only with GCC
and when doing development work.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--enable-profiling</option></term>
<listitem>

View File

@ -1,4 +1,4 @@
<!-- $PostgreSQL: pgsql/doc/src/sgml/regress.sgml,v 1.59 2008/05/30 00:04:32 tgl Exp $ -->
<!-- $PostgreSQL: pgsql/doc/src/sgml/regress.sgml,v 1.60 2008/09/05 12:11:18 petere Exp $ -->
<chapter id="regress">
<title id="regress-title">Regression Tests</title>
@ -419,5 +419,37 @@ float8:out:i.86-.*-openbsd=float8-small-is-zero.out
</para>
</sect1>
<sect1 id="regress-coverage">
<title>Test Coverage Examination</title>
<para>
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 <command>gcov</command>
and <command>lcov</command> programs.
</para>
<para>
A typical workflow would look like this:
<screen>
./configure --enable-coverage ... OTHER OPTIONS ...
gmake
gmake check # or other test suite
gmake coverage-html
</screen>
Then point your HTML browser
to <filename>coverage/index.html</filename>.
</para>
<para>
To reset the execution counts between test runs, run
<screen>
gmake coverage-clean
</screen>
</para>
</sect1>
</chapter>