88MIRRORS_URL=" https://ci-mirrors.rust-lang.org/libc"
99
1010TARGET=" ${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
1117
1218# If we're going to run tests inside of a qemu image, then we don't need any of
1319# the scripts below. Instead, download the image, prepare a filesystem which has
@@ -53,7 +59,7 @@ if [ "$QEMU" != "" ]; then
5359 cargo build \
5460 --manifest-path libc-test/Cargo.toml \
5561 --target " ${TARGET} " \
56- --test main
62+ --test main ${EXTRA_CARGO_ARGS}
5763 rm " ${CARGO_TARGET_DIR} /${TARGET} " /debug/main-* .d
5864 cp " ${CARGO_TARGET_DIR} /${TARGET} " /debug/main-* " ${tmpdir} " /mount/libc-test
5965 # shellcheck disable=SC2016
@@ -91,17 +97,17 @@ if [ "$TARGET" = "s390x-unknown-linux-gnu" ]; then
9197 until [ $n -ge $N ]
9298 do
9399 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
95101 passed=$(( passed+ 1 ))
96102 continue
97103 fi
98104 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
100106 passed=$(( passed+ 1 ))
101107 continue
102108 fi
103109 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
105111 break
106112 fi
107113 fi
@@ -110,10 +116,10 @@ if [ "$TARGET" = "s390x-unknown-linux-gnu" ]; then
110116 done
111117else
112118 cargo test --no-default-features --manifest-path libc-test/Cargo.toml \
113- --target " ${TARGET} "
119+ --target " ${TARGET} " ${EXTRA_CARGO_ARGS}
114120
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}
116122
117123 RUST_BACKTRACE=1 cargo test --features extra_traits --manifest-path libc-test/Cargo.toml \
118- --target " ${TARGET} "
124+ --target " ${TARGET} " ${EXTRA_CARGO_ARGS}
119125fi
0 commit comments