blob: ce29aa5a87752f4cc9839a34178f078ccdb8fe72 [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 Crichton3f07aeb2015-09-12 16:35:52 -070011# clang has better error messages and implements alignof more broadly
12export CC=clang
13
Alex Crichton23ab70b2015-09-13 23:38:27 -070014EXTRA_TARGETS=https://people.mozilla.org/~acrichton/libc-test/2015-09-08
15
Alex Crichtonacda0132015-09-13 11:22:26 -070016if [ "$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
20 docker run -v `pwd`:/clone -t alexcrichton/rust-libc-test sh ci/run.sh $TARGET
Alex Crichton2f846f32015-09-13 21:21:46 -070021elif [ "$TARGET" = "x86_64-unknown-linux-musl" ]; then
Alex Crichton23ab70b2015-09-13 23:38:27 -070022 curl -s $EXTRA_TARGETS/$TARGET.tar.gz | tar xzf - -C $HOME/rust/lib/rustlib
23 sh ci/run.sh $TARGET
24elif [ "$TARGET" = "arm-unknown-linux-gnueabihf" ]; then
25 curl -s $EXTRA_TARGETS/$TARGET.tar.gz | tar xzf - -C $HOME/rust/lib/rustlib
Alex Crichton517b76a2015-09-13 23:53:31 -070026 sudo apt-get install gcc-4.7-arm-linux-gnueabihf qemu-user
Alex Crichton23ab70b2015-09-13 23:38:27 -070027 mkdir .cargo
28 cp ci/cargo-config .cargo/config
29 export CC=arm-linux-gnueabihf-gcc-4.7
Alex Crichtonacda0132015-09-13 11:22:26 -070030 sh ci/run.sh $TARGET
31else
Alex Crichton83a30492015-09-12 16:15:48 -070032 # Download and install the relevant target locally, then run tests
33 curl -sO https://static.rust-lang.org/dist/rust-$TRAVIS_RUST_VERSION-$HOST.tar.gz
34 tar xf rust-$TRAVIS_RUST_VERSION-$HOST.tar.gz
35 rm -rf $HOME/rust/lib/rustlib/$HOST
36 mv rust-$TRAVIS_RUST_VERSION-$HOST/rustc/lib/rustlib/$HOST \
37 $HOME/rust/lib/rustlib
38 sh ci/run.sh $HOST
Alex Crichton83a30492015-09-12 16:15:48 -070039fi