Skip to content

Commit

Permalink
Refactor test script.
Browse files Browse the repository at this point in the history
  • Loading branch information
reitermarkus committed Jan 1, 2020
1 parent 9f91aee commit 81bb1b5
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions ci/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,17 @@ main() {

export QEMU_STRACE=1

# test `cross check`
if [[ ! -z ${STD:-} ]]; then
if (( ${STD:-0} )); then
# test `cross check`
td=$(mktemp -d)
cargo init --lib --name foo $td
pushd $td
echo '#![no_std]' > src/lib.rs
cross check --target $TARGET
popd
rm -rf $td
fi

# `cross build` test for targets where `std` is not available
if [[ -z "${STD:-}" ]]; then
else
# `cross build` test for targets where `std` is not available
td=$(mktemp -d)

git clone \
Expand Down Expand Up @@ -99,9 +97,9 @@ EOF
rm -rf $td
fi

if [[ ${RUN:-} ]]; then
if (( ${RUN:-0} )); then
# `cross test` test
if [[ ${DYLIB:-} ]]; then
if (( ${DYLIB:-0} )); then
td=$(mktemp -d)

pushd $td
Expand Down Expand Up @@ -151,15 +149,15 @@ EOF
fi

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

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

pushd $td
cargo update -p gcc
retry cargo fetch
if [[ ${RUN:-} ]]; then
if (( ${RUN:-0} )); then
cross_run --target $TARGET
else
cross build --target $TARGET
Expand Down

0 comments on commit 81bb1b5

Please sign in to comment.