-
Notifications
You must be signed in to change notification settings - Fork 43
/
Copy pathall.sh
executable file
·153 lines (133 loc) · 3.29 KB
/
all.sh
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
#!/bin/bash
SCRIPT_LOC=$(cd $(dirname ${BASH_SOURCE[0]}) && pwd)
CYAN='[0;36m'
RED='[0;31m'
GREEN='[0;32m'
YELLOW='[0;33m'
NORM='[0;00m'
DEFAULT_MODES=1
if [ "$TEST_MODE" != "" ]; then
DEFAULT_MODES=0
fi
# Progress arguments. By default the inline (i) mode is used, while the CI sets
# it to character (c) mode
PROGRESS_ARGS=${PROGRESS_ARGS:="tti"}
PROGRESS="progress $PROGRESS_ARGS"
### Utility for printing a testing line
### XXX: duplicated with common.sh
function print_testing() {
ARG=$1
printf "Testing ${CYAN}%-10s${NORM} " $harness
#TODO printf "%-13s " $ARG
printf "%-13s " $TEST_TARGET
if [ "$TEST_MODE" != "" ]; then
mode="-mode=$TEST_MODE"
else
mode=""
fi
printf "%-13s " $mode
printf "| "
}
function skip() {
harness=$1
shift
print_testing
printf "${YELLOW}skipped (%s)${NORM}\n" "$1"
}
function exit_if_failure() {
if [[ $1 != 0 ]]; then
exit $1
fi
}
if [ "$TEST_TARGETS" = "" ]; then
if [ "$TEST_TARGET" = "" ]; then
TEST_TARGETS="v3i x86-linux x86-64-linux jvm"
else
TEST_TARGETS="$TEST_TARGET"
fi
fi
function do_script() {
script=$1
$SCRIPT_LOC/${script}.sh || exit_if_failure $?
if [[ "$TEST_TARGET" = "x86-64-linux" && $DEFAULT_MODES = 1 ]]; then
TEST_MODE=jit $SCRIPT_LOC/${script}.sh || exit_if_failure $?
TEST_MODE=lazy $SCRIPT_LOC/${script}.sh || exit_if_failure $?
TEST_MODE=dyn $SCRIPT_LOC/${script}.sh || exit_if_failure $?
fi
}
# Unit tests
for target in $TEST_TARGETS; do
export TEST_TARGET=$target
$SCRIPT_LOC/unit.sh || exit_if_failure $?
done
# Regression tests
for target in $TEST_TARGETS; do
export TEST_TARGET=$target
do_script regress
done
# Spec tests
for target in $TEST_TARGETS; do
export TEST_TARGET=$target
if [ "$target" = v3i ]; then # TODO: out of memory depending on host v3c
skip spec "will run out of memory"
continue
fi
do_script spec
done
# Wizeng tests
for target in $TEST_TARGETS; do
export TEST_TARGET=$target
if [ "$target" = "" ]; then # for symmetry
skip wizeng
continue
fi
do_script wizeng/test
done
# Wizeng monitors tests
for target in $TEST_TARGETS; do
export TEST_TARGET=$target
if [ "$target" = "" ]; then # for symmetry
skip monitors
continue
fi
do_script monitors/test
do_script monitors/wasm-r3-tests/test
done
# Whamm monitors tests
for target in $TEST_TARGETS; do
export TEST_TARGET=$target
if [ "$target" = "" ]; then # for symmetry
skip whamm
continue
fi
do_script monitors/whamm/monitors/correctness/test
done
# Self-hosted (unit) tests
for target in $TEST_TARGETS; do
export TEST_TARGET=$target
if [ "$target" = v3i ]; then # TODO: out of memory depending on host v3c
skip selfhost "will run out of memory"
continue
fi
do_script selfhost
done
# Virgil tests
for target in $TEST_TARGETS; do
export TEST_TARGET=$target
if [ "$target" = v3i ]; then # TODO: runs really, really slow on v3i
skip virgil "runs too slowly"
continue
fi
do_script virgil/test
done
# Wasi tests
for target in $TEST_TARGETS; do
export TEST_TARGET=$target
do_script wasi/test
done
# linker tests
for target in $TEST_TARGETS; do
export TEST_TARGET=$target
do_script linker/test
done
exit 0