Provide configure option to disable tests

Building the tests is enabled by default, but because the test suite
requires root privileges to run at the moment, people should have to
option to disable the tests entirely.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
This commit is contained in:
Patrick McCarty
2016-02-26 15:44:21 -08:00
parent a11afb9d3b
commit 253dcbbbc0
2 changed files with 14 additions and 0 deletions
+2
View File
@@ -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; \
+12
View File
@@ -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