diff --git a/Makefile.am b/Makefile.am index eac45b7..328648f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -103,9 +103,11 @@ install-exec-hook: perl findstatic.pl */*.o | grep -v Checking ||: TEST_EXTENSIONS = .sh +if ENABLE_TESTS TESTS = $(dist_check_SCRIPTS) dist_check_SCRIPTS = \ test/run.sh +endif release: @git rev-parse v$(PACKAGE_VERSION) &> /dev/null; \ diff --git a/configure.ac b/configure.ac index 5e2bea7..50c9e4a 100644 --- a/configure.ac +++ b/configure.ac @@ -33,6 +33,11 @@ AS_IF([test "$enable_lzma" != "no"], [ ]) AM_CONDITIONAL([ENABLE_LZMA], [test "$enable_lzma" != "no"]) +AC_ARG_ENABLE( + [tests], + [AS_HELP_STRING([--disable-tests], [Do not enable functional tests (enabled by default)])] +) + have_coverage=no AC_ARG_ENABLE(coverage, AS_HELP_STRING([--enable-coverage], [enable test coverage])) if test "x$enable_coverage" = "xyes" ; then @@ -52,6 +57,13 @@ if test "x$enable_coverage" = "xyes" ; then fi AM_CONDITIONAL([COVERAGE], [test "$have_coverage" = "yes"]) +AS_IF([test "$enable_tests" != "no"], [ + AC_PATH_PROG([have_valgrind], [valgrind]) + AS_IF([test -z "${have_valgrind}"], [ + AC_MSG_ERROR([Must have valgrind installed to run functional tests]) + ]) +]) +AM_CONDITIONAL([ENABLE_TESTS], [test "$enable_tests" != "no"]) AC_CONFIG_FILES([Makefile data/bsdiff.pc]) AC_OUTPUT