~ubuntu-branches/ubuntu/saucy/clamav/saucy-backports

« back to all changes in this revision

Viewing changes to m4/reorganization/code_checks/coverage.m4

  • Committer: Package Import Robot
  • Author(s): Scott Kitterman
  • Date: 2014-07-15 01:08:10 UTC
  • mfrom: (0.35.47 sid)
  • Revision ID: package-import@ubuntu.com-20140715010810-ru66ek4fun2iseba
Tags: 0.98.4+dfsg-2~ubuntu13.10.1
No-change backport to saucy (LP: #1341962)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
AC_ARG_ENABLE(coverage,
 
2
              AC_HELP_STRING([--enable-coverage],
 
3
                             [turn on test coverage
 
4
                              @<:@default=no@:>@]),
 
5
[enable_cov=$enableval],[enable_cov="no"])
 
6
 
 
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!])
 
10
        fi
 
11
        if test "x$ac_compiler_gnu" != "xyes"; then
 
12
                AC_MSG_ERROR([coverage testing only works if gcc is used])
 
13
        fi
 
14
 
 
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)
 
20
fi
 
21
 
 
22
AM_CONDITIONAL(ENABLE_COVERAGE, test "x$enable_coverage" = "xyes")