Skip to content

Commit ba3bb29

Browse files
author
Jorge Aparicio
committed
CI: test ARM Cortex targets
closes #32
1 parent 7ac5155 commit ba3bb29

7 files changed

+76
-12
lines changed

.travis.yml

+29
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,25 @@ sudo: false
33

44
matrix:
55
include:
6+
- env: TARGET=thumbv6m-none-eabi
7+
os: linux
8+
dist: trusty
9+
addons:
10+
apt:
11+
packages: &cortex
12+
- binutils-arm-none-eabi
13+
- env: TARGET=thumbv7m-none-eabi
14+
os: linux
15+
dist: trusty
16+
addons:
17+
apt:
18+
packages: *cortex
19+
- env: TARGET=thumbv7em-none-eabi
20+
os: linux
21+
dist: trusty
22+
addons:
23+
apt:
24+
packages: *cortex
625
- env: TARGET=i586-unknown-linux-gnu
726
os: linux
827
services: docker
@@ -84,6 +103,16 @@ matrix:
84103
os: osx
85104
- env: TARGET=x86_64-unknown-linux-gnu
86105
os: linux
106+
allow_failures:
107+
# Issue #2. Flaky test
108+
- env: TARGET=arm-unknown-linux-gnueabi
109+
os: linux
110+
# Issue #2. Flaky test
111+
- env: TARGET=arm-unknown-linux-gnueabihf
112+
os: linux
113+
# Issue #2. Flaky test
114+
- env: TARGET=armv7-unknown-linux-gnueabihf
115+
os: linux
87116

88117
before_install:
89118
- export PATH="$PATH:$HOME/.cargo/bin"

ci/env.sh

+8-4
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ case $TARGET in
2525
export QEMU_LD_PREFIX=/usr/arm-linux-gnueabihf
2626
;;
2727
armv7-unknown-linux-gnueabihf)
28-
# See #2
29-
export DONT_RUN_TESTS=y
3028
export PREFIX=arm-linux-gnueabihf-
3129
export QEMU_LD_PREFIX=/usr/arm-linux-gnueabihf
3230
;;
@@ -65,13 +63,19 @@ case $TARGET in
6563
export QEMU_LD_PREFIX=/usr/powerpc64-linux-gnu
6664
;;
6765
powerpc64le-unknown-linux-gnu)
68-
# See #2
69-
export DONT_RUN_TESTS=y
7066
if [[ -z $DOCKER ]]; then
7167
export DOCKER=y
7268
fi
7369
export PREFIX=powerpc64le-linux-gnu-
7470
export QEMU=qemu-ppc64le
7571
export QEMU_LD_PREFIX=/usr/powerpc64le-linux-gnu
72+
# Issue #2. QEMU doesn't work
73+
export RUN_TESTS=n
74+
;;
75+
thumbv*-none-eabi)
76+
export CARGO=xargo
77+
export PREFIX=arm-none-eabi-
78+
# Bare metal targets. No `std` or `test` crates for these targets.
79+
export RUN_TESTS=n
7680
;;
7781
esac

ci/install.sh

+7-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ install_binutils() {
3232
osx)
3333
brew install binutils
3434
;;
35-
*)
36-
;;
3735
esac
3836
}
3937

@@ -79,6 +77,12 @@ add_rustup_target() {
7977
fi
8078
}
8179

80+
install_xargo() {
81+
if [[ $CARGO == "xargo" ]]; then
82+
curl -sf "https://raw.githubusercontent.com/japaric/rust-everywhere/master/install.sh" | bash -s -- --from japaric/xargo
83+
fi
84+
}
85+
8286
configure_cargo() {
8387
if [[ $PREFIX ]]; then
8488
${PREFIX}gcc -v
@@ -99,6 +103,7 @@ main() {
99103
install_c_toolchain
100104
install_rust
101105
add_rustup_target
106+
install_xargo
102107
configure_cargo
103108
fi
104109
}

ci/script.sh

+6-6
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ set -ex
33
. $(dirname $0)/env.sh
44

55
build() {
6-
cargo build --target $TARGET
7-
cargo build --target $TARGET --release
6+
${CARGO:-cargo} build --target $TARGET
7+
${CARGO:-cargo} build --target $TARGET --release
88
}
99

1010
run_tests() {
@@ -14,14 +14,14 @@ run_tests() {
1414

1515
if [[ $QEMU ]]; then
1616
cargo test --target $TARGET --no-run
17-
if [[ -z $DONT_RUN_TESTS ]]; then
17+
if [[ ${RUN_TESTS:-y} == "y" ]]; then
1818
$QEMU target/**/debug/rustc_builtins-*
1919
fi
2020
cargo test --target $TARGET --release --no-run
21-
if [[ -z $DONT_RUN_TESTS ]]; then
21+
if [[ ${RUN_TESTS:-y} == "y" ]]; then
2222
$QEMU target/**/release/rustc_builtins-*
2323
fi
24-
elif [[ -z $DONT_RUN_TESTS ]]; then
24+
elif [[ ${RUN_TESTS:-y} == "y" ]]; then
2525
cargo test --target $TARGET
2626
cargo test --target $TARGET --release
2727
fi
@@ -50,8 +50,8 @@ main() {
5050
bash ci/script.sh'
5151
else
5252
build
53-
run_tests
5453
inspect
54+
run_tests
5555
fi
5656
}
5757

thumbv6m-none-eabi.json

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"arch": "arm",
3+
"data-layout": "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64",
4+
"features": "+strict-align",
5+
"llvm-target": "thumbv6m-none-eabi",
6+
"max-atomic-width": 0,
7+
"os": "none",
8+
"target-endian": "little",
9+
"target-pointer-width": "32"
10+
}

thumbv7em-none-eabi.json

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"arch": "arm",
3+
"data-layout": "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64",
4+
"llvm-target": "thumbv7em-none-eabi",
5+
"os": "none",
6+
"target-endian": "little",
7+
"target-pointer-width": "32"
8+
}

thumbv7m-none-eabi.json

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"arch": "arm",
3+
"data-layout": "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64",
4+
"llvm-target": "thumbv7m-none-eabi",
5+
"os": "none",
6+
"target-endian": "little",
7+
"target-pointer-width": "32"
8+
}

0 commit comments

Comments
 (0)