|
Packit |
d53d01 |
dnl GNOME_CODE_COVERAGE
|
|
Packit |
d53d01 |
dnl
|
|
Packit |
d53d01 |
dnl Defines CODE_COVERAGE_CFLAGS and CODE_COVERAGE_LDFLAGS which should be
|
|
Packit |
d53d01 |
dnl included in the CFLAGS and LIBS/LDFLAGS variables of every build target
|
|
Packit |
d53d01 |
dnl (program or library) which should be built with code coverage support.
|
|
Packit |
d53d01 |
dnl Also defines GNOME_CODE_COVERAGE_RULES which should be substituted in your
|
|
Packit |
d53d01 |
dnl Makefile; and $enable_code_coverage which can be used in subsequent
|
|
Packit |
d53d01 |
dnl configure output.
|
|
Packit |
d53d01 |
dnl
|
|
Packit |
d53d01 |
dnl Note that all optimisation flags in CFLAGS must be disabled when code
|
|
Packit |
d53d01 |
dnl coverage is enabled.
|
|
Packit |
d53d01 |
dnl
|
|
Packit |
d53d01 |
dnl Derived from Makefile.decl in GLib, originally licenced under LGPLv2.1+.
|
|
Packit |
d53d01 |
dnl This file is licenced under LGPLv2.1+.
|
|
Packit |
d53d01 |
dnl
|
|
Packit |
d53d01 |
dnl Usage example:
|
|
Packit |
d53d01 |
dnl configure.ac:
|
|
Packit |
d53d01 |
dnl GNOME_CODE_COVERAGE
|
|
Packit |
d53d01 |
dnl
|
|
Packit |
d53d01 |
dnl Makefile.am:
|
|
Packit |
d53d01 |
dnl @GNOME_CODE_COVERAGE_RULES@
|
|
Packit |
d53d01 |
dnl my_program_LIBS = … $(CODE_COVERAGE_LDFLAGS) …
|
|
Packit |
d53d01 |
dnl my_program_CFLAGS = … $(CODE_COVERAGE_CFLAGS) …
|
|
Packit |
d53d01 |
dnl
|
|
Packit |
d53d01 |
dnl This results in a “check-code-coverage” rule being added to any Makefile.am
|
|
Packit |
d53d01 |
dnl which includes “@GNOME_CODE_COVERAGE_RULES@” (assuming the module has been
|
|
Packit |
d53d01 |
dnl configured with --enable-code-coverage). Running `make check-code-coverage`
|
|
Packit |
d53d01 |
dnl in that directory will run the module’s test suite (`make check`) and build
|
|
Packit |
d53d01 |
dnl a code coverage report detailing the code which was touched, then print the
|
|
Packit |
d53d01 |
dnl URI for the report.
|
|
Packit |
d53d01 |
|
|
Packit |
d53d01 |
AU_DEFUN([GNOME_CODE_COVERAGE],[
|
|
Packit |
d53d01 |
AX_CODE_COVERAGE
|
|
Packit |
d53d01 |
GNOME_CODE_COVERAGE_RULES=$CODE_COVERAGE_RULES
|
|
Packit |
d53d01 |
|
|
Packit |
d53d01 |
AC_SUBST([GNOME_CODE_COVERAGE_RULES])
|
|
Packit |
d53d01 |
m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([GNOME_CODE_COVERAGE_RULES])])
|
|
Packit |
d53d01 |
],
|
|
Packit |
d53d01 |
[[$0: This macro is deprecated. You should use AX_CODE_COVERAGE instead and
|
|
Packit |
d53d01 |
replace uses of GNOME_CODE_COVERAGE_RULES with CODE_COVERAGE_RULES.
|
|
Packit |
d53d01 |
See: http://www.gnu.org/software/autoconf-archive/ax_code_coverage.html#ax_code_coverage]])
|