empserver/tests/actofgod-test
Markus Armbruster 00883256db Trim trailing white space from source code
Normally, git's pre-commit hook protects us from them.  However, when
expected test output contains trailing white space, we have to bypass
commit hooks.  Unwanted space can then slip in if you don't pay
attention.  I obviously didn't; clean up.

The previous commit should reduce the need for such hook suppression.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2014-01-06 20:49:59 +01:00

38 lines
881 B
Bash
Executable file

#!/bin/sh -e
# Acts of god test for Empire
if [ $# -ne 1 ]
then echo "Usage: $0 SRCDIR" >&2; exit 1
fi
srcdir="$1"
. "$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
WORLD_Y 16
EOF
begin_test "$srcdir"/tests/actofgod/init_script
perl "$srcdir"/tests/actofgod/geninput.pl | feed_input POGO peter
end_test
cmp_out var/empire/server.log var/empire/journal.log actofgod.xdump