From 4375e297b19bc2177e17cc5616e75d96be053328 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Wed, 26 Jan 2011 12:46:14 -0600 Subject: Add testing and start testing hash table functionality. --- configure.ac | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 29b50be..079a2c0 100644 --- a/configure.ac +++ b/configure.ac @@ -72,6 +72,47 @@ if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then done fi +# ---------------------------------------------------------------------- +# Coverage + +AC_MSG_CHECKING([whether to build with gcov testing]) +AC_ARG_ENABLE([coverage], + AS_HELP_STRING([--enable-coverage], + [Whether to enable coverage testing ]), + [], + [enable_coverage=no]) + +AC_MSG_RESULT([$enable_coverage]) + +if test "$enable_coverage" = "yes"; then + if test "$GCC" != "yes"; then + AC_MSG_ERROR(Coverage testing requires GCC) + fi + + AC_PATH_PROG(GCOV, gcov, no) + if test "$GCOV" = "no" ; then + AC_MSG_ERROR(gcov tool is not available) + fi + + AC_PATH_PROG(LCOV, lcov, no) + if test "$LCOV" = "no" ; then + AC_MSG_ERROR(lcov tool is not installed) + fi + + AC_PATH_PROG(GENHTML, genhtml, no) + if test "$GENHTML" = "no" ; then + AC_MSG_ERROR(lcov's genhtml tool is not installed) + fi + + CFLAGS="$CFLAGS -O0 -g -fprofile-arcs -ftest-coverage" + LDFLAGS="$LDFLAGS -lgcov" +fi + +AM_CONDITIONAL([WITH_COVERAGE], [test "$enable_coverage" = "yes"]) +AC_SUBST(LCOV) +AC_SUBST(GCOV) +AC_SUBST(GENHTML) + # --------------------------------------------------------------------- # Debug mode @@ -89,6 +130,7 @@ fi AC_CONFIG_FILES([Makefile module/Makefile + tests/Makefile ]) AC_OUTPUT -- cgit v1.2.3