2 dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
3 gameid=${gameid:-devtest}
4 minetest=$dir/../bin/minetest
5 testspath=$dir/../tests
6 conf_client1=$testspath/client1.conf
7 conf_server=$testspath/server.conf
8 worldpath=$testspath/world
12 while [ $n -gt 0 ]; do
13 [ -f "$1" ] && return 0
17 echo "Waiting for ${1##*/} timed out"
23 gdb -q -batch -ex 'set confirm off' -ex 'r' -ex 'bt' --args "$@"
26 [ -e $minetest ] || { echo "executable $minetest missing"; exit 1; }
29 mkdir -p $worldpath/worldmods
31 printf '%s\n' >$testspath/client1.conf \
32 video_driver=null name=client1 viewing_range=10 \
33 enable_{sound,minimap,shaders}=false
35 printf '%s\n' >$testspath/server.conf \
36 max_block_send_distance=1 devtest_unittests_autostart=true \
39 ln -s $dir/helper_mod $worldpath/worldmods/
41 echo "Starting server"
42 gdbrun $minetest --server --config $conf_server --world $worldpath --gameid $gameid 2>&1 | sed -u 's/^/(server) /' &
43 waitfor $worldpath/startup
45 echo "Starting client"
46 gdbrun $minetest --config $conf_client1 --go --address 127.0.0.1 2>&1 | sed -u 's/^/(client) /' &
47 waitfor $worldpath/done
49 echo "Waiting for client and server to exit"
52 if [ -f $worldpath/test_failure ]; then
53 echo "There were test failures."