| 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 | 881ef9b | 2015-12-01 09:04:13 -0800 | [diff] [blame] | 22 | emulator @arm-21 -no-window & |
| Alex Crichton | 79199af | 2015-09-12 11:22:42 -0700 | [diff] [blame] | 23 | adb wait-for-device |
| Alex Crichton | 49d7bca | 2015-11-27 09:40:37 -0800 | [diff] [blame] | 24 | adb push /tmp/$TARGET/debug/libc-test /data/libc-test |
| 25 | adb shell /data/libc-test 2>&1 | tee /tmp/out |
| 26 | grep "^PASSED .* tests" /tmp/out |
| Alex Crichton | 22f3c5e | 2015-09-18 17:30:58 -0700 | [diff] [blame] | 27 | ;; |
| 28 | |
| 29 | arm-unknown-linux-gnueabihf) |
| Alex Crichton | d11e914 | 2015-09-15 23:28:52 -0700 | [diff] [blame] | 30 | 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] | 31 | ;; |
| 32 | |
| 33 | mips-unknown-linux-gnu) |
| Alexander Polakov | 2cdb21e | 2015-12-25 22:14:47 +0300 | [diff] [blame] | 34 | qemu-mips -L /usr/mips-linux-gnu /tmp/$TARGET/debug/libc-test |
| Alex Crichton | 22f3c5e | 2015-09-18 17:30:58 -0700 | [diff] [blame] | 35 | ;; |
| 36 | |
| 37 | aarch64-unknown-linux-gnu) |
| 38 | qemu-aarch64 -L /usr/aarch64-linux-gnu/ \ |
| 39 | libc-test/target/$TARGET/debug/libc-test |
| 40 | ;; |
| 41 | |
| Alex Crichton | 49d7bca | 2015-11-27 09:40:37 -0800 | [diff] [blame] | 42 | *-rumprun-netbsd) |
| 43 | rumprun-bake hw_virtio /tmp/libc-test.img /tmp/$TARGET/debug/libc-test |
| 44 | qemu-system-x86_64 -nographic -vga none -m 64 \ |
| 45 | -kernel /tmp/libc-test.img 2>&1 | tee /tmp/out & |
| 46 | sleep 5 |
| 47 | grep "^PASSED .* tests" /tmp/out |
| 48 | ;; |
| 49 | |
| Alex Crichton | 22f3c5e | 2015-09-18 17:30:58 -0700 | [diff] [blame] | 50 | *) |
| Alex Crichton | d820c4a | 2016-01-18 11:16:38 -0800 | [diff] [blame] | 51 | libc-test/target/$TARGET/debug/libc-test |
| Alex Crichton | 22f3c5e | 2015-09-18 17:30:58 -0700 | [diff] [blame] | 52 | ;; |
| 53 | esac |