blob: f760306a9eac2a6efdc276c1672fc42fbf4878be [file] [log] [blame]
Alex Crichton83a30492015-09-12 16:15:48 -07001set -ex
2
Alex Crichtone47a4502015-09-12 16:42:49 -07003if [ "$TRAVIS_OS_NAME" = "linux" ]; then
Alex Crichton83a30492015-09-12 16:15:48 -07004 OS=unknown-linux-gnu
5else
6 OS=apple-darwin
7fi
8
9export HOST=$ARCH-$OS
10
Alex Crichton2fe6de42015-09-14 14:07:49 -070011MAIN_TARGETS=https://static.rust-lang.org/dist
Alex Crichton23ab70b2015-09-13 23:38:27 -070012EXTRA_TARGETS=https://people.mozilla.org/~acrichton/libc-test/2015-09-08
13
Alex Crichton9eca4682015-09-17 00:48:36 -070014if [ "$TARGET" = "arm-linux-androideabi" ]; then
Alex Crichtonacda0132015-09-13 11:22:26 -070015 # Pull a pre-built docker image for testing android, then run tests entirely
16 # within that image.
17 docker pull alexcrichton/rust-libc-test
Alex Crichton944a7332015-09-14 11:27:10 -070018 exec docker run -v `pwd`:/clone -t alexcrichton/rust-libc-test \
19 sh ci/run.sh $TARGET
Alex Crichton2f846f32015-09-13 21:21:46 -070020elif [ "$TARGET" = "x86_64-unknown-linux-musl" ]; then
Alex Crichton23ab70b2015-09-13 23:38:27 -070021 curl -s $EXTRA_TARGETS/$TARGET.tar.gz | tar xzf - -C $HOME/rust/lib/rustlib
Alex Crichton23ab70b2015-09-13 23:38:27 -070022elif [ "$TARGET" = "arm-unknown-linux-gnueabihf" ]; then
23 curl -s $EXTRA_TARGETS/$TARGET.tar.gz | tar xzf - -C $HOME/rust/lib/rustlib
Alex Crichton517b76a2015-09-13 23:53:31 -070024 sudo apt-get install gcc-4.7-arm-linux-gnueabihf qemu-user
Alex Crichton23ab70b2015-09-13 23:38:27 -070025 export CC=arm-linux-gnueabihf-gcc-4.7
Alex Crichton944a7332015-09-14 11:27:10 -070026elif [ "$TARGET" = "mips-unknown-linux-gnu" ]; then
Alex Crichtona4d78c42015-09-14 13:52:51 -070027 # Download pre-built and custom MIPS libs and then also instsall the MIPS
28 # compiler according to this post:
29 # http://sathisharada.blogspot.com/2014_10_01_archive.html
Alex Crichton944a7332015-09-14 11:27:10 -070030 curl -s $EXTRA_TARGETS/$TARGET.tar.gz | tar xzf - -C $HOME/rust/lib/rustlib
Alex Crichtona4d78c42015-09-14 13:52:51 -070031
Alex Crichton944a7332015-09-14 11:27:10 -070032 echo 'deb http://ftp.de.debian.org/debian squeeze main' | \
33 sudo tee -a /etc/apt/sources.list
34 echo 'deb http://www.emdebian.org/debian/ squeeze main' | \
35 sudo tee -a /etc/apt/sources.list
36 sudo apt-get update
Alex Crichtonac5ba002015-09-14 11:49:09 -070037 sudo apt-get install emdebian-archive-keyring
Alex Crichton86c7c432015-09-14 12:58:03 -070038 sudo apt-get install qemu-user gcc-4.4-mips-linux-gnu -y --force-yes
Alex Crichton944a7332015-09-14 11:27:10 -070039 export CC=mips-linux-gnu-gcc
Alex Crichtonacda0132015-09-13 11:22:26 -070040else
Alex Crichtona4d78c42015-09-14 13:52:51 -070041 # Download the rustlib folder from the relevant portion of main distribution's
42 # tarballs.
43 curl -s $MAIN_TARGETS/rust-$TRAVIS_RUST_VERSION-$HOST.tar.gz | \
44 tar xzf - -C $HOME/rust/lib/rustlib --strip-components=4 \
45 rust-$TRAVIS_RUST_VERSION-$HOST/rustc/lib/rustlib/$HOST
Alex Crichton944a7332015-09-14 11:27:10 -070046 TARGET=$HOST
Alex Crichtona4d78c42015-09-14 13:52:51 -070047
48 # clang has better error messages and implements alignof more broadly
49 export CC=clang
Alex Crichton83a30492015-09-12 16:15:48 -070050fi
Alex Crichton944a7332015-09-14 11:27:10 -070051
52mkdir .cargo
53cp ci/cargo-config .cargo/config
54sh ci/run.sh $TARGET
Alex Crichton9eca4682015-09-17 00:48:36 -070055
56if [ "$TARGET" = "x86_64-unknown-linux-gnu" ] && \
57 [ "$TRAVIS_RUST_VERSION" = "nightly" ] && \
58 [ "$TRAVIS_OS_NAME" = "linux" ]; then
59 sh ci/dox.sh
60fi