]> git.pond.sub.org Git - empserver/blobdiff - tests/smoke-test
client: Unbreak standalone build
[empserver] / tests / smoke-test
index 670eebadacc1092d5c75de449eca4b4f4613017e..682d03b857da2192b21164fa20b3fae6400a0650 100755 (executable)
@@ -9,73 +9,13 @@ srcdir="$1"
 
 . "$srcdir"/tests/test-common.sh
 
-#
-# Currently expected to work only with thread package LWP and a
-# random() that behaves exactly like the one on my development system,
-# because:
-# 
-# - Thread scheduling is reliably deterministic only with LWP
-# - The PRN sequence produced by random() isn't portable
-# - 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 [ "`uname -s`" != "Linux" ] # lame approx. of "random() behaves like mine"
-then echo "Warning: smoke test not expected to work on this system!" >&2
-elif [ `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
 
-exec 3>sandbox/smoke.out
-
-# Create world and start server
-src/util/files -e sandbox/etc/empire/econfig -f >&3
-src/util/fairland -e sandbox/etc/empire/econfig -q -s sandbox/newcap_script -R 1 10 30
-start_server
-src/client/empire POGO peter <sandbox/newcap_script >/dev/null
-
-# Feed player input
-need_update=
-for i in "$srcdir"/tests/smoke/[0-9]*
-do
-    t="${i##*/}"
-    if [ "$need_update" ]
-    then
-       echo "Update Turn $t starting" >&3
-       src/client/empire POGO peter <<EOF >&3
-power new
-report *
-cen * ?own#0
-comm * ?own#0
-reso * ?own#0
-force
-EOF
-       echo "Update Turn $t completed successfully" >&3
-    fi
-    for j in "$i"/*
-    do
-       p="${j##*/}"
-       echo "Player $p Turn $t starting" >&3
-       if [ $p -eq 0 ]
-       then c=POGO r=peter
-       else c="${p#0}"; r="$c"
-       fi
-       src/client/empire "$c" "$r" <$j >&3
-       echo "Player $p Turn $t completed successfully" >&3
-    done
-    need_update=y
-done
-
-# Stop server
-stop_server
+begin_test "$srcdir"/tests/smoke/fairland.xdump
 
-exec 3>&-
+feed_input POGO peter "$srcdir"/tests/smoke/newcap_script
+feed_dir "$srcdir"/tests/smoke
 
-src/util/empdump -e sandbox/etc/empire/econfig -x >sandbox/smoke.xdump
+end_test
 
-# Smoke test completed; compare results
-cmp_out smoke.out var/empire/server.log var/empire/journal.log smoke.xdump
+cmp_logs_xdump