Problem: no code coverage integration

Solution: import ax_code_coverage.m4 from autoconf-archive and use it
in configure.ac and Makefile.am in order to provide a make
check-code-coverage target behind a --enable-code-coverage configure
flag, that can be used to generate a gcov/lcov code coverage report.
Depends on having gcov and lcov installed.
This commit is contained in:
Luca Boccassi
2016-03-04 23:07:13 +00:00
parent 22cb66d832
commit 6df753c55a
3 changed files with 281 additions and 3 deletions

View File

@@ -16,6 +16,7 @@ AM_INIT_AUTOMAKE(foreign subdir-objects tar-ustar dist-zip)
m4_pattern_allow([AC_PROG_CC_C99])
m4_include([m4/ax_check_compile_flag.m4])
m4_include([m4/ax_cxx_compile_stdcxx_11.m4])
m4_include([m4/ax_code_coverage.m4])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
# This lets us use PACKAGE_VERSION in Makefiles
@@ -50,6 +51,7 @@ AC_PROG_CC
AX_CHECK_COMPILE_FLAG([-std=gnu11], [CFLAGS+=" -std=gnu11"], [AC_PROG_CC_C99])
AC_PROG_CXX
AX_CXX_COMPILE_STDCXX_11([ext], [optional])
AX_CODE_COVERAGE
AM_PROG_CC_C_O
AC_PROG_SED
AC_PROG_AWK