diff --git a/configure.ac b/configure.ac index 0951dab..836281f 100644 --- a/configure.ac +++ b/configure.ac @@ -22,6 +22,11 @@ AC_SUBST([LIBTOOL_DEPS]) AC_FUNC_FNMATCH +enable_rt_tests="no" +AC_CHECK_LIB([rt], [clock_gettime], [enable_rt_tests="yes"]) + +AM_CONDITIONAL([ENABLE_RT_TESTS], [test "x$enable_rt_tests" != "xno"]) + AM_GNU_GETTEXT([external]) AM_GNU_GETTEXT_VERSION([0.18]) diff --git a/samples/Makefile.am b/samples/Makefile.am index a1d7231..7ed5f12 100644 --- a/samples/Makefile.am +++ b/samples/Makefile.am @@ -8,7 +8,6 @@ BIN_TESTS = \ long-messages \ description \ other-crashes \ - with-time \ simple TESTS_ENVIRONMENT = CRITERION_ALWAYS_SUCCEED=1 @@ -17,7 +16,10 @@ check_PROGRAMS := $(BIN_TESTS) CFLAGS = -I$(top_srcdir)/include/ -std=c99 -Wall -Wextra -pedantic LDADD = -L$(top_srcdir)/ -lcriterion +if ENABLE_RT_TESTS +BIN_TESTS += with-time with_time_LDADD = $(LDADD) -lrt +endif SCRIPT_TESTS = tests/tap_test.sh \ tests/early_exit.sh \