8
8
MIRRORS_URL=" https://ci-mirrors.rust-lang.org/libc"
9
9
10
10
TARGET=" ${1} "
11
+ EXTRA_CARGO_ARGS=" "
12
+
13
+ # Build -Zbuild-std if we're told to by the environment
14
+ if [ -n " ${LIBC_CI_ZBUILD_STD} " ]; then
15
+ EXTRA_CARGO_ARGS=" -Zbuild-std ${EXTRA_CARGO_ARGS} "
16
+ fi
11
17
12
18
# If we're going to run tests inside of a qemu image, then we don't need any of
13
19
# the scripts below. Instead, download the image, prepare a filesystem which has
@@ -53,7 +59,7 @@ if [ "$QEMU" != "" ]; then
53
59
cargo build \
54
60
--manifest-path libc-test/Cargo.toml \
55
61
--target " ${TARGET} " \
56
- --test main
62
+ --test main ${EXTRA_CARGO_ARGS}
57
63
rm " ${CARGO_TARGET_DIR} /${TARGET} " /debug/main-* .d
58
64
cp " ${CARGO_TARGET_DIR} /${TARGET} " /debug/main-* " ${tmpdir} " /mount/libc-test
59
65
# shellcheck disable=SC2016
@@ -91,17 +97,17 @@ if [ "$TARGET" = "s390x-unknown-linux-gnu" ]; then
91
97
until [ $n -ge $N ]
92
98
do
93
99
if [ " $passed " = " 0" ]; then
94
- if cargo test --no-default-features --manifest-path libc-test/Cargo.toml --target " ${TARGET} " ; then
100
+ if cargo test --no-default-features --manifest-path libc-test/Cargo.toml --target " ${TARGET} " ${EXTRA_CARGO_ARGS} ; then
95
101
passed=$(( passed+ 1 ))
96
102
continue
97
103
fi
98
104
elif [ " $passed " = " 1" ]; then
99
- if cargo test --manifest-path libc-test/Cargo.toml --target " ${TARGET} " ; then
105
+ if cargo test --manifest-path libc-test/Cargo.toml --target " ${TARGET} " ${EXTRA_CARGO_ARGS} ; then
100
106
passed=$(( passed+ 1 ))
101
107
continue
102
108
fi
103
109
elif [ " $passed " = " 2" ]; then
104
- if cargo test --features extra_traits --manifest-path libc-test/Cargo.toml --target " ${TARGET} " ; then
110
+ if cargo test --features extra_traits --manifest-path libc-test/Cargo.toml --target " ${TARGET} " ${EXTRA_CARGO_ARGS} ; then
105
111
break
106
112
fi
107
113
fi
@@ -110,10 +116,10 @@ if [ "$TARGET" = "s390x-unknown-linux-gnu" ]; then
110
116
done
111
117
else
112
118
cargo test --no-default-features --manifest-path libc-test/Cargo.toml \
113
- --target " ${TARGET} "
119
+ --target " ${TARGET} " ${EXTRA_CARGO_ARGS}
114
120
115
- cargo test --manifest-path libc-test/Cargo.toml --target " ${TARGET} "
121
+ cargo test --manifest-path libc-test/Cargo.toml --target " ${TARGET} " ${EXTRA_CARGO_ARGS}
116
122
117
123
RUST_BACKTRACE=1 cargo test --features extra_traits --manifest-path libc-test/Cargo.toml \
118
- --target " ${TARGET} "
124
+ --target " ${TARGET} " ${EXTRA_CARGO_ARGS}
119
125
fi
0 commit comments