diff options
author | Stef Walter <stefw@collabora.co.uk> | 2011-01-26 12:46:14 -0600 |
---|---|---|
committer | Stef Walter <stefw@collabora.co.uk> | 2011-01-26 12:46:14 -0600 |
commit | 4375e297b19bc2177e17cc5616e75d96be053328 (patch) | |
tree | e62b542ae6bb600332912e14c480270709934760 /configure.ac | |
parent | f8009b4d504de0ed752b867893acd263108409e0 (diff) |
Add testing and start testing hash table functionality.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 42 |
1 files changed, 42 insertions, 0 deletions
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 |