blob: 706bf7a1d1ccdaf7a065e37127342079e5973e8b [file] [log] [blame]
Alex Crichton79199af2015-09-12 11:22:42 -07001#!/bin/sh
2
Alex Crichtond9962f42015-09-17 17:45:10 -07003# Builds and runs tests for a particular target passed as an argument to this
4# script.
5
Alex Crichton79199af2015-09-12 11:22:42 -07006set -ex
7
8TARGET=$1
Alex Crichtonbaef6112015-09-19 23:20:53 -07009case "$TARGET" in
10 *-apple-ios)
11 cargo rustc --manifest-path libc-test/Cargo.toml --target $TARGET -- \
12 -C link-args=-mios-simulator-version-min=7.0
13 ;;
14
15 *)
16 cargo build --manifest-path libc-test/Cargo.toml --target $TARGET
17 ;;
18esac
Alex Crichton79199af2015-09-12 11:22:42 -070019
Alex Crichton22f3c5e2015-09-18 17:30:58 -070020case "$TARGET" in
21 arm-linux-androideabi)
Alex Crichton881ef9b2015-12-01 09:04:13 -080022 emulator @arm-21 -no-window &
Alex Crichton79199af2015-09-12 11:22:42 -070023 adb wait-for-device
Alex Crichton49d7bca2015-11-27 09:40:37 -080024 adb push /tmp/$TARGET/debug/libc-test /data/libc-test
25 adb shell /data/libc-test 2>&1 | tee /tmp/out
26 grep "^PASSED .* tests" /tmp/out
Alex Crichton22f3c5e2015-09-18 17:30:58 -070027 ;;
28
29 arm-unknown-linux-gnueabihf)
Alex Crichtond11e9142015-09-15 23:28:52 -070030 qemu-arm -L /usr/arm-linux-gnueabihf libc-test/target/$TARGET/debug/libc-test
Alex Crichton22f3c5e2015-09-18 17:30:58 -070031 ;;
32
33 mips-unknown-linux-gnu)
Alexander Polakov2cdb21e2015-12-25 22:14:47 +030034 qemu-mips -L /usr/mips-linux-gnu /tmp/$TARGET/debug/libc-test
Alex Crichton22f3c5e2015-09-18 17:30:58 -070035 ;;
36
37 aarch64-unknown-linux-gnu)
38 qemu-aarch64 -L /usr/aarch64-linux-gnu/ \
39 libc-test/target/$TARGET/debug/libc-test
40 ;;
41
Alex Crichton49d7bca2015-11-27 09:40:37 -080042 *-rumprun-netbsd)
43 rumprun-bake hw_virtio /tmp/libc-test.img /tmp/$TARGET/debug/libc-test
44 qemu-system-x86_64 -nographic -vga none -m 64 \
45 -kernel /tmp/libc-test.img 2>&1 | tee /tmp/out &
46 sleep 5
47 grep "^PASSED .* tests" /tmp/out
48 ;;
49
Alex Crichton22f3c5e2015-09-18 17:30:58 -070050 *)
Alex Crichtond820c4a2016-01-18 11:16:38 -080051 libc-test/target/$TARGET/debug/libc-test
Alex Crichton22f3c5e2015-09-18 17:30:58 -070052 ;;
53esac