]> git.pond.sub.org Git - empserver/blob - tests/smoke-test
Trim trailing white space from source code
[empserver] / tests / smoke-test
1 #!/bin/sh -e
2 # Smoke 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: smoke test not expected to work with this thread package!" >&2
24 fi
25
26 create_sandbox
27
28 begin_test "$srcdir"/tests/smoke/fairland.xdump
29
30 feed_input POGO peter "$srcdir"/tests/smoke/newcap_script
31
32 t=
33 for i in `git ls-files "$srcdir"/tests/smoke | grep 'tests/smoke/../..$'`
34 do
35     p="$t"
36     t="${i%/??}"
37     if [ "$p" != "$t" ] && [ "$p" ]
38     then
39         feed_input POGO peter <<EOF
40 power new
41 report *
42 cen * ?own#0
43 comm * ?own#0
44 reso * ?own#0
45 force
46 EOF
47     fi
48     b="${i##*/}"
49     if [ $b -eq 0 ]
50     then c=POGO r=peter
51     else c="${b#0}"; r="$c"
52     fi
53     feed_input "$c" "$r" "$i"
54 done
55
56 end_test
57
58 cmp_out var/empire/server.log var/empire/journal.log smoke.xdump