Skip to content

Commit 253dcbb

Browse files
committed
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 <[email protected]>
1 parent a11afb9 commit 253dcbb

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

Makefile.am

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,11 @@ install-exec-hook:
103103
perl findstatic.pl */*.o | grep -v Checking ||:
104104

105105
TEST_EXTENSIONS = .sh
106+
if ENABLE_TESTS
106107
TESTS = $(dist_check_SCRIPTS)
107108
dist_check_SCRIPTS = \
108109
test/run.sh
110+
endif
109111

110112
release:
111113
@git rev-parse v$(PACKAGE_VERSION) &> /dev/null; \

configure.ac

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ AS_IF([test "$enable_lzma" != "no"], [
3333
])
3434
AM_CONDITIONAL([ENABLE_LZMA], [test "$enable_lzma" != "no"])
3535

36+
AC_ARG_ENABLE(
37+
[tests],
38+
[AS_HELP_STRING([--disable-tests], [Do not enable functional tests (enabled by default)])]
39+
)
40+
3641
have_coverage=no
3742
AC_ARG_ENABLE(coverage, AS_HELP_STRING([--enable-coverage], [enable test coverage]))
3843
if test "x$enable_coverage" = "xyes" ; then
@@ -52,6 +57,13 @@ if test "x$enable_coverage" = "xyes" ; then
5257
fi
5358
AM_CONDITIONAL([COVERAGE], [test "$have_coverage" = "yes"])
5459

60+
AS_IF([test "$enable_tests" != "no"], [
61+
AC_PATH_PROG([have_valgrind], [valgrind])
62+
AS_IF([test -z "${have_valgrind}"], [
63+
AC_MSG_ERROR([Must have valgrind installed to run functional tests])
64+
])
65+
])
66+
AM_CONDITIONAL([ENABLE_TESTS], [test "$enable_tests" != "no"])
5567

5668
AC_CONFIG_FILES([Makefile data/bsdiff.pc])
5769
AC_OUTPUT

0 commit comments

Comments
 (0)