@@ -51,37 +51,37 @@ endgroup
51
51
# - MANY_SEEDS: if set to N, run the "many-seeds" tests N times
52
52
# - TEST_BENCH: if non-empty, check that the benchmarks all build
53
53
function run_tests {
54
- if [ -n " ${MIRI_TEST_TARGET: - } " ]; then
54
+ if [ -n " ${MIRI_TEST_TARGET-} " ]; then
55
55
begingroup " Testing foreign architecture $MIRI_TEST_TARGET "
56
56
else
57
57
begingroup " Testing host architecture"
58
58
fi
59
59
60
60
# # ui test suite
61
- if [ -n " ${GC_STRESS: - } " ]; then
62
- MIRIFLAGS=" ${MIRIFLAGS: - } -Zmiri-provenance-gc=1" ./miri test
61
+ if [ -n " ${GC_STRESS-} " ]; then
62
+ MIRIFLAGS=" ${MIRIFLAGS-} -Zmiri-provenance-gc=1" ./miri test
63
63
else
64
64
./miri test
65
65
fi
66
66
67
67
# # advanced tests
68
- if [ -n " ${MIR_OPT: - } " ]; then
68
+ if [ -n " ${MIR_OPT-} " ]; then
69
69
# Tests with optimizations (`-O` is what cargo passes, but crank MIR optimizations up all the
70
70
# way, too).
71
71
# Optimizations change diagnostics (mostly backtraces), so we don't check
72
72
# them. Also error locations change so we don't run the failing tests.
73
73
# We explicitly enable debug-assertions here, they are disabled by -O but we have tests
74
74
# which exist to check that we panic on debug assertion failures.
75
- MIRIFLAGS=" ${MIRIFLAGS: - } -O -Zmir-opt-level=4 -Cdebug-assertions=yes" MIRI_SKIP_UI_CHECKS=1 ./miri test -- tests/{pass,panic}
75
+ MIRIFLAGS=" ${MIRIFLAGS-} -O -Zmir-opt-level=4 -Cdebug-assertions=yes" MIRI_SKIP_UI_CHECKS=1 ./miri test -- tests/{pass,panic}
76
76
fi
77
- if [ -n " ${MANY_SEEDS: - } " ]; then
77
+ if [ -n " ${MANY_SEEDS-} " ]; then
78
78
# Also run some many-seeds tests. 64 seeds means this takes around a minute per test.
79
79
# (Need to invoke via explicit `bash -c` for Windows.)
80
80
for FILE in tests/many-seeds/* .rs; do
81
81
MIRI_SEEDS=$MANY_SEEDS ./miri many-seeds " $BASH " -c " ./miri run '$FILE '"
82
82
done
83
83
fi
84
- if [ -n " ${TEST_BENCH: - } " ]; then
84
+ if [ -n " ${TEST_BENCH-} " ]; then
85
85
# Check that the benchmarks build and run, but without actually benchmarking.
86
86
HYPERFINE=" '$BASH ' -c" ./miri bench
87
87
fi
@@ -112,7 +112,7 @@ function run_tests {
112
112
}
113
113
114
114
function run_tests_minimal {
115
- if [ -n " ${MIRI_TEST_TARGET: - } " ]; then
115
+ if [ -n " ${MIRI_TEST_TARGET-} " ]; then
116
116
begingroup " Testing MINIMAL foreign architecture $MIRI_TEST_TARGET : only testing $@ "
117
117
else
118
118
echo " run_tests_minimal requires MIRI_TEST_TARGET to be set"
@@ -169,7 +169,7 @@ case $HOST_TARGET in
169
169
MIRI_TEST_TARGET=x86_64-unknown-linux-gnu run_tests
170
170
;;
171
171
* )
172
- echo " FATAL: unknown OS "
172
+ echo " FATAL: unknown host target: $HOST_TARGET "
173
173
exit 1
174
174
;;
175
175
esac
0 commit comments