blob: 2e6613d15d7ef88f0ce3d47d60e3cb40a2014484 [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 Crichton83a30492015-09-12 16:15:48 -070014if [ "$TARGET" = "" ]; then
15 # Download and install the relevant target locally, then run tests
16 curl -sO https://static.rust-lang.org/dist/rust-$TRAVIS_RUST_VERSION-$HOST.tar.gz
17 tar xf rust-$TRAVIS_RUST_VERSION-$HOST.tar.gz
18 rm -rf $HOME/rust/lib/rustlib/$HOST
19 mv rust-$TRAVIS_RUST_VERSION-$HOST/rustc/lib/rustlib/$HOST \
20 $HOME/rust/lib/rustlib
21 sh ci/run.sh $HOST
22
23elif [ "$TARGET" = "arm-linux-androideabi" ]; then
24 # Pull a pre-built docker image for testing android, then run tests entirely
25 # within that image.
26 docker pull alexcrichton/rust-libc-test
27 docker run -v `pwd`:/clone -t alexcrichton/rust-libc-test sh ci/run.sh $TARGET
28else
29 echo "Unknown target: $TARGET"
30 exit 1
31fi