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.
This commit is contained in:
jez 2008-08-07 18:56:02 +01:00
parent b08e5f8ab5
commit bc9bc15b6a
7 changed files with 44 additions and 5 deletions

View file

@ -19,6 +19,7 @@ ARABICA_CHECK_CODECVT_SPECIALISATIONS
ARABICA_CHECK_SOCKETS
ARABICA_HAS_BOOST([1.33])
ARABICA_WANT_DOM
ARABICA_WANT_TESTS
HAS_LIB_ELEPHANT

25
m4/want_tests.m4 Normal file
View file

@ -0,0 +1,25 @@
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"])
])

View file

@ -3,7 +3,10 @@ check_PROGRAMS = dom_test dom_test_silly
if HAS_STD_WSTRING
check_PROGRAMS += dom_test_wide
endif
if WANT_TESTS
TESTS = $(check_PROGRAMS)
endif
AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include @PARSER_HEADERS@ $(BOOST_CPPFLAGS)
LIBARABICA = $(top_builddir)/src/libarabica.la

View file

@ -3,7 +3,10 @@ check_PROGRAMS = filter_test filter_test_silly
if HAS_STD_WSTRING
check_PROGRAMS += filter_test_wide
endif
if WANT_TESTS
TESTS = $(check_PROGRAMS)
endif
AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include @PARSER_HEADERS@ $(BOOST_CPPFLAGS)
LIBARABICA = $(top_builddir)/src/libarabica.la

View file

@ -3,7 +3,9 @@ check_PROGRAMS = utils_test utils_test_silly
if HAS_STD_WSTRING
check_PROGRAMS += utils_test_wide
endif
if WANT_TESTS
TESTS = $(check_PROGRAMS)
endif
AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include @PARSER_HEADERS@ $(BOOST_CPPFLAGS)
LIBARABICA = $(top_builddir)/src/libarabica.la

View file

@ -3,7 +3,10 @@ check_PROGRAMS = xpath_test xpath_test_silly
if HAS_STD_WSTRING
check_PROGRAMS += xpath_test_wide
endif
if WANT_TESTS
TESTS = $(check_PROGRAMS)
endif
AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include @PARSER_HEADERS@ @BOOST_CPPFLAGS@
LIBARABICA = $(top_builddir)/src/libarabica.la

View file

@ -1,6 +1,8 @@
check_PROGRAMS = xslt_test
if WANT_TESTS
TESTS = $(check_PROGRAMS)
endif
ELEPHANT_INCLUDE = @ELEPHANT_INCLUDES@
LIBELEPHANT = @ELEPHANT_LIBS@