summaryrefslogtreecommitdiff
path: root/ci/run.sh
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2017-08-21 17:06:12 -0700
committerAlex Crichton <alex@alexcrichton.com>2017-08-21 21:41:37 -0700
commitbcbfa856511f4f7bdacb8188eadcc7cbe38727e2 (patch)
tree7486c106ede85be9a1004c4eb3d2058d928716d2 /ci/run.sh
parentce276177f2d79b065859ce945c010de03769d30f (diff)
downloadrust-libc-bcbfa856511f4f7bdacb8188eadcc7cbe38727e2.tar.gz
Leverage Cargo's target runner support to execute tests
Diffstat (limited to 'ci/run.sh')
-rwxr-xr-xci/run.sh108
1 files changed, 1 insertions, 107 deletions
diff --git a/ci/run.sh b/ci/run.sh
index 5afa27a287..7a1736c837 100755
--- a/ci/run.sh
+++ b/ci/run.sh
@@ -68,110 +68,4 @@ if [ "$QEMU" != "" ]; then
exec grep "^PASSED .* tests" $CARGO_TARGET_DIR/out.log
fi
-# Build all tests making sure that the iOS builds are handled properly.
-if [[ "$TARGET" == *-apple-ios ]]; then
- export RUSTFLAGS="-C link-args=-mios-simulator-version-min=7.0"
-fi
-cargo build --manifest-path libc-test/Cargo.toml --target $TARGET --tests
-
-case "$TARGET" in
- # Android emulator for x86_64 does not work on travis (missing hardware
- # acceleration). Tests are run on case *). See ci/android-sysimage.sh for
- # informations about how tests are run.
- arm-linux-androideabi | aarch64-linux-android | i686-linux-android)
- # set SHELL so android can detect a 64bits system, see
- # http://stackoverflow.com/a/41789144
- # https://issues.jenkins-ci.org/browse/JENKINS-26930?focusedCommentId=230791&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-230791
- export SHELL=/bin/dash
- arch=$(echo $TARGET | cut -d- -f1)
- accel="-no-accel"
- if emulator -accel-check; then
- accel=""
- fi
- emulator @$arch -no-window $accel &
- adb wait-for-device
- # TODO: replace these steps with a single program so that it can be used as a runner for cargo test
- adb push $CARGO_TARGET_DIR/$TARGET/debug/main-* /data/local/tmp/main
- adb shell /data/local/tmp/main 2>&1 | tee /tmp/out
- grep "^PASSED .* tests" /tmp/out
- adb push $CARGO_TARGET_DIR/$TARGET/debug/linux_fcntl-* /data/local/tmp/linux_fcntl
- adb shell /data/local/tmp/linux_fcntl 2>&1 | tee /tmp/out
- grep "^PASSED .* tests" /tmp/out
- ;;
-
- i386-apple-ios)
- rustc -O ./ci/ios/deploy_and_run_on_ios_simulator.rs
- export CARGO_TARGET_I386_APPLE_IOS_RUNNER="./deploy_and_run_on_ios_simulator"
- cargo test --manifest-path libc-test/Cargo.toml --target $TARGET
- ;;
-
- x86_64-apple-ios)
- rustc -O ./ci/ios/deploy_and_run_on_ios_simulator.rs
- export CARGO_TARGET_X86_64_APPLE_IOS_RUNNER="./deploy_and_run_on_ios_simulator"
- cargo test --manifest-path libc-test/Cargo.toml --target $TARGET
- ;;
-
- arm-unknown-linux-gnueabihf)
- export CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_RUNNER="qemu-arm -L /usr/arm-linux-gnueabihf"
- cargo test --manifest-path libc-test/Cargo.toml --target $TARGET
- ;;
-
- mips-unknown-linux-gnu)
- export CARGO_TARGET_MIPS_UNKNOWN_LINUX_GNU_RUNNER="qemu-mips -L /usr/mips-linux-gnu"
- cargo test --manifest-path libc-test/Cargo.toml --target $TARGET
- ;;
-
- mips64-unknown-linux-gnuabi64)
- export CARGO_TARGET_MIPS64_UNKNOWN_LINUX_GNUABI64_RUNNER="qemu-mips64 -L /usr/mips64-linux-gnuabi64"
- cargo test --manifest-path libc-test/Cargo.toml --target $TARGET
- ;;
-
- mips-unknown-linux-musl)
- export CARGO_TARGET_MIPS_UNKNOWN_LINUX_MUSL_RUNNER="qemu-mips -L /toolchain/staging_dir/toolchain-mips_34kc_gcc-5.3.0_musl-1.1.15"
- cargo test --manifest-path libc-test/Cargo.toml --target $TARGET
- ;;
-
- mipsel-unknown-linux-musl)
- export CARGO_TARGET_MIPSEL_UNKNOWN_LINUX_MUSL_RUNNER="qemu-mipsel -L /toolchain"
- cargo test --manifest-path libc-test/Cargo.toml --target $TARGET
- ;;
-
- powerpc-unknown-linux-gnu)
- export CARGO_TARGET_POWERPC_UNKNOWN_LINUX_GNU_RUNNER="qemu-ppc -L /usr/powerpc-linux-gnu"
- cargo test --manifest-path libc-test/Cargo.toml --target $TARGET
- ;;
-
- powerpc64-unknown-linux-gnu)
- export CARGO_TARGET_POWERPC64_UNKNOWN_LINUX_GNU_RUNNER="qemu-ppc64 -L /usr/powerpc64-linux-gnu"
- cargo test --manifest-path libc-test/Cargo.toml --target $TARGET
- ;;
-
- aarch64-unknown-linux-gnu)
- export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUNNER="qemu-aarch64 -L /usr/aarch64-linux-gnu"
- cargo test --manifest-path libc-test/Cargo.toml --target $TARGET
- ;;
-
- s390x-unknown-linux-gnu)
- # TODO: in theory we should execute this, but qemu segfaults immediately :(
- #export CARGO_TARGET_S390X_UNKNOWN_LINUX_GNU_RUNNER="qemu-s390x -L /usr/s390x-linux-gnu"
- #cargo test --manifest-path libc-test/Cargo.toml --target $TARGET
- ;;
-
- *-rumprun-netbsd)
- # TODO: replace these steps with a single program so that it can be used as a runner for cargo test
- rumprun-bake hw_virtio /tmp/libc-test.img $CARGO_TARGET_DIR/$TARGET/debug/main-*
- qemu-system-x86_64 -nographic -vga none -m 64 \
- -kernel /tmp/libc-test.img 2>&1 | tee /tmp/out &
- sleep 5
- grep "^PASSED .* tests" /tmp/out
- rumprun-bake hw_virtio /tmp/libc-test.img $CARGO_TARGET_DIR/$TARGET/debug/linux_fcntl-*
- qemu-system-x86_64 -nographic -vga none -m 64 \
- -kernel /tmp/libc-test.img 2>&1 | tee /tmp/out &
- sleep 5
- grep "^PASSED .* tests" /tmp/out
- ;;
-
- *)
- cargo test --manifest-path libc-test/Cargo.toml --target $TARGET
- ;;
-esac
+cargo test --manifest-path libc-test/Cargo.toml --target $TARGET