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
@@ -265,7 +265,13 @@ case "$rust" in
265
265
* ) supports_wasi_pn=0 ;;
266
266
esac
267
267
268
- for target in $targets ; do
268
+ some_tests_run=0
269
+
270
+ # Apply the `FILTER` variable, do OS-specific tasks, and run a target
271
+ filter_and_run () {
272
+ target=" $1 "
273
+ no_dist=" ${2:- 0} "
274
+
269
275
if echo " $target " | grep -q " $filter " ; then
270
276
if [ " $os " = " windows" ]; then
271
277
TARGET=" $target " ./ci/install-rust.sh
@@ -278,27 +284,24 @@ for target in $targets; do
278
284
279
285
# `wasm32-wasip2` only exists in recent versions of Rust
280
286
if [ " $target " = " wasm32-wasip2" ] && [ " $supports_wasi_pn " = " 0" ]; then
281
- continue
287
+ return
282
288
fi
283
289
284
- test_target " $target "
285
- test_run =1
290
+ test_target " $target " " $no_dist "
291
+ some_tests_run =1
286
292
fi
293
+ }
294
+
295
+ for target in $targets ; do
296
+ filter_and_run " $target "
287
297
done
288
298
289
299
for target in ${no_dist_targets:- } ; do
290
- if echo " $target " | grep -q " $filter " ; then
291
- if [ " $os " = " windows" ]; then
292
- TARGET=" $target " ./ci/install-rust.sh
293
- fi
294
-
295
- test_target " $target " 1
296
- test_run=1
297
- fi
300
+ filter_and_run " $target " 1
298
301
done
299
302
300
303
# Make sure we didn't accidentally filter everything
301
- if [ " ${test_run :- } " != 1 ]; then
304
+ if [ " $some_tests_run " != 1 ]; then
302
305
echo " No tests were run"
303
306
exit 1
304
307
fi
You can’t perform that action at this time.
0 commit comments