2 # Smoke test for Empire
5 then echo "Usage: $0 SRCDIR" >&2; exit 1
10 . "$srcdir"/tests/test-common.sh
13 # Currently expected to work only with thread package LWP, because:
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
20 # TODO address these shortcomings.
22 if [ `sed -n 's/empthread *:= *\(.*\)/\1/p' <GNUmakefile` != LWP ]
23 then echo "Warning: smoke test not expected to work with this thread package!" >&2
28 exec 3>sandbox/smoke.out
30 # Create world and start server
31 src/util/files -e sandbox/etc/empire/econfig -f >&3
32 src/util/empdump -e sandbox/etc/empire/econfig -i "$srcdir"/tests/smoke/fairland.xdump
34 src/client/empire POGO peter <"$srcdir"/tests/smoke/newcap_script >/dev/null
38 for i in "$srcdir"/tests/smoke/[0-9]*
43 echo "Update Turn $t starting" >&3
44 src/client/empire POGO peter <<EOF >&3
52 echo "Update Turn $t completed successfully" >&3
57 echo "Player $p Turn $t starting" >&3
60 else c="${p#0}"; r="$c"
62 src/client/empire "$c" "$r" <$j >&3
63 echo "Player $p Turn $t completed successfully" >&3
73 src/util/empdump -e sandbox/etc/empire/econfig -x >sandbox/smoke.xdump
75 # Smoke test completed; compare results
76 cmp_out smoke.out var/empire/server.log var/empire/journal.log smoke.xdump