From df05163715bd33dfe7a50d1f68f0ed997b281923 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 3 Jul 2016 18:06:59 +0300 Subject: Run all servers in travis check. --- travis.sh | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) (limited to 'travis.sh') diff --git a/travis.sh b/travis.sh index b1f639935..646532374 100755 --- a/travis.sh +++ b/travis.sh @@ -44,6 +44,23 @@ function aborterror { exit 1 } +function run_server { + $1 --run-once $2 2>runlog.txt + export errcode=$? + export teststr=$(cat runlog.txt) + if [[ -n "${teststr}" ]]; then + echo "Errors found in running server $1." + cat runlog.txt + aborterror "Errors found in running server $1." + else + echo "No errors found for server $1." + fi + if [ ${errcode} -ne 0 ]; then + echo "server $1 terminated with exit code ${errcode}" + aborterror "Test failed" + fi +} + case "$MODE" in createdb|importdb|test) DBNAME="$1" @@ -112,20 +129,9 @@ EOF ARGS="--load-script npc/dev/test.txt " ARGS="--load-plugin script_mapquit $ARGS --load-script npc/dev/ci_test.txt" echo "Running Hercules with command line: ./map-server --run-once $ARGS" - ./map-server --run-once $ARGS 2>runlog.txt - export errcode=$? - export teststr=$(cat runlog.txt) - if [[ -n "${teststr}" ]]; then - echo "Sanitizer errors found." - cat runlog.txt - aborterror "Sanitize errors found." - else - echo "No sanitizer errors found." - fi - if [ ${errcode} -ne 0 ]; then - echo "server terminated with exit code ${errcode}" - aborterror "Test failed" - fi + run_server ./login-server + run_server ./char-server + run_server ./map-server "$ARGS" ;; getplugins) echo "Cloning plugins repository..." -- cgit v1.2.3-60-g2f50