summaryrefslogtreecommitdiff
path: root/tools/ci/scripts/runtests.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tools/ci/scripts/runtests.sh')
-rwxr-xr-xtools/ci/scripts/runtests.sh27
1 files changed, 17 insertions, 10 deletions
diff --git a/tools/ci/scripts/runtests.sh b/tools/ci/scripts/runtests.sh
index 9f0a6729f..528ea69cc 100755
--- a/tools/ci/scripts/runtests.sh
+++ b/tools/ci/scripts/runtests.sh
@@ -1,5 +1,11 @@
#!/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 $*"
@@ -21,18 +27,19 @@ 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}"
- rm "${HOME}/.config/mana/mana/config.xml"
- rm "/root/.config/mana/mana/config.xml"
- rm "${HOME}/.config/mana/mana/serverlistplus.xml"
- rm "/root/.config/mana/mana/serverlistplus.xml"
- rm "${HOME}/.local/share/mana/manaplus.log"
- rm "/root/.local/share/mana/manaplus.log"
+ 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 3 ]]; then
+ if [[ $n -ge $N_RUNS ]]; then
break
fi
sleep 5
@@ -45,8 +52,8 @@ echo "existing config runs"
n=0
while true; do
echo "run test ${n}"
- rm "${HOME}/.local/share/mana/manaplus.log"
- rm "/root/.local/share/mana/manaplus.log"
+ 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