Commit 0c00ccec authored by Shane Snyder's avatar Shane Snyder

cleanup testing scripts

parent ed95feef
......@@ -14,6 +14,7 @@ MAINTAINERCLEANFILES =
EXTRA_DIST =
BUILT_SOURCES =
include_HEADERS = include/bake-bulk.h include/bake-bulk-client.h include/bake-bulk-server.h
TESTS_ENVIRONMENT =
EXTRA_DIST += \
prepare.sh
......
......@@ -38,6 +38,28 @@ 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
PKG_CHECK_MODULES([MARGO],[margo],[],
[AC_MSG_ERROR([Could not find working margo installation!])])
LIBS="$MARGO_LIBS $LIBS"
......
TESTS_ENVIRONMENT += \
TIMEOUT="$(TIMEOUT)" \
MKTEMP="$(MKTEMP)"
TESTS += \
tests/basic.sh \
tests/copy-to-and-from.sh
......
......@@ -2,10 +2,20 @@
# General test script utilities
#
if [ -z "$TIMEOUT" ] ; then
echo expected TIMEOUT variable defined to its respective command
exit 1
fi
if [ -z "$MKTEMP" ] ; then
echo expected MKTEMP variable defined to its respective command
exit 1
fi
TMPDIR=/dev/shm
export TMPDIR
mkdir -p $TMPDIR
TMPBASE=$(mktemp --tmpdir -d test-XXXXXX)
TMPBASE=$(${MKTEMP} --tmpdir -d test-XXXXXX)
echo "tmpbase: $TMPBASE"
......@@ -19,7 +29,7 @@ function run_to ()
{
maxtime=${1}s
shift
timeout --signal=9 $maxtime "$@"
${TIMEOUT} --signal=9 $maxtime "$@"
}
function test_start_servers ()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment