aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/configure.in
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-11-15 18:37:57 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-11-15 20:06:45 +0100
commitecd94a4b45924c3c65feabc87bbc7a075e951249 (patch)
treef3622b119e81c1c86c288a6273ce9e9bdba8841d /openbsc/configure.in
parent0b369c582b94c2b409417bcaed0fcdd90d925d9e (diff)
misc: Introduce a --enable-coverage mode to build with gprof coverage
This adds a test coverage build. One can use gcov and lcov on the resulting data afterwards to see which code paths were executed and which were not.
Diffstat (limited to 'openbsc/configure.in')
-rw-r--r--openbsc/configure.in14
1 files changed, 14 insertions, 0 deletions
diff --git a/openbsc/configure.in b/openbsc/configure.in
index f98bb709e..8bbfcf8ca 100644
--- a/openbsc/configure.in
+++ b/openbsc/configure.in
@@ -62,6 +62,20 @@ AC_COMPILE_IFELSE([char foo;],
CFLAGS="$saved_CFLAGS"
AC_SUBST(SYMBOL_VISIBILITY)
+# Coverage build taken from WebKit's configure.in
+AC_MSG_CHECKING([whether to enable code coverage support])
+AC_ARG_ENABLE(coverage,
+ AC_HELP_STRING([--enable-coverage],
+ [enable code coverage support [default=no]]),
+ [],[enable_coverage="no"])
+AC_MSG_RESULT([$enable_coverage])
+if test "$enable_coverage" = "yes"; then
+ COVERAGE_CFLAGS="-ftest-coverage -fprofile-arcs"
+ COVERAGE_LDFLAGS="-ftest-coverage -fprofile-arcs"
+ AC_SUBST([COVERAGE_CFLAGS])
+ AC_SUBST([COVERAGE_LDFLAGS])
+fi
+
dnl Generate the output
AM_CONFIG_HEADER(bscconfig.h)