From 11f53b1063e796dbb766b7ad3fd46e98806bea43 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Fri, 5 Sep 2008 12:11:18 +0000 Subject: Code coverage testing with gcov. Documentation is in the regression test chapter. Author: Michelle Caisse --- doc/src/sgml/installation.sgml | 17 ++++++++++++++++- doc/src/sgml/regress.sgml | 36 ++++++++++++++++++++++++++++++++++-- 2 files changed, 50 insertions(+), 3 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/installation.sgml b/doc/src/sgml/installation.sgml index a5dfa8d0810..cee4681ce39 100644 --- a/doc/src/sgml/installation.sgml +++ b/doc/src/sgml/installation.sgml @@ -1,4 +1,4 @@ - + <![%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> diff --git a/doc/src/sgml/regress.sgml b/doc/src/sgml/regress.sgml index d09137fcc0f..0e082603bf1 100644 --- a/doc/src/sgml/regress.sgml +++ b/doc/src/sgml/regress.sgml @@ -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 @@ -419,5 +419,37 @@ float8:out:i.86-.*-openbsd=float8-small-is-zero.out - + + + 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 +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 + + + + -- cgit v1.2.3