| 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 | |
| Alex Crichton | 22f3c5e | 2015-09-18 17:30:58 -0700 | [diff] [blame^] | 11 | case "$TARGET" in |
| 12 | arm-linux-androideabi) |
| Alex Crichton | 79199af | 2015-09-12 11:22:42 -0700 | [diff] [blame] | 13 | emulator @test -no-window & |
| 14 | adb wait-for-device |
| Alex Crichton | d11e914 | 2015-09-15 23:28:52 -0700 | [diff] [blame] | 15 | adb push /root/target/$TARGET/debug/libc-test /data/libc-test |
| 16 | adb shell /data/libc-test |
| Alex Crichton | 22f3c5e | 2015-09-18 17:30:58 -0700 | [diff] [blame^] | 17 | ;; |
| 18 | |
| 19 | arm-unknown-linux-gnueabihf) |
| Alex Crichton | d11e914 | 2015-09-15 23:28:52 -0700 | [diff] [blame] | 20 | qemu-arm -L /usr/arm-linux-gnueabihf libc-test/target/$TARGET/debug/libc-test |
| Alex Crichton | 22f3c5e | 2015-09-18 17:30:58 -0700 | [diff] [blame^] | 21 | ;; |
| 22 | |
| 23 | mips-unknown-linux-gnu) |
| Alex Crichton | 70b1f23 | 2015-09-18 16:32:03 -0700 | [diff] [blame] | 24 | qemu-mips -L /usr/mips-linux-gnu libc-test/target/$TARGET/debug/libc-test |
| Alex Crichton | 22f3c5e | 2015-09-18 17:30:58 -0700 | [diff] [blame^] | 25 | ;; |
| 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 Crichton | d11e914 | 2015-09-15 23:28:52 -0700 | [diff] [blame] | 33 | cargo run --manifest-path libc-test/Cargo.toml --target $TARGET |
| Alex Crichton | 22f3c5e | 2015-09-18 17:30:58 -0700 | [diff] [blame^] | 34 | ;; |
| 35 | esac |