[test] Enable floating point exceptions.

Some platforms and applications enable floating point exceptions, so it
seems sensible to run the test-suite with the most serious exceptions
enabled - divide by zero, invalid result and overflow.
This commit is contained in:
Chris Wilson 2008-05-06 10:29:20 +01:00
parent bf49015202
commit 1755a2d27d
2 changed files with 13 additions and 3 deletions

View file

@ -108,6 +108,9 @@ AC_DEFUN([_CHECK_FUNCS_WITH_FLAGS],
dnl ===========================================================================
AC_CHECK_LIBM
LIBS="$LIBS $LIBM"
AC_CHECK_FUNCS(vasnprintf ctime_r drand48)
AC_MSG_CHECKING([for Sun Solaris (non-POSIX ctime_r)])
@ -122,6 +125,9 @@ case "$host" in
esac
AC_MSG_RESULT([$solaris_posix_pthread])
# check for GNU-extensions to fenv
AC_CHECK_HEADER(fenv.h, [AC_CHECK_FUNCS(feenableexcept)])
dnl ===========================================================================
dnl
dnl Test for native atomic operations.
@ -159,9 +165,6 @@ AC_MSG_RESULT([$cairo_atomic_op_needs_memory_barrier])
dnl ===========================================================================
AC_CHECK_LIBM
LIBS="$LIBS $LIBM"
AC_CHECK_LIB(z, compress,
[AC_CHECK_HEADER(zlib.h, [have_libz=yes],
[have_libz="no (requires zlib http://www.gzip.org/zlib/)"])],

View file

@ -35,6 +35,9 @@
#ifdef HAVE_SIGNAL_H
#include <signal.h>
#endif
#if HAVE_FEENABLEEXCEPT
#include <fenv.h>
#endif
#include <assert.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
@ -110,6 +113,10 @@ cairo_test_init (const char *test_name)
{
char *log_name;
#if HAVE_FEENABLEEXCEPT
feenableexcept (FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW);
#endif
xasprintf (&log_name, "%s%s", test_name, CAIRO_TEST_LOG_SUFFIX);
xunlink (log_name);