CI: test ARM Cortex targets

closes #32
This commit is contained in:
Jorge Aparicio 2016-08-13 11:32:52 -05:00
parent 7ac5155ba6
commit ba3bb2952f
7 changed files with 76 additions and 12 deletions

View File

@ -3,6 +3,25 @@ sudo: false
matrix:
include:
- env: TARGET=thumbv6m-none-eabi
os: linux
dist: trusty
addons:
apt:
packages: &cortex
- binutils-arm-none-eabi
- env: TARGET=thumbv7m-none-eabi
os: linux
dist: trusty
addons:
apt:
packages: *cortex
- env: TARGET=thumbv7em-none-eabi
os: linux
dist: trusty
addons:
apt:
packages: *cortex
- env: TARGET=i586-unknown-linux-gnu
os: linux
services: docker
@ -84,6 +103,16 @@ matrix:
os: osx
- env: TARGET=x86_64-unknown-linux-gnu
os: linux
allow_failures:
# Issue #2. Flaky test
- env: TARGET=arm-unknown-linux-gnueabi
os: linux
# Issue #2. Flaky test
- env: TARGET=arm-unknown-linux-gnueabihf
os: linux
# Issue #2. Flaky test
- env: TARGET=armv7-unknown-linux-gnueabihf
os: linux
before_install:
- export PATH="$PATH:$HOME/.cargo/bin"

View File

@ -25,8 +25,6 @@ case $TARGET in
export QEMU_LD_PREFIX=/usr/arm-linux-gnueabihf
;;
armv7-unknown-linux-gnueabihf)
# See #2
export DONT_RUN_TESTS=y
export PREFIX=arm-linux-gnueabihf-
export QEMU_LD_PREFIX=/usr/arm-linux-gnueabihf
;;
@ -65,13 +63,19 @@ case $TARGET in
export QEMU_LD_PREFIX=/usr/powerpc64-linux-gnu
;;
powerpc64le-unknown-linux-gnu)
# See #2
export DONT_RUN_TESTS=y
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
# Issue #2. QEMU doesn't work
export RUN_TESTS=n
;;
thumbv*-none-eabi)
export CARGO=xargo
export PREFIX=arm-none-eabi-
# Bare metal targets. No `std` or `test` crates for these targets.
export RUN_TESTS=n
;;
esac

View File

@ -32,8 +32,6 @@ install_binutils() {
osx)
brew install binutils
;;
*)
;;
esac
}
@ -79,6 +77,12 @@ add_rustup_target() {
fi
}
install_xargo() {
if [[ $CARGO == "xargo" ]]; then
curl -sf "https://raw.githubusercontent.com/japaric/rust-everywhere/master/install.sh" | bash -s -- --from japaric/xargo
fi
}
configure_cargo() {
if [[ $PREFIX ]]; then
${PREFIX}gcc -v
@ -99,6 +103,7 @@ main() {
install_c_toolchain
install_rust
add_rustup_target
install_xargo
configure_cargo
fi
}

View File

@ -3,8 +3,8 @@ set -ex
. $(dirname $0)/env.sh
build() {
cargo build --target $TARGET
cargo build --target $TARGET --release
${CARGO:-cargo} build --target $TARGET
${CARGO:-cargo} build --target $TARGET --release
}
run_tests() {
@ -14,14 +14,14 @@ run_tests() {
if [[ $QEMU ]]; then
cargo test --target $TARGET --no-run
if [[ -z $DONT_RUN_TESTS ]]; then
if [[ ${RUN_TESTS:-y} == "y" ]]; then
$QEMU target/**/debug/rustc_builtins-*
fi
cargo test --target $TARGET --release --no-run
if [[ -z $DONT_RUN_TESTS ]]; then
if [[ ${RUN_TESTS:-y} == "y" ]]; then
$QEMU target/**/release/rustc_builtins-*
fi
elif [[ -z $DONT_RUN_TESTS ]]; then
elif [[ ${RUN_TESTS:-y} == "y" ]]; then
cargo test --target $TARGET
cargo test --target $TARGET --release
fi
@ -50,8 +50,8 @@ main() {
bash ci/script.sh'
else
build
run_tests
inspect
run_tests
fi
}

10
thumbv6m-none-eabi.json Normal file
View File

@ -0,0 +1,10 @@
{
"arch": "arm",
"data-layout": "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64",
"features": "+strict-align",
"llvm-target": "thumbv6m-none-eabi",
"max-atomic-width": 0,
"os": "none",
"target-endian": "little",
"target-pointer-width": "32"
}

8
thumbv7em-none-eabi.json Normal file
View File

@ -0,0 +1,8 @@
{
"arch": "arm",
"data-layout": "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64",
"llvm-target": "thumbv7em-none-eabi",
"os": "none",
"target-endian": "little",
"target-pointer-width": "32"
}

8
thumbv7m-none-eabi.json Normal file
View File

@ -0,0 +1,8 @@
{
"arch": "arm",
"data-layout": "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64",
"llvm-target": "thumbv7m-none-eabi",
"os": "none",
"target-endian": "little",
"target-pointer-width": "32"
}