adapt to new testing infrastructure

This commit is contained in:
Jorge Aparicio 2016-09-29 18:50:04 -05:00
parent f77ca915c4
commit b5797dc2a2
8 changed files with 105 additions and 20 deletions

View File

@ -3,7 +3,6 @@ language: rust
services: docker services: docker
sudo: required sudo: required
rust: nightly rust: nightly
cache: cargo
matrix: matrix:
include: include:
@ -25,18 +24,11 @@ matrix:
- env: TARGET=mipsel-unknown-linux-gnu - env: TARGET=mipsel-unknown-linux-gnu
- env: TARGET=powerpc-unknown-linux-gnu - env: TARGET=powerpc-unknown-linux-gnu
- env: TARGET=powerpc64-unknown-linux-gnu - env: TARGET=powerpc64-unknown-linux-gnu
# QEMU crashes even when executing the simplest cross compiled C program: - env: TARGET=powerpc64le-unknown-linux-gnu
# `int main() { return 0; }`
- env: TARGET=powerpc64le-unknown-linux-gnu NO_RUN=1
- env: TARGET=thumbv6m-none-eabi - env: TARGET=thumbv6m-none-eabi
install: cargo install xargo --debug -f
script: $HOME/.cargo/bin/xargo build --target $TARGET
- env: TARGET=thumbv7em-none-eabi - env: TARGET=thumbv7em-none-eabi
install: cargo install xargo --debug -f
script: $HOME/.cargo/bin/xargo build --target $TARGET
- env: TARGET=thumbv7em-none-eabihf - env: TARGET=thumbv7em-none-eabihf
install: cargo install xargo --debug -f - env: TARGET=thumbv7m-none-eabi
script: $HOME/.cargo/bin/xargo build --target $TARGET
- env: TARGET=x86_64-apple-darwin - env: TARGET=x86_64-apple-darwin
os: osx os: osx
env: TARGET=x86_64-unknown-linux-gnu env: TARGET=x86_64-unknown-linux-gnu
@ -45,8 +37,10 @@ before_install:
- test "$TRAVIS_OS_NAME" = "osx" || docker run --rm --privileged multiarch/qemu-user-static:register - test "$TRAVIS_OS_NAME" = "osx" || docker run --rm --privileged multiarch/qemu-user-static:register
install: install:
- curl https://static.rust-lang.org/rustup.sh | - if case $TARGET in thumb*) false;; *) true;; esac; then
sh -s -- --add-target=$TARGET --disable-sudo -y --prefix=`rustc --print sysroot` curl https://static.rust-lang.org/rustup.sh |
sh -s -- --add-target=$TARGET --disable-sudo -y --prefix=`rustc --print sysroot`;
fi
script: script:
- cargo generate-lockfile - cargo generate-lockfile

View File

@ -406,7 +406,7 @@ fn main() {
} }
for src in sources.map.values() { for src in sources.map.values() {
cfg.file(Path::new("compiler-rt/lib/builtins").join(src)); cfg.file(Path::new("compiler-rt/compiler-rt-cdylib/compiler-rt/lib/builtins").join(src));
} }
cfg.compile("libcompiler-rt.a"); cfg.compile("libcompiler-rt.a");

View File

@ -0,0 +1,8 @@
FROM ubuntu:16.04
RUN apt-get update
RUN apt-get install -y --no-install-recommends \
ca-certificates curl gcc gcc-arm-none-eabi libc6-dev libcurl4-openssl-dev libssh2-1 libnewlib-dev
ENV AR_thumbv6m_none_eabi=arm-none-eabi-ar \
CARGO_TARGET_THUMBV6M_NONE_EABI_LINKER=arm-none-eabi-gcc \
CC_thumbv6m_none_eabi=arm-none-eabi-gcc \
PATH=$PATH:/rust/bin

View File

@ -0,0 +1,8 @@
FROM ubuntu:16.04
RUN apt-get update
RUN apt-get install -y --no-install-recommends \
ca-certificates curl gcc gcc-arm-none-eabi libc6-dev libcurl4-openssl-dev libssh2-1 libnewlib-dev
ENV AR_thumbv7em_none_eabi=arm-none-eabi-ar \
CARGO_TARGET_THUMBV7EM_NONE_EABI_LINKER=arm-none-eabi-gcc \
CC_thumbv7em_none_eabi=arm-none-eabi-gcc \
PATH=$PATH:/rust/bin

View File

@ -0,0 +1,8 @@
FROM ubuntu:16.04
RUN apt-get update
RUN apt-get install -y --no-install-recommends \
ca-certificates curl gcc gcc-arm-none-eabi libc6-dev libcurl4-openssl-dev libssh2-1 libnewlib-dev
ENV AR_thumbv7em_none_eabihf=arm-none-eabi-ar \
CARGO_TARGET_THUMBV7EM_NONE_EABIHF_LINKER=arm-none-eabi-gcc \
CC_thumbv7em_none_eabihf=arm-none-eabi-gcc \
PATH=$PATH:/rust/bin

View File

@ -0,0 +1,8 @@
FROM ubuntu:16.04
RUN apt-get update
RUN apt-get install -y --no-install-recommends \
ca-certificates curl gcc gcc-arm-none-eabi libc6-dev libcurl4-openssl-dev libssh2-1 libnewlib-dev
ENV AR_thumbv7m_none_eabi=arm-none-eabi-ar \
CARGO_TARGET_THUMBV7M_NONE_EABI_LINKER=arm-none-eabi-gcc \
CC_thumbv7m_none_eabi=arm-none-eabi-gcc \
PATH=$PATH:/rust/bin

View File

@ -5,19 +5,15 @@ set -ex
run() { run() {
echo $1 echo $1
CMD="cargo test --target $1" docker build -t $1 ci/docker/$1
if [ "$NO_RUN" = "1" ]; then
CMD="$CMD --no-run"
fi
docker build -t libc ci/docker/$1
docker run \ docker run \
-v `rustc --print sysroot`:/rust:ro \ -v `rustc --print sysroot`:/rust:ro \
-v `pwd`:/checkout:ro \ -v `pwd`:/checkout:ro \
-e CARGO_TARGET_DIR=/tmp/target \ -e CARGO_TARGET_DIR=/tmp/target \
-w /checkout \ -w /checkout \
--privileged \ --privileged \
-it libc \ -it $1 \
bash -c "$CMD && $CMD --release" sh ci/run.sh $1
} }
if [ -z "$1" ]; then if [ -z "$1" ]; then

63
ci/run.sh Normal file
View File

@ -0,0 +1,63 @@
# Test our implementation
case $1 in
thumb*)
curl -sf "https://raw.githubusercontent.com/japaric/rust-everywhere/master/install.sh" | \
bash -s -- --at /usr/bin --from japaric/xargo --tag v0.1.10
xargo build --target $1
xargo build --target $1 --release
;;
# QEMU crashes even when executing the simplest cross compiled C program:
# `int main() { return 0; }`
powerpc64le-unknown-linux-gnu)
cargo test --target $1 --no-run
cargo test --target $1 --no-run --release
;;
*)
cargo test --target $1
cargo test --target $1 --release
;;
esac
# Verify that we haven't drop any intrinsic/symbol
case $1 in
thumb*)
xargo build --features c --target $1 --bin intrinsics
;;
*)
cargo build --features c --target $1 --bin intrinsics
;;
esac
# Look out for duplicated symbols when we include the compiler-rt (C) implementation
PREFIX=$(echo $1 | sed -e 's/unknown-//')
case $1 in
armv7-*)
PREFIX=arm-linux-gnueabihf-
;;
thumb*)
PREFIX=arm-none-eabi-
;;
*-unknown-linux-gnu | *-apple-darwin)
PREFIX=
;;
esac
case $TRAVIS_OS_NAME in
osx)
NM=gnm
# NOTE OSx's nm doesn't accept the `--defined-only` or provide an equivalent.
# Use GNU nm instead
brew install binutils
;;
*)
NM=nm
;;
esac
$PREFIX$NM -g --defined-only /tmp/target/${1}/debug/librustc_builtins.rlib | \
sort | uniq -d | grep 'T __'
if test $? = 0; then
exit 1
fi