@@ -30,16 +30,23 @@ endgroup
30
30
31
31
# Test
32
32
function run_tests {
33
- if [ -n " ${MIRI_TEST_TARGET+exists } " ]; then
33
+ if [ -n " ${MIRI_TEST_TARGET:- } " ]; then
34
34
begingroup " Testing foreign architecture $MIRI_TEST_TARGET "
35
35
else
36
36
begingroup " Testing host architecture"
37
37
fi
38
38
39
39
# # ui test suite
40
- ./miri test
41
- if [ -z " ${MIRI_TEST_TARGET+exists} " ]; then
42
- # Host-only tests: running these on all targets is unlikely to catch more problems and would
40
+ # On the host and on Linux, also stress-test the GC.
41
+ if [ -z " ${MIRI_TEST_TARGET:- } " ] || [ " $HOST_TARGET " = x86_64-unknown-linux-gnu ]; then
42
+ MIRIFLAGS=" ${MIRIFLAGS:- } -Zmiri-provenance-gc=1" ./miri test
43
+ else
44
+ ./miri test
45
+ fi
46
+
47
+ # Host-only tests
48
+ if [ -z " ${MIRI_TEST_TARGET:- } " ]; then
49
+ # Running these on all targets is unlikely to catch more problems and would
43
50
# cost a lot of CI time.
44
51
45
52
# Tests with optimizations (`-O` is what cargo passes, but crank MIR optimizations up all the
@@ -85,10 +92,11 @@ function run_tests {
85
92
}
86
93
87
94
function run_tests_minimal {
88
- if [ -n " ${MIRI_TEST_TARGET+exists } " ]; then
95
+ if [ -n " ${MIRI_TEST_TARGET:- } " ]; then
89
96
begingroup " Testing MINIMAL foreign architecture $MIRI_TEST_TARGET : only testing $@ "
90
97
else
91
- begingroup " Testing MINIMAL host architecture: only testing $@ "
98
+ echo " run_tests_minimal requires MIRI_TEST_TARGET to be set"
99
+ exit 1
92
100
fi
93
101
94
102
./miri test -- " $@ "
@@ -99,15 +107,20 @@ function run_tests_minimal {
99
107
endgroup
100
108
}
101
109
102
- # host
110
+ # # Main Testing Logic ##
111
+
112
+ # Host target.
103
113
run_tests
104
114
115
+ # Extra targets.
116
+ # In particular, fully cover all tier 1 targets.
105
117
case $HOST_TARGET in
106
118
x86_64-unknown-linux-gnu)
107
119
MIRI_TEST_TARGET=i686-unknown-linux-gnu run_tests
108
120
MIRI_TEST_TARGET=aarch64-unknown-linux-gnu run_tests
109
121
MIRI_TEST_TARGET=aarch64-apple-darwin run_tests
110
122
MIRI_TEST_TARGET=i686-pc-windows-gnu run_tests
123
+ # Some targets are only partially supported.
111
124
MIRI_TEST_TARGET=x86_64-unknown-freebsd run_tests_minimal hello integer vec panic/panic concurrency/simple pthread-threadname libc-getentropy libc-getrandom libc-misc libc-fs atomic env align
112
125
MIRI_TEST_TARGET=i686-unknown-freebsd run_tests_minimal hello integer vec panic/panic concurrency/simple pthread-threadname libc-getentropy libc-getrandom libc-misc libc-fs atomic env align
113
126
MIRI_TEST_TARGET=aarch64-linux-android run_tests_minimal hello integer vec panic/panic
0 commit comments