empserver/tests/fairland-test

31 lines
740 B
Bash
Executable file

#!/bin/sh -e
# Basic fairland test
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 a random() that behaves exactly
# like the one on my development system.
#
if [ "`uname -s`" != "Linux" ] # lame approx. of "random() behaves like mine"
then echo "Warning: fairland test not expected to work on this system!" >&2
fi
create_sandbox
exec 3>sandbox/fairland.out
src/util/files -e sandbox/etc/empire/econfig -f >&3
src/util/fairland -e sandbox/etc/empire/econfig -s sandbox/newcap_script -R 1 10 30 >&3
exec 3>&-
src/util/empdump -e sandbox/etc/empire/econfig -x >sandbox/fairland.xdump
cmp_out fairland.out fairland.xdump newcap_script