File tree Expand file tree Collapse file tree 1 file changed +18
-15
lines changed Expand file tree Collapse file tree 1 file changed +18
-15
lines changed Original file line number Diff line number Diff line change 30
30
31
31
# Run the tests for a specific target
32
32
test_target () {
33
- target=" ${1} "
34
- no_dist=" ${2 :- 0} "
33
+ target=" $1 "
34
+ no_dist=" $2 "
35
35
36
36
RUSTFLAGS=" ${RUSTFLAGS:- } "
37
37
@@ -269,7 +269,13 @@ case "$rust" in
269
269
* ) supports_wasi_pn=0 ;;
270
270
esac
271
271
272
- for target in $targets ; do
272
+ some_tests_run=0
273
+
274
+ # Apply the `FILTER` variable, do OS-specific tasks, and run a target
275
+ filter_and_run () {
276
+ target=" $1 "
277
+ no_dist=" ${2:- 0} "
278
+
273
279
if echo " $target " | grep -q " $filter " ; then
274
280
if [ " $os " = " windows" ]; then
275
281
TARGET=" $target " ./ci/install-rust.sh
@@ -282,27 +288,24 @@ for target in $targets; do
282
288
283
289
# `wasm32-wasip2` only exists in recent versions of Rust
284
290
if [ " $target " = " wasm32-wasip2" ] && [ " $supports_wasi_pn " = " 0" ]; then
285
- continue
291
+ return
286
292
fi
287
293
288
- test_target " $target "
289
- test_run =1
294
+ test_target " $target " " $no_dist "
295
+ some_tests_run =1
290
296
fi
297
+ }
298
+
299
+ for target in $targets ; do
300
+ filter_and_run " $target "
291
301
done
292
302
293
303
for target in ${no_dist_targets:- } ; do
294
- if echo " $target " | grep -q " $filter " ; then
295
- if [ " $os " = " windows" ]; then
296
- TARGET=" $target " ./ci/install-rust.sh
297
- fi
298
-
299
- test_target " $target " 1
300
- test_run=1
301
- fi
304
+ filter_and_run " $target " 1
302
305
done
303
306
304
307
# Make sure we didn't accidentally filter everything
305
- if [ " ${test_run :- } " != 1 ]; then
308
+ if [ " $some_tests_run " != 1 ]; then
306
309
echo " No tests were run"
307
310
exit 1
308
311
fi
You can’t perform that action at this time.
0 commit comments