arabica/m4/want_tests.m4
jez bc9bc15b6a Add configure option to disable running tests. make check will still build
tests, but will not run them.
--with-tests=no to manually disable.  Tests are automatically disabled if
cross-compiling.
2008-08-07 18:56:02 +01:00

25 lines
1 KiB
Text

AC_DEFUN([ARABICA_WANT_TESTS],
[
AC_ARG_WITH([tests],
AS_HELP_STRING([--with-tests=yes|no],
[Control whether make check runs tests after they are built. --with-tests=no to disable]),
[if test "$withval" = "no"; then
want_tests="no"
else
want_tests="yes"
fi],
[want_tests="yes"])
if test "$want_tests" = "no"; then
AC_MSG_NOTICE([[Tests disabled. make check will build the tests but not run them.]])
fi
if test "$want_tests" = yes; then
if test "$cross_compiling" = "maybe"; then
AC_MSG_NOTICE([[Are we cross-compiling? If so, consider --want-tests=no, which means make check will build the tests but not run them.]])
fi
if test "$cross_compiling" = "yes"; then
AC_MSG_NOTICE([[Tests disabled because cross-compiling. make check will build the tests but not run them.]])
want_tests="no"
fi
fi
AM_CONDITIONAL([WANT_TESTS], [test "$want_tests" = "yes"])
])