blob: f9e0b51e02e645c16ac88f2fadcedc2575e8f358 [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
11if [ "$TARGET" = "arm-linux-androideabi" ]; then
12 emulator @test -no-window &
13 adb wait-for-device
Alex Crichtond11e9142015-09-15 23:28:52 -070014 adb push /root/target/$TARGET/debug/libc-test /data/libc-test
15 adb shell /data/libc-test
Alex Crichton23ab70b2015-09-13 23:38:27 -070016elif [ "$TARGET" = "arm-unknown-linux-gnueabihf" ]; then
Alex Crichtond11e9142015-09-15 23:28:52 -070017 qemu-arm -L /usr/arm-linux-gnueabihf libc-test/target/$TARGET/debug/libc-test
Alex Crichton944a7332015-09-14 11:27:10 -070018elif [ "$TARGET" = "mips-unknown-linux-gnu" ]; then
Alex Crichton412d4f92015-09-14 17:33:40 -070019 # FIXME: this segfaults on travis, passes locally?
20 #qemu-mips -L /usr/mips-linux-gnu libc-test/target/$TARGET/debug/all-*
Alex Crichton17da63d2015-09-14 17:52:07 -070021 echo skip
Alex Crichton684cfa42015-09-17 15:18:18 -070022elif [ "$TARGET" = "aarch64-unknown-linux-gnu" ]; then
23 qemu-aarch64 -L /usr/aarch64-linux-gnu/ libc-test/target/$TARGET/debug/libc-test
Alex Crichton79199af2015-09-12 11:22:42 -070024else
Alex Crichtond11e9142015-09-15 23:28:52 -070025 cargo run --manifest-path libc-test/Cargo.toml --target $TARGET
Alex Crichton79199af2015-09-12 11:22:42 -070026fi