#!/usr/bin/env bash if [[ $1 != "" ]]; then N_RUNS=$1 else N_RUNS=3 fi if [[ "$RUNFROMSHELL" != "" ]]; then if [[ ${CIRRUS_CI} != "true" ]]; then echo "Running from shell. Skipping run tests $*" exit 0 fi fi export SDL_VIDEODRIVER="dummy" ulimit -c unlimited -S ulimit -c unlimited rm -rf core* sysctl -w kernel.core_pattern=core export HOME="logs/home" rm -rf $HOME export ASAN_OPTIONS=detect_stack_use_after_return=true:strict_init_order=true echo "clean config runs" n=0 while true; do echo "run test ${n}/${N_RUNS}" echo "clean configs and logs" silent_rm "${HOME}/.config/mana/mana/config.xml" silent_rm "/root/.config/mana/mana/config.xml" silent_rm "${HOME}/.config/mana/mana/serverlistplus.xml" silent_rm "/root/.config/mana/mana/serverlistplus.xml" silent_rm "${HOME}/.local/share/mana/manaplus.log" silent_rm "/root/.local/share/mana/manaplus.log" ./tools/ci/scripts/runtest.sh if [ "$?" != 0 ]; then exit 1 fi if [[ $n -ge $N_RUNS ]]; then break fi sleep 5 n=$((n+1)) done exit 0 echo "existing config runs" n=0 while true; do echo "run test ${n}" silent_rm "${HOME}/.local/share/mana/manaplus.log" silent_rm "/root/.local/share/mana/manaplus.log" ./tools/ci/scripts/runtest.sh if [ "$?" != 0 ]; then exit 1 fi if [[ $n -ge 1 ]]; then exit 0 fi sleep 5 n=$((n+1)) done