libc-rs/ci/run.sh

54 lines
1.3 KiB
Bash
Raw Normal View History

2015-09-12 20:22:42 +02:00
#!/bin/sh
2015-09-18 02:45:10 +02:00
# Builds and runs tests for a particular target passed as an argument to this
# script.
2015-09-12 20:22:42 +02:00
set -ex
TARGET=$1
2015-09-20 08:20:53 +02:00
case "$TARGET" in
*-apple-ios)
cargo rustc --manifest-path libc-test/Cargo.toml --target $TARGET -- \
-C link-args=-mios-simulator-version-min=7.0
;;
*)
cargo build --manifest-path libc-test/Cargo.toml --target $TARGET
;;
esac
2015-09-12 20:22:42 +02:00
2015-09-19 02:30:58 +02:00
case "$TARGET" in
arm-linux-androideabi)
emulator @arm-21 -no-window &
2015-09-12 20:22:42 +02:00
adb wait-for-device
2015-11-27 18:40:37 +01:00
adb push /tmp/$TARGET/debug/libc-test /data/libc-test
adb shell /data/libc-test 2>&1 | tee /tmp/out
grep "^PASSED .* tests" /tmp/out
2015-09-19 02:30:58 +02:00
;;
arm-unknown-linux-gnueabihf)
2015-09-16 08:28:52 +02:00
qemu-arm -L /usr/arm-linux-gnueabihf libc-test/target/$TARGET/debug/libc-test
2015-09-19 02:30:58 +02:00
;;
mips-unknown-linux-gnu)
2015-12-25 20:14:47 +01:00
qemu-mips -L /usr/mips-linux-gnu /tmp/$TARGET/debug/libc-test
2015-09-19 02:30:58 +02:00
;;
aarch64-unknown-linux-gnu)
qemu-aarch64 -L /usr/aarch64-linux-gnu/ \
libc-test/target/$TARGET/debug/libc-test
;;
2015-11-27 18:40:37 +01:00
*-rumprun-netbsd)
rumprun-bake hw_virtio /tmp/libc-test.img /tmp/$TARGET/debug/libc-test
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
;;
2015-09-19 02:30:58 +02:00
*)
libc-test/target/$TARGET/debug/libc-test
2015-09-19 02:30:58 +02:00
;;
esac