| 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 | baef611 | 2015-09-19 23:20:53 -0700 | [diff] [blame^] | 9 | case "$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 | ;; |
| 18 | esac |
| Alex Crichton | 79199af | 2015-09-12 11:22:42 -0700 | [diff] [blame] | 19 | |
| Alex Crichton | 22f3c5e | 2015-09-18 17:30:58 -0700 | [diff] [blame] | 20 | case "$TARGET" in |
| 21 | arm-linux-androideabi) |
| Alex Crichton | 79199af | 2015-09-12 11:22:42 -0700 | [diff] [blame] | 22 | emulator @test -no-window & |
| 23 | adb wait-for-device |
| Alex Crichton | d11e914 | 2015-09-15 23:28:52 -0700 | [diff] [blame] | 24 | adb push /root/target/$TARGET/debug/libc-test /data/libc-test |
| 25 | adb shell /data/libc-test |
| Alex Crichton | 22f3c5e | 2015-09-18 17:30:58 -0700 | [diff] [blame] | 26 | ;; |
| 27 | |
| 28 | arm-unknown-linux-gnueabihf) |
| Alex Crichton | d11e914 | 2015-09-15 23:28:52 -0700 | [diff] [blame] | 29 | 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] | 30 | ;; |
| 31 | |
| 32 | mips-unknown-linux-gnu) |
| Alex Crichton | 70b1f23 | 2015-09-18 16:32:03 -0700 | [diff] [blame] | 33 | 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] | 34 | ;; |
| 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 Crichton | baef611 | 2015-09-19 23:20:53 -0700 | [diff] [blame^] | 41 | *-apple-ios) |
| 42 | libc-test/target/$TARGET/debug/libc-test |
| 43 | ;; |
| 44 | |
| Alex Crichton | 22f3c5e | 2015-09-18 17:30:58 -0700 | [diff] [blame] | 45 | *) |
| Alex Crichton | d11e914 | 2015-09-15 23:28:52 -0700 | [diff] [blame] | 46 | cargo run --manifest-path libc-test/Cargo.toml --target $TARGET |
| Alex Crichton | 22f3c5e | 2015-09-18 17:30:58 -0700 | [diff] [blame] | 47 | ;; |
| 48 | esac |