summaryrefslogtreecommitdiffhomepage
path: root/contrib/all.sh
blob: 913abcb91d3d1428f97aab4d05256a4825cd0e4c (plain)
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
#!/bin/sh

set -eu
set_pipefail() { test $# -lt 5 && set -o pipefail || true; }
set_pipefail {1,2,3,4,5} # detect dash
beep() { printf \\a >&2; }
test -z "$MAGNUM_LOG" && export MAGNUM_LOG=default

trap 'cleanup $?' exit
cleanup() {
    local i ret=$1
    set +x
    for i in 1 2 3 4 5; do beep; sleep 0.2; done
    exit $ret
}

run_test() {
    local dir="$(basename -- "$PWD")"
    cd install/bin &&
    if test -e floormat-test-asan.exe; then
        ./floormat-test-asan "$@"
    else
        ./floormat-test "$@"
    fi
}

#cd "$(dirname -- "$0" || exit $?)"
cd f:/build/floormat
#set -x

configurations='
clang64 clang clang-asan clang-release
mingw64 gcc gcc-release
msvc64  msvc-debug msvc
'

printf "%s\\n" "$configurations" |
while read wrapper configs; do
    for i in $configs; do
        (
            cd $i
            printf -- "> Entering directory %s\\n" "$i"
            "$wrapper" cmake c:/repos/floormat >/dev/null
            "$wrapper" ninja "$@" install
            printf -- "* Running tests for %s\\n" "$i"
            run_test
            printf -- "< Exiting directory %s\\n" "$i"
        )
    done
done

exit 0