| Alex Crichton | 79199af | 2015-09-12 11:22:42 -0700 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| Alex Crichton | d9962f4 | 2015-09-17 17:45:10 -0700 | [diff] [blame^] | 3 | # Builds and runs tests for a particular target passed as an argument to this |
| 4 | # script. |
| 5 | |
| Alex Crichton | 79199af | 2015-09-12 11:22:42 -0700 | [diff] [blame] | 6 | set -ex |
| 7 | |
| 8 | TARGET=$1 |
| Alex Crichton | d11e914 | 2015-09-15 23:28:52 -0700 | [diff] [blame] | 9 | cargo build --manifest-path libc-test/Cargo.toml --target $TARGET |
| Alex Crichton | 79199af | 2015-09-12 11:22:42 -0700 | [diff] [blame] | 10 | |
| 11 | if [ "$TARGET" = "arm-linux-androideabi" ]; then |
| 12 | emulator @test -no-window & |
| 13 | adb wait-for-device |
| Alex Crichton | d11e914 | 2015-09-15 23:28:52 -0700 | [diff] [blame] | 14 | adb push /root/target/$TARGET/debug/libc-test /data/libc-test |
| 15 | adb shell /data/libc-test |
| Alex Crichton | 23ab70b | 2015-09-13 23:38:27 -0700 | [diff] [blame] | 16 | elif [ "$TARGET" = "arm-unknown-linux-gnueabihf" ]; then |
| Alex Crichton | d11e914 | 2015-09-15 23:28:52 -0700 | [diff] [blame] | 17 | qemu-arm -L /usr/arm-linux-gnueabihf libc-test/target/$TARGET/debug/libc-test |
| Alex Crichton | 944a733 | 2015-09-14 11:27:10 -0700 | [diff] [blame] | 18 | elif [ "$TARGET" = "mips-unknown-linux-gnu" ]; then |
| Alex Crichton | 412d4f9 | 2015-09-14 17:33:40 -0700 | [diff] [blame] | 19 | # FIXME: this segfaults on travis, passes locally? |
| 20 | #qemu-mips -L /usr/mips-linux-gnu libc-test/target/$TARGET/debug/all-* |
| Alex Crichton | 17da63d | 2015-09-14 17:52:07 -0700 | [diff] [blame] | 21 | echo skip |
| Alex Crichton | 684cfa4 | 2015-09-17 15:18:18 -0700 | [diff] [blame] | 22 | elif [ "$TARGET" = "aarch64-unknown-linux-gnu" ]; then |
| 23 | qemu-aarch64 -L /usr/aarch64-linux-gnu/ libc-test/target/$TARGET/debug/libc-test |
| Alex Crichton | 79199af | 2015-09-12 11:22:42 -0700 | [diff] [blame] | 24 | else |
| Alex Crichton | d11e914 | 2015-09-15 23:28:52 -0700 | [diff] [blame] | 25 | cargo run --manifest-path libc-test/Cargo.toml --target $TARGET |
| Alex Crichton | 79199af | 2015-09-12 11:22:42 -0700 | [diff] [blame] | 26 | fi |