Alex Crichton | 83a3049 | 2015-09-12 16:15:48 -0700 | [diff] [blame] | 1 | set -ex |
| 2 | |
Alex Crichton | e47a450 | 2015-09-12 16:42:49 -0700 | [diff] [blame] | 3 | if [ "$TRAVIS_OS_NAME" = "linux" ]; then |
Alex Crichton | 83a3049 | 2015-09-12 16:15:48 -0700 | [diff] [blame] | 4 | OS=unknown-linux-gnu |
| 5 | else |
| 6 | OS=apple-darwin |
| 7 | fi |
| 8 | |
| 9 | export HOST=$ARCH-$OS |
| 10 | |
Alex Crichton | 3f07aeb | 2015-09-12 16:35:52 -0700 | [diff] [blame] | 11 | # clang has better error messages and implements alignof more broadly |
| 12 | export CC=clang |
| 13 | |
Alex Crichton | 23ab70b | 2015-09-13 23:38:27 -0700 | [diff] [blame] | 14 | EXTRA_TARGETS=https://people.mozilla.org/~acrichton/libc-test/2015-09-08 |
| 15 | |
Alex Crichton | acda013 | 2015-09-13 11:22:26 -0700 | [diff] [blame] | 16 | if [ "$TARGET" = "arm-linux-androideabi" ]; then |
| 17 | # Pull a pre-built docker image for testing android, then run tests entirely |
| 18 | # within that image. |
| 19 | docker pull alexcrichton/rust-libc-test |
Alex Crichton | 944a733 | 2015-09-14 11:27:10 -0700 | [diff] [blame] | 20 | exec docker run -v `pwd`:/clone -t alexcrichton/rust-libc-test \ |
| 21 | sh ci/run.sh $TARGET |
Alex Crichton | 2f846f3 | 2015-09-13 21:21:46 -0700 | [diff] [blame] | 22 | elif [ "$TARGET" = "x86_64-unknown-linux-musl" ]; then |
Alex Crichton | 23ab70b | 2015-09-13 23:38:27 -0700 | [diff] [blame] | 23 | curl -s $EXTRA_TARGETS/$TARGET.tar.gz | tar xzf - -C $HOME/rust/lib/rustlib |
Alex Crichton | 23ab70b | 2015-09-13 23:38:27 -0700 | [diff] [blame] | 24 | elif [ "$TARGET" = "arm-unknown-linux-gnueabihf" ]; then |
| 25 | curl -s $EXTRA_TARGETS/$TARGET.tar.gz | tar xzf - -C $HOME/rust/lib/rustlib |
Alex Crichton | 517b76a | 2015-09-13 23:53:31 -0700 | [diff] [blame] | 26 | sudo apt-get install gcc-4.7-arm-linux-gnueabihf qemu-user |
Alex Crichton | 23ab70b | 2015-09-13 23:38:27 -0700 | [diff] [blame] | 27 | export CC=arm-linux-gnueabihf-gcc-4.7 |
Alex Crichton | 944a733 | 2015-09-14 11:27:10 -0700 | [diff] [blame] | 28 | elif [ "$TARGET" = "mips-unknown-linux-gnu" ]; then |
| 29 | curl -s $EXTRA_TARGETS/$TARGET.tar.gz | tar xzf - -C $HOME/rust/lib/rustlib |
| 30 | echo 'deb http://ftp.de.debian.org/debian squeeze main' | \ |
| 31 | sudo tee -a /etc/apt/sources.list |
| 32 | echo 'deb http://www.emdebian.org/debian/ squeeze main' | \ |
| 33 | sudo tee -a /etc/apt/sources.list |
| 34 | sudo apt-get update |
Alex Crichton | ac5ba00 | 2015-09-14 11:49:09 -0700 | [diff] [blame] | 35 | sudo apt-get install emdebian-archive-keyring |
Alex Crichton | 86c7c43 | 2015-09-14 12:58:03 -0700 | [diff] [blame^] | 36 | sudo apt-get install qemu-user gcc-4.4-mips-linux-gnu -y --force-yes |
Alex Crichton | 944a733 | 2015-09-14 11:27:10 -0700 | [diff] [blame] | 37 | export CC=mips-linux-gnu-gcc |
Alex Crichton | acda013 | 2015-09-13 11:22:26 -0700 | [diff] [blame] | 38 | else |
Alex Crichton | 83a3049 | 2015-09-12 16:15:48 -0700 | [diff] [blame] | 39 | # Download and install the relevant target locally, then run tests |
| 40 | curl -sO https://static.rust-lang.org/dist/rust-$TRAVIS_RUST_VERSION-$HOST.tar.gz |
| 41 | tar xf rust-$TRAVIS_RUST_VERSION-$HOST.tar.gz |
| 42 | rm -rf $HOME/rust/lib/rustlib/$HOST |
| 43 | mv rust-$TRAVIS_RUST_VERSION-$HOST/rustc/lib/rustlib/$HOST \ |
| 44 | $HOME/rust/lib/rustlib |
Alex Crichton | 944a733 | 2015-09-14 11:27:10 -0700 | [diff] [blame] | 45 | TARGET=$HOST |
Alex Crichton | 83a3049 | 2015-09-12 16:15:48 -0700 | [diff] [blame] | 46 | fi |
Alex Crichton | 944a733 | 2015-09-14 11:27:10 -0700 | [diff] [blame] | 47 | |
| 48 | mkdir .cargo |
| 49 | cp ci/cargo-config .cargo/config |
| 50 | sh ci/run.sh $TARGET |