blob: b0d4726f70391095fd3868e82411fbd1f49b1731 [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 Crichtond11e9142015-09-15 23:28:52 -07009cargo build --manifest-path libc-test/Cargo.toml --target $TARGET
Alex Crichton79199af2015-09-12 11:22:42 -070010
Alex Crichton22f3c5e2015-09-18 17:30:58 -070011case "$TARGET" in
12 arm-linux-androideabi)
Alex Crichton79199af2015-09-12 11:22:42 -070013 emulator @test -no-window &
14 adb wait-for-device
Alex Crichtond11e9142015-09-15 23:28:52 -070015 adb push /root/target/$TARGET/debug/libc-test /data/libc-test
16 adb shell /data/libc-test
Alex Crichton22f3c5e2015-09-18 17:30:58 -070017 ;;
18
19 arm-unknown-linux-gnueabihf)
Alex Crichtond11e9142015-09-15 23:28:52 -070020 qemu-arm -L /usr/arm-linux-gnueabihf libc-test/target/$TARGET/debug/libc-test
Alex Crichton22f3c5e2015-09-18 17:30:58 -070021 ;;
22
23 mips-unknown-linux-gnu)
Alex Crichton70b1f232015-09-18 16:32:03 -070024 qemu-mips -L /usr/mips-linux-gnu libc-test/target/$TARGET/debug/libc-test
Alex Crichton22f3c5e2015-09-18 17:30:58 -070025 ;;
26
27 aarch64-unknown-linux-gnu)
28 qemu-aarch64 -L /usr/aarch64-linux-gnu/ \
29 libc-test/target/$TARGET/debug/libc-test
30 ;;
31
32 *)
Alex Crichtond11e9142015-09-15 23:28:52 -070033 cargo run --manifest-path libc-test/Cargo.toml --target $TARGET
Alex Crichton22f3c5e2015-09-18 17:30:58 -070034 ;;
35esac