diff --git a/Makefile.am b/Makefile.am index 3762274e..bf8a3c41 100644 --- a/Makefile.am +++ b/Makefile.am @@ -62,6 +62,9 @@ man_MANS = snapraid.1 clean-local: rm -f valgrind.log callgrind.log cachegrind.log rm -rf test + rm -f *.gcda *.gcno *.gcov + rm -rf cov + rm -f lcov.info maintainer-clean-local: rm -f snapraid.1 snapraid.txt @@ -278,7 +281,20 @@ cachegrind: 2> cachegrind.log tail cachegrind.log +lcov_reset: + lcov --directory . -z + rm -f ./lcov.info + +lcov_capture: + lcov --directory . --capture -o lcov.info + +lcov_html: + rm -rf ./cov + mkdir cov + genhtml -o ./cov lcov.info + # Rules for documentation + if HAVE_ADVD2 snapraid.1 : snapraid.d advd2 man < $(srcdir)/$< > $@ diff --git a/configure.ac b/configure.ac index 49ba7b99..6a85c7b7 100644 --- a/configure.ac +++ b/configure.ac @@ -51,6 +51,13 @@ dnl Checks for compiler AC_CHECK_CC_OPT([-Wall], CFLAGS="$CFLAGS -Wall", []) AC_CHECK_CC_OPT([-Wextra], CFLAGS="$CFLAGS -Wextra", []) +dnl Checks for test environment +AS_CASE([$host], + [*-*-mingw*], [TESTENV="$WINE"], + [] +) + +dnls Checks for options AC_ARG_WITH([crypto], [AS_HELP_STRING([--with-crypto], [enable the use of the MD5 fast implementation of the OpenSSL crypto library])], @@ -64,13 +71,23 @@ AS_IF([test "x$with_crypto" != xno], [ ]) ]) -dnl Checks for test environment -AS_CASE([$host], - [*-*-mingw*], [TESTENV="$WINE"], - [TESTENV="$VALGRIND"] -) -AC_ARG_VAR([TESTENV], [Test environment]) +AC_ARG_ENABLE([coverage], + [AS_HELP_STRING([--enable-coverage],[enable the use of gcov for code coverage])], + [ + TESTENV="" + CFLAGS="-O0 -g -fprofile-arcs -ftest-coverage" + ], + []) +AC_ARG_ENABLE([valgrind], + [AS_HELP_STRING([--enable-valgrind],[enable the use of valgrind in testing])], + [ + TESTENV="$VALGRIND" + ], + []) + + +AC_ARG_VAR([TESTENV], [Test environment]) AC_CONFIG_FILES([Makefile]) AC_OUTPUT