summaryrefslogtreecommitdiff
path: root/tools/ci/scripts/runtests.sh
blob: 895f62f748ea6170bde92696e781bfa09016045a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/usr/bin/env bash

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}"
    rm "${HOME}/.config/mana/manaverse/config.xml"
    rm "/root/.config/mana/manaverse/config.xml"
    rm "${HOME}/.config/mana/manaverse/serverlistplus.xml"
    rm "/root/.config/mana/manaverse/serverlistplus.xml"
    rm "${HOME}/.local/share/mana/manaverse.log"
    rm "/root/.local/share/mana/manaverse.log"
    ./tools/ci/scripts/runtest.sh
    if [ "$?" != 0 ]; then
        exit 1
    fi
    if [[ $n -ge 2 ]]; then # Do a second test just to be on the safe side
        break
    fi
    sleep 5
    n=$((n+1))
done

exit 0

echo "existing config runs"
n=0
while true; do
    echo "run test ${n}"
    rm "${HOME}/.local/share/mana/manaverse.log"
    rm "/root/.local/share/mana/manaverse.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