@@ -9,6 +9,8 @@ mirrors_url="https://ci-mirrors.rust-lang.org/libc"
9
9
10
10
target=" $1 "
11
11
12
+ export RUST_BACKTRACE=" ${RUST_BACKTRACE:- 1} "
13
+
12
14
# If we're going to run tests inside of a qemu image, then we don't need any of
13
15
# the scripts below. Instead, download the image, prepare a filesystem which has
14
16
# the current state of this repository, and then run the image.
@@ -78,6 +80,14 @@ if [ -n "${QEMU:-}" ]; then
78
80
exec grep -E " ^(PASSED)|(test result: ok)" " ${CARGO_TARGET_DIR} /out.log"
79
81
fi
80
82
83
+ cmd=" cargo test --target $target ${LIBC_CI_ZBUILD_STD+" -Zbuild-std" } "
84
+
85
+ # Run tests in the `libc` crate
86
+ $cmd
87
+
88
+ # Everything else is in `libc-test`
89
+ $cmd =" $cmd --manifest-path libc-test/Cargo.toml"
90
+
81
91
if [ " $target " = " s390x-unknown-linux-gnu" ]; then
82
92
# FIXME: s390x-unknown-linux-gnu often fails to test due to timeout,
83
93
# so we retry this N times.
@@ -86,52 +96,25 @@ if [ "$target" = "s390x-unknown-linux-gnu" ]; then
86
96
passed=0
87
97
until [ $n -ge $N ]; do
88
98
if [ " $passed " = " 0" ]; then
89
- if cargo test \
90
- --no-default-features \
91
- --manifest-path libc-test/Cargo.toml \
92
- --target " $target " \
93
- ${LIBC_CI_ZBUILD_STD+" -Zbuild-std" }
94
- then
99
+ if $cmd --no-default-features; then
95
100
passed=$(( passed+ 1 ))
96
101
continue
97
102
fi
98
103
elif [ " $passed " = " 1" ]; then
99
- if cargo test \
100
- --manifest-path libc-test/Cargo.toml \
101
- --target " $target " \
102
- ${LIBC_CI_ZBUILD_STD+" -Zbuild-std" }
103
- then
104
+ if $cmd ; then
104
105
passed=$(( passed+ 1 ))
105
106
continue
106
107
fi
107
108
elif [ " $passed " = " 2" ]; then
108
- if cargo test \
109
- --features extra_traits \
110
- --manifest-path libc-test/Cargo.toml \
111
- --target " $target " \
112
- ${LIBC_CI_ZBUILD_STD+" -Zbuild-std" }
113
- then
109
+ if $cmd --features extra_traits; then
114
110
break
115
111
fi
116
112
fi
117
113
n=$(( n+ 1 ))
118
114
sleep 1
119
115
done
120
116
else
121
- cargo test \
122
- --no-default-features \
123
- --manifest-path libc-test/Cargo.toml \
124
- --target " $target " \
125
- ${LIBC_CI_ZBUILD_STD+" -Zbuild-std" }
126
-
127
- cargo test \
128
- --manifest-path libc-test/Cargo.toml \
129
- --target " $target " \
130
- ${LIBC_CI_ZBUILD_STD+" -Zbuild-std" }
131
-
132
- RUST_BACKTRACE=1 cargo test \
133
- --features extra_traits \
134
- --manifest-path libc-test/Cargo.toml \
135
- --target " $target " \
136
- ${LIBC_CI_ZBUILD_STD+" -Zbuild-std" }
117
+ $cmd --no-default-features
118
+ $cmd
119
+ $cmd --features extra_traits
137
120
fi
0 commit comments