@@ -11,6 +11,7 @@ set -eux
11
11
: " ${OS?The OS environment variable must be set.} "
12
12
13
13
rust=" $TOOLCHAIN "
14
+ filter=" ${FILTER:- } "
14
15
15
16
echo " Testing Rust $rust on $OS "
16
17
21
22
test_target () {
22
23
build_cmd=" ${1} "
23
24
target=" ${2} "
24
- no_std=" ${3} "
25
+ no_std=" ${3:- } "
25
26
26
27
# If there is a std component, fetch it:
27
28
if [ " ${no_std} " != " 1" ]; then
@@ -196,13 +197,15 @@ case "${OS}" in
196
197
esac
197
198
198
199
for target in $targets ; do
199
- if echo " $target " | grep -q " $FILTER " ; then
200
+ if echo " $target " | grep -q " $filter " ; then
200
201
if [ " ${OS} " = " windows" ]; then
201
202
TARGET=" $target " sh ./ci/install-rust.sh
202
203
test_target build " $target "
203
204
else
204
205
test_target build " $target "
205
206
fi
207
+
208
+ test_run=1
206
209
fi
207
210
done
208
211
@@ -276,8 +279,10 @@ x86_64-wrs-vxworks \
276
279
if [ " ${rust} " = " nightly" ] && [ " ${OS} " = " linux" ]; then
277
280
for target in $rust_linux_no_core_targets ; do
278
281
if echo " $target " | grep -q " $FILTER " ; then
279
- test_target build " $target " 1
282
+ test_target " $target " 1
280
283
fi
284
+
285
+ test_run=1
281
286
done
282
287
fi
283
288
@@ -290,7 +295,15 @@ i386-apple-ios \
290
295
if [ " ${rust} " = " nightly" ] && [ " ${OS} " = " macos" ]; then
291
296
for target in $rust_apple_no_core_targets ; do
292
297
if echo " $target " | grep -q " $FILTER " ; then
293
- test_target build " $target " 1
298
+ test_target " $target " 1
294
299
fi
300
+
301
+ test_run=1
295
302
done
296
303
fi
304
+
305
+ # Make sure we didn't accidentally filter everything
306
+ if [ " ${test_run:- } " != 1 ]; then
307
+ echo " No tests were run"
308
+ exit 1
309
+ fi
0 commit comments