Skip to content

Commit 81bb1b5

Browse files
committed
Refactor test script.
1 parent 9f91aee commit 81bb1b5

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

ci/test.sh

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,17 @@ main() {
4141

4242
export QEMU_STRACE=1
4343

44-
# test `cross check`
45-
if [[ ! -z ${STD:-} ]]; then
44+
if (( ${STD:-0} )); then
45+
# test `cross check`
4646
td=$(mktemp -d)
4747
cargo init --lib --name foo $td
4848
pushd $td
4949
echo '#![no_std]' > src/lib.rs
5050
cross check --target $TARGET
5151
popd
5252
rm -rf $td
53-
fi
54-
55-
# `cross build` test for targets where `std` is not available
56-
if [[ -z "${STD:-}" ]]; then
53+
else
54+
# `cross build` test for targets where `std` is not available
5755
td=$(mktemp -d)
5856

5957
git clone \
@@ -99,9 +97,9 @@ EOF
9997
rm -rf $td
10098
fi
10199

102-
if [[ ${RUN:-} ]]; then
100+
if (( ${RUN:-0} )); then
103101
# `cross test` test
104-
if [[ ${DYLIB:-} ]]; then
102+
if (( ${DYLIB:-0} )); then
105103
td=$(mktemp -d)
106104

107105
pushd $td
@@ -151,15 +149,15 @@ EOF
151149
fi
152150

153151
# Test C++ support
154-
if [[ ${CPP:-} ]]; then
152+
if (( ${CPP:-0} )); then
155153
td=$(mktemp -d)
156154

157155
git clone --depth 1 https://github.com/japaric/hellopp $td
158156

159157
pushd $td
160158
cargo update -p gcc
161159
retry cargo fetch
162-
if [[ ${RUN:-} ]]; then
160+
if (( ${RUN:-0} )); then
163161
cross_run --target $TARGET
164162
else
165163
cross build --target $TARGET

0 commit comments

Comments
 (0)