Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
chuck cranor
margo
Commits
8a302896
Commit
8a302896
authored
Jun 10, 2016
by
Jonathan Jenkins
Browse files
build tweaks to support testing on OSX
parent
ae222928
Changes
5
Hide whitespace changes
Inline
Side-by-side
Makefile.am
View file @
8a302896
...
...
@@ -16,6 +16,7 @@ MAINTAINERCLEANFILES =
EXTRA_DIST
=
BUILT_SOURCES
=
include_HEADERS
=
include/margo.h
TESTS_ENVIRONMENT
=
EXTRA_DIST
+=
\
prepare.sh
...
...
configure.ac
View file @
8a302896
...
...
@@ -25,6 +25,28 @@ AC_PROG_RANLIB
AC_PROG_MKDIR_P
# 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
AC_REQUIRE_CPP
AC_CHECK_SIZEOF([long int])
...
...
tests/Makefile.subdir
View file @
8a302896
TESTS_ENVIRONMENT
+=
\
TIMEOUT
=
"
$(TIMEOUT)
"
\
MKTEMP
=
"
$(MKTEMP)
"
check_PROGRAMS
+=
\
examples/sleep
\
examples/server
\
...
...
tests/test-util-hang.sh
View file @
8a302896
...
...
@@ -2,12 +2,16 @@
# General test script utilities
#
if
[
-z
"
$TIMEOUT
"
]
;
then
echo
expected TIMEOUT variable defined to its respective
command
exit
1
fi
function
run_to
()
{
maxtime
=
${
1
}
s
shift
timeout
--signal
=
9
$maxtime
"
$@
"
$TIMEOUT
--signal
=
9
$maxtime
"
$@
"
}
function
test_start_servers
()
...
...
@@ -23,7 +27,7 @@ function test_start_servers ()
# start daemons
for
i
in
`
seq
$startport
$endport
`
do
timeout
--signal
=
9
${
maxtime
}
examples/server-hang tcp://localhost:
$i
&
$TIMEOUT
--signal
=
9
${
maxtime
}
examples/server-hang tcp://localhost:
$i
&
if
[
$?
-ne
0
]
;
then
# TODO: this doesn't actually work; can't check return code of
# something executing in background. We have to rely on the
...
...
tests/timeout.sh
View file @
8a302896
...
...
@@ -4,9 +4,15 @@ if [ -z $srcdir ]; then
echo
srcdir variable not set.
exit
1
fi
if
[
-z
"
$MKTEMP
"
]
;
then
echo
expected MKTEMP variable defined to its respective
command
exit
1
fi
source
$srcdir
/tests/test-util-hang.sh
TMPOUT
=
$(
mktemp
--tmpdir
test-XXXXXX
)
TMPOUT
=
$(
$MKTEMP
--tmpdir
test-XXXXXX
)
# start 1 server with 2 second wait, 8s timeout
test_start_servers 1 2 8
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment