Merge pull request #18 from japaric/ppc64le

CI: test powerpc64le-unknown-linux-gnu
This commit is contained in:
Jorge Aparicio 2016-08-08 21:57:32 -05:00 committed by GitHub
commit 7e04b20c48
4 changed files with 73 additions and 11 deletions

View File

@ -60,6 +60,10 @@ matrix:
- libc6-powerpc-cross
- libc6-dev-powerpc-cross
- qemu-user-static
- env: TARGET=powerpc64le-unknown-linux-gnu
os: linux
services: docker
sudo: required
- env: TARGET=x86_64-apple-darwin
os: osx
- env: TARGET=x86_64-unknown-linux-gnu
@ -68,6 +72,9 @@ matrix:
# FIXME(#2)
- env: TARGET=armv7-unknown-linux-gnueabihf
os: linux
# FIXME QEMU blows up
- env: TARGET=powerpc64le-unknown-linux-gnu
os: linux
before_install:
- export PATH="$PATH:$HOME/.cargo/bin"

View File

@ -28,4 +28,13 @@ case $TARGET in
export PREFIX=powerpc-linux-gnu-
export QEMU_LD_PREFIX=/usr/powerpc-linux-gnu
;;
powerpc64le-unknown-linux-gnu)
# NOTE $DOCKER values: 'y' (yes, call docker), 'i' (inside a docker container) or 'n' ("no)
if [[ -z $DOCKER ]]; then
export DOCKER=y
fi
export PREFIX=powerpc64le-linux-gnu-
export QEMU=qemu-ppc64le
export QEMU_LD_PREFIX=/usr/powerpc64le-linux-gnu
;;
esac

View File

@ -2,6 +2,23 @@ set -ex
. $(dirname $0)/env.sh
install_deps() {
if [[ ${DOCKER} == "i" ]]; then
apt-get update
apt-get install -y --no-install-recommends \
ca-certificates curl
fi
}
install_qemu() {
case $TARGET in
powerpc64le-unknown-linux-gnu)
apt-get install -y --no-install-recommends \
qemu-user
;;
esac
}
install_binutils() {
case $TRAVIS_OS_NAME in
osx)
@ -16,7 +33,11 @@ install_c_toolchain() {
case $TARGET in
aarch64-unknown-linux-gnu)
sudo apt-get install -y --no-install-recommends \
gcc-aarch64-linux-gnu libc6-arm64-cross libc6-dev-arm64-cross
gcc-aarch64-linux-gnu libc6-dev-arm64-cross
;;
powerpc64le-unknown-linux-gnu)
apt-get install -y --no-install-recommends \
gcc-powerpc64le-linux-gnu libc6-dev-ppc64el-cross
;;
*)
;;
@ -49,11 +70,15 @@ EOF
}
main() {
if [[ ${DOCKER:-n} != "y" ]]; then
install_deps
install_qemu
install_binutils
install_c_toolchain
install_rust
add_rustup_target
configure_cargo
fi
}
main

View File

@ -12,8 +12,15 @@ run_tests() {
export RUST_TEST_THREADS=1
fi
if [[ $QEMU ]]; then
cargo test --target $TARGET --no-run
$QEMU target/**/debug/rustc_builtins-*
cargo test --target $TARGET --release --no-run
$QEMU target/**/release/rustc_builtins-*
else
cargo test --target $TARGET
cargo test --target $TARGET --release
fi
}
inspect() {
@ -25,9 +32,23 @@ inspect() {
}
main() {
if [[ $DOCKER == "y" ]]; then
docker run \
-e DOCKER=i \
-e TARGET=$TARGET \
-e TRAVIS_OS_NAME=$TRAVIS_OS_NAME \
-v $(pwd):/mnt \
ubuntu:16.04 \
sh -c 'set -ex;
cd /mnt;
export PATH="$PATH:$HOME/.cargo/bin";
bash ci/install.sh;
bash ci/script.sh'
else
build
run_tests
inspect
fi
}
main