61 lines
1.2 KiB
Bash
Executable file
61 lines
1.2 KiB
Bash
Executable file
#!/bin/sh -e
|
|
# Smoke 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: smoke test not expected to work with this thread package!" >&2
|
|
fi
|
|
|
|
create_sandbox
|
|
|
|
begin_test "$srcdir"/tests/smoke/fairland.xdump
|
|
|
|
src/client/empire POGO peter <"$srcdir"/tests/smoke/newcap_script >/dev/null
|
|
|
|
need_update=
|
|
for i in "$srcdir"/tests/smoke/[0-9]*
|
|
do
|
|
t="${i##*/}"
|
|
if [ "$need_update" ]
|
|
then
|
|
src/client/empire POGO peter <<EOF >/dev/null
|
|
power new
|
|
report *
|
|
cen * ?own#0
|
|
comm * ?own#0
|
|
reso * ?own#0
|
|
force
|
|
EOF
|
|
fi
|
|
for j in "$i"/*
|
|
do
|
|
p="${j##*/}"
|
|
if [ $p -eq 0 ]
|
|
then c=POGO r=peter
|
|
else c="${p#0}"; r="$c"
|
|
fi
|
|
src/client/empire "$c" "$r" <$j >/dev/null
|
|
done
|
|
need_update=y
|
|
done
|
|
|
|
end_test
|
|
|
|
cmp_out var/empire/server.log var/empire/journal.log smoke.xdump
|