1
AC_ARG_ENABLE(coverage,
2
AC_HELP_STRING([--enable-coverage],
5
[enable_cov=$enableval],[enable_cov="no"])
7
if test "x$enable_coverage" = "xyes"; then
8
if test "x$CHECK_LIBS" = "x"; then
9
AC_MSG_ERROR([Coverage testing required, but unit tests not enabled!])
11
if test "x$ac_compiler_gnu" != "xyes"; then
12
AC_MSG_ERROR([coverage testing only works if gcc is used])
15
CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"
16
LDFLAGS="$LDFLAGS -lgcov"
17
AC_CHECK_PROGS(GCOV, gcov, false)
18
AC_CHECK_PROGS(LCOV, lcov, false)
19
AC_CHECK_PROGS(GENHTML, genhtml, false)
22
AM_CONDITIONAL(ENABLE_COVERAGE, test "x$enable_coverage" = "xyes")