. "$srcdir"/tests/test-common.sh
-#
-# Currently expected to work only with thread package LWP, because:
-#
-# - Thread scheduling is reliably deterministic only with LWP
-# - Shell builtin kill appears not to do the job in MinGW
-# - The Windows server tries to run as service when -d isn't
-# specified
-#
-# TODO address these shortcomings.
-#
-if [ `sed -n 's/empthread *:= *\(.*\)/\1/p' <GNUmakefile` != LWP ]
-then echo "Warning: test not expected to work with this thread package!" >&2
-fi
-
create_sandbox
cat >>sandbox/etc/empire/econfig <<EOF
WORLD_X 24
. "$srcdir"/tests/test-common.sh
-#
-# Currently expected to work only with thread package LWP, because:
-#
-# - Thread scheduling is reliably deterministic only with LWP
-# - Shell builtin kill appears not to do the job in MinGW
-# - The Windows server tries to run as service when -d isn't
-# specified
-#
-# TODO address these shortcomings.
-#
-if [ `sed -n 's/empthread *:= *\(.*\)/\1/p' <GNUmakefile` != LWP ]
-then echo "Warning: test not expected to work with this thread package!" >&2
-fi
-
create_sandbox
cat >>sandbox/etc/empire/econfig <<EOF
WORLD_X 32
create_sandbox
+# begin_test warns POSIX isn't expected to work, because thread
+# scheduling isn't reliably deterministic. Not an issue for this
+# test, so suppress the warning.
+[ "$empthread" = POSIX ] && warn_empthread=
+
begin_test <<EOF
add 1 1 1 p
des 0:2,0 -
. "$srcdir"/tests/test-common.sh
-#
-# Currently expected to work only with thread package LWP, because:
-#
-# - Thread scheduling is reliably deterministic only with LWP
-# - Shell builtin kill appears not to do the job in MinGW
-# - The Windows server tries to run as service when -d isn't
-# specified
-#
-# TODO address these shortcomings.
-#
-if [ `sed -n 's/empthread *:= *\(.*\)/\1/p' <GNUmakefile` != LWP ]
-then echo "Warning: smoke test not expected to work with this thread package!" >&2
-fi
-
create_sandbox
begin_test "$srcdir"/tests/smoke/fairland.xdump
test=${0##*/}
test=${test%-test}
+empthread=`sed -n 's/empthread *:= *\(.*\)/\1/p' <GNUmakefile`
+warn_empthread=y
+
+check_empthread()
+{
+ if [ "$warn_empthread" ] && [ "$empthread" != "LWP" ]
+ then
+ echo "Warning: test not expected to work with thread package $empthread!" >&2
+ warn_empthread=
+ fi
+}
+
create_sandbox()
{
rm -rf sandbox
{
local pidfile=sandbox/var/empire/server.pid
local timeout
+
+ #
+ # Currently expected to work only with thread package LWP,
+ # because:
+ #
+ # - Thread scheduling is reliably deterministic only with LWP
+ # - Shell builtin kill appears not to do the job in MinGW
+ # - The Windows server tries to run as service when -d isn't
+ # specified
+ #
+ # TODO address these shortcomings.
+ #
+ check_empthread
+
pid=
trap 'if [ "$pid" ]; then kill -9 "$pid" 2>/dev/null || true; fi' EXIT
src/server/emp_server -e sandbox/etc/empire/econfig -R 1 -s