From 9d4ed679940f73b0d538685781fade3a62646616 Mon Sep 17 00:00:00 2001 From: Shane Snyder Date: Wed, 1 Nov 2017 12:21:20 -0500 Subject: [PATCH] add timeout & mktemp to test environment --- Makefile.am | 1 + configure.ac | 24 +++++++++++++++++++++++- tests/Makefile.subdir | 4 ++++ 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 11ec5c2..4a10556 100644 --- a/Makefile.am +++ b/Makefile.am @@ -8,6 +8,7 @@ noinst_PROGRAMS = bin_PROGRAMS = check_PROGRAMS = TESTS = +TESTS_ENVIRONMENT= EXTRA_DIST = prepare.sh AM_CPPFLAGS = -I$(top_srcdir)/include diff --git a/configure.ac b/configure.ac index 0793fad..1a0c27c 100644 --- a/configure.ac +++ b/configure.ac @@ -15,12 +15,34 @@ AM_PROG_CC_C_O AC_PROG_INSTALL # checks for libraires -#pkg-config and libraries supporting that +# pkg-config and libraries supporting that PKG_PROG_PKG_CONFIG if test "x$PKG_CONFIG" == "x"; then AC_MSG_ERROR([Could not find pkg-config utility!]) fi +# coreutils checks for OSX +AC_ARG_VAR([TIMEOUT], timeout program) +AC_ARG_VAR([MKTEMP], mktemp program) + +if test -z "$TIMEOUT" ; then + AC_CHECK_PROGS(TIMEOUT, [timeout gtimeout]) + if test -z "$TIMEOUT" ; then + AC_MSG_ERROR([Could not find timeout command (can optionally provide via the TIMEOUT variable)]) + fi +else + AC_SUBST([TIMEOUT], ["$TIMEOUT"]) +fi + +if test -z "$MKTEMP" ; then + AC_CHECK_PROGS(MKTEMP, [mktemp gmktemp]) + if test -z "$MKTEMP" ; then + AC_MSG_ERROR([Could not find mktemp command (can optionally provide via the MKTEMP variable)]) + fi +else + AC_SUBST([MKTEMP], ["$MKTEMP"]) +fi + # check for MPI -- currently required for SSG on server daemons AC_MSG_CHECKING([If MPI programs can be compiled]) AC_LINK_IFELSE( diff --git a/tests/Makefile.subdir b/tests/Makefile.subdir index e9e3c55..ed96dca 100644 --- a/tests/Makefile.subdir +++ b/tests/Makefile.subdir @@ -1,3 +1,7 @@ +TESTS_ENVIRONMENT += \ + TIMEOUT="$(TIMEOUT)" \ + MKTEMP="$(MKTEMP)" + check_PROGRAMS += \ tests/mobject-connect-test \ tests/mobject-server \ -- 2.22.0