]> git.pond.sub.org Git - empserver/blob - tests/actofgod-test
tests: New helper function feed_input, for comment support
[empserver] / tests / actofgod-test
1 #!/bin/sh -e
2 # Acts of god test for Empire
3
4 if [ $# -ne 1 ]
5 then echo "Usage: $0 SRCDIR" >&2; exit 1
6 fi
7
8 srcdir="$1"
9
10 . "$srcdir"/tests/test-common.sh
11
12 #
13 # Currently expected to work only with thread package LWP, because:
14
15 # - Thread scheduling is reliably deterministic only with LWP
16 # - Shell builtin kill appears not to do the job in MinGW
17 # - The Windows server tries to run as service when -d isn't
18 #   specified
19 #
20 # TODO address these shortcomings.
21 #
22 if [ `sed -n 's/empthread *:= *\(.*\)/\1/p' <GNUmakefile` != LWP ]
23 then echo "Warning: test not expected to work with this thread package!" >&2
24 fi
25
26 create_sandbox
27 cat >>sandbox/etc/empire/econfig <<EOF
28 WORLD_X 24
29 WORLD_Y 16
30 EOF
31
32 begin_test "$srcdir"/tests/actofgod/init_script
33
34 perl "$srcdir"/tests/actofgod/geninput.pl | feed_input POGO peter
35
36 end_test
37
38 cmp_out var/empire/server.log var/empire/journal.log actofgod.xdump