@@ -11,6 +11,7 @@ set -eux
1111: " ${OS?The OS environment variable must be set.} "
1212
1313rust=" $TOOLCHAIN "
14+ filter=" ${FILTER:- } "
1415
1516echo " Testing Rust $rust on $OS "
1617
2122test_target () {
2223 build_cmd=" ${1} "
2324 target=" ${2} "
24- no_std=" ${3} "
25+ no_std=" ${3:- } "
2526
2627 # If there is a std component, fetch it:
2728 if [ " ${no_std} " != " 1" ]; then
@@ -196,13 +197,15 @@ case "${OS}" in
196197esac
197198
198199for target in $targets ; do
199- if echo " $target " | grep -q " $FILTER " ; then
200+ if echo " $target " | grep -q " $filter " ; then
200201 if [ " ${OS} " = " windows" ]; then
201202 TARGET=" $target " sh ./ci/install-rust.sh
202203 test_target build " $target "
203204 else
204205 test_target build " $target "
205206 fi
207+
208+ test_run=1
206209 fi
207210done
208211
@@ -276,8 +279,10 @@ x86_64-wrs-vxworks \
276279if [ " ${rust} " = " nightly" ] && [ " ${OS} " = " linux" ]; then
277280 for target in $rust_linux_no_core_targets ; do
278281 if echo " $target " | grep -q " $FILTER " ; then
279- test_target build " $target " 1
282+ test_target " $target " 1
280283 fi
284+
285+ test_run=1
281286 done
282287fi
283288
@@ -290,7 +295,15 @@ i386-apple-ios \
290295if [ " ${rust} " = " nightly" ] && [ " ${OS} " = " macos" ]; then
291296 for target in $rust_apple_no_core_targets ; do
292297 if echo " $target " | grep -q " $FILTER " ; then
293- test_target build " $target " 1
298+ test_target " $target " 1
294299 fi
300+
301+ test_run=1
295302 done
296303fi
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