apidoc : Doxyfile
doxygen
+if COVERAGE
+cov-reset:
+ @rm -rf $(top_builddir)/coverage
+ @find $(top_builddir) -name "*.gcda" -delete
+ @lcov --zerocounters --directory $(top_builddir)
+
+cov-report:
+ @mkdir $(top_builddir)/coverage
+ lcov -c -o $(top_builddir)/coverage/coverage.info -d $(top_builddir)
+ genhtml --num-spaces 4 --legend \
+ -t "$(PACKAGE_STRING)" \
+ -o $(top_builddir)/coverage/html \
+ -p `readlink -m $(abs_top_srcdir)`/src \
+ $(top_builddir)/coverage/coverage.info
+ @echo "Coverage Report at $(top_builddir)/coverage/html" >&2
+
+coverage:
+ @$(MAKE) cov-reset
+ @$(MAKE) check
+ @$(MAKE) cov-report
+else
+cov-reset:
+
+coverage:
+ @echo "reconfigure with --enable-coverage"
+endif
+
clean-local:
+ @$(MAKE) cov-reset
rm -rf apidoc
ARG_ENABL_SET([bfd-backtraces], [use binutils libbfd to resolve backtraces for memory leaks and segfaults.])
ARG_ENABL_SET([unwind-backtraces],[use libunwind to create backtraces for memory leaks and segfaults.])
ARG_ENABL_SET([unit-tests], [enable unit tests using the check test framework.])
+ARG_ENABL_SET([coverage], [enable lcov coverage report generation.])
ARG_ENABL_SET([tkm], [enable Trusted Key Manager support.])
ARG_ENABL_SET([cmd], [enable the command line IKE client charon-cmd.])
mediation=true
fi
+if test x$coverage = xtrue; then
+ unit_tests=true
+fi
+
# ===========================================
# check required libraries and header files
# ===========================================
AC_SUBST(CHECK_LIBS)
fi
+if test x$coverage = xtrue; then
+ AC_PATH_PROG([LCOV], [lcov], [], [$PATH:/bin:/usr/bin:/usr/local/bin])
+ if test x$LCOV = x; then
+ AC_MSG_ERROR([lcov not found])
+ fi
+ AC_PATH_PROG([GENHTML], [genhtml], [], [$PATH:/bin:/usr/bin:/usr/local/bin])
+ if test x$GENHTML = x; then
+ AC_MSG_ERROR([genhtml not found])
+ fi
+
+ COVERAGE_CFLAGS="-fprofile-arcs -ftest-coverage"
+ COVERAGE_LDFLAGS="-fprofile-arcs"
+ AC_SUBST(COVERAGE_CFLAGS)
+ AC_SUBST(COVERAGE_LDFLAGS)
+
+ AC_MSG_NOTICE([coverage enabled, adding "-g -O0" to CFLAGS])
+ CFLAGS="${CFLAGS} -g -O0"
+fi
+
# ===============================================
# collect plugin list for strongSwan components
# ===============================================
AM_CONDITIONAL(MONOLITHIC, test x$monolithic = xtrue)
AM_CONDITIONAL(USE_SILENT_RULES, test x$enable_silent_rules = xyes)
AM_CONDITIONAL(UNITTESTS, test x$unit_tests = xtrue)
+AM_CONDITIONAL(COVERAGE, test x$coverage = xtrue)
AM_CONDITIONAL(USE_TKM, test x$tkm = xtrue)
AM_CONDITIONAL(USE_CMD, test x$cmd = xtrue)