Blame macros2/gnome-code-coverage.m4

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