diff --git a/utils/travis/mp_test_executor.sh b/utils/travis/mp_test_executor.sh index 5df5760082e..82ccab66fb1 100755 --- a/utils/travis/mp_test_executor.sh +++ b/utils/travis/mp_test_executor.sh @@ -6,18 +6,31 @@ set -v #Print shell commands as they are read TIMEOUT_TIME=300 LOOP_TIME=6 -./wesnothd --port 12345 --log-debug=server --log-warning=config & +./wesnothd --port 12345 --log-debug=server --log-warning=config &> wesnothd.log & serverpid=$! - sleep 5 -./wesnoth --plugin=host.lua --server=localhost:12345 --username=host --mp-test --noaddons --nogui & +./wesnoth --plugin=host.lua --server=localhost:12345 --username=host --mp-test --noaddons --nogui &> wesnoth-host.log & hostpid=$! +sleep 2 -sleep 5 +while grep -q 'Could not initialize SDL_video' wesnoth-host.log; do + echo "Could not initialize SDL_video error, retrying..." + ./wesnoth --plugin=host.lua --server=localhost:12345 --username=host --mp-test --noaddons --nogui &> wesnoth-host.log & + hostpid=$! + sleep 2 +done -./wesnoth --plugin=join.lua --server=localhost:12345 --username=join --mp-test --noaddons --nogui & +./wesnoth --plugin=join.lua --server=localhost:12345 --username=join --mp-test --noaddons --nogui &> wesnoth-join.log & joinpid=$! +sleep 2 + +while grep -q 'Could not initialize SDL_video' wesnoth-join.log; do + echo "Could not initialize SDL_video error, retrying..." + ./wesnoth --plugin=join.lua --server=localhost:12345 --username=join --mp-test --noaddons --nogui &> wesnoth-join.log & + joinpid=$! + sleep 2 +done START_TIME=$SECONDS HOST_RUNNING=yes @@ -65,4 +78,13 @@ wait $joinpid || STATUS=1 kill $serverpid +echo "Server log:" +cat wesnothd.log + +echo "Host log:" +cat wesnoth-host.log + +echo "Join log:" +cat wesnoth-join.log + exit $STATUS