blob: 6a4b4b122a79c4621e119ec8f3496f359e581a54 [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 Crichton79199af2015-09-12 11:22:42 -070022 emulator @test -no-window &
23 adb wait-for-device
Alex Crichtond11e9142015-09-15 23:28:52 -070024 adb push /root/target/$TARGET/debug/libc-test /data/libc-test
25 adb shell /data/libc-test
Alex Crichton22f3c5e2015-09-18 17:30:58 -070026 ;;
27
28 arm-unknown-linux-gnueabihf)
Alex Crichtond11e9142015-09-15 23:28:52 -070029 qemu-arm -L /usr/arm-linux-gnueabihf libc-test/target/$TARGET/debug/libc-test
Alex Crichton22f3c5e2015-09-18 17:30:58 -070030 ;;
31
32 mips-unknown-linux-gnu)
Alex Crichton70b1f232015-09-18 16:32:03 -070033 qemu-mips -L /usr/mips-linux-gnu libc-test/target/$TARGET/debug/libc-test
Alex Crichton22f3c5e2015-09-18 17:30:58 -070034 ;;
35
36 aarch64-unknown-linux-gnu)
37 qemu-aarch64 -L /usr/aarch64-linux-gnu/ \
38 libc-test/target/$TARGET/debug/libc-test
39 ;;
40
Alex Crichtonbaef6112015-09-19 23:20:53 -070041 *-apple-ios)
42 libc-test/target/$TARGET/debug/libc-test
43 ;;
44
Alex Crichton22f3c5e2015-09-18 17:30:58 -070045 *)
Alex Crichtond11e9142015-09-15 23:28:52 -070046 cargo run --manifest-path libc-test/Cargo.toml --target $TARGET
Alex Crichton22f3c5e2015-09-18 17:30:58 -070047 ;;
48esac