]> git.proxmox.com Git - rustc.git/blob - src/liblibc/ci/run.sh
Imported Upstream version 1.8.0+dfsg1
[rustc.git] / src / liblibc / ci / run.sh
1 #!/bin/sh
2
3 # Builds and runs tests for a particular target passed as an argument to this
4 # script.
5
6 set -ex
7
8 TARGET=$1
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
19
20 case "$TARGET" in
21 arm-linux-androideabi)
22 emulator @arm-21 -no-window &
23 adb wait-for-device
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
27 ;;
28
29 arm-unknown-linux-gnueabihf)
30 qemu-arm -L /usr/arm-linux-gnueabihf libc-test/target/$TARGET/debug/libc-test
31 ;;
32
33 mips-unknown-linux-gnu)
34 qemu-mips -L /usr/mips-linux-gnu /tmp/$TARGET/debug/libc-test
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
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
50 *)
51 libc-test/target/$TARGET/debug/libc-test
52 ;;
53 esac