Skip to content

Commit f7aacb1

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

7 files changed

+73
-11
lines changed

.travis.yml

+19
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@ sudo: false
33

44
matrix:
55
include:
6+
- env: TARGET=thumbv6m-none-eabi
7+
os: linux
8+
sudo: required
9+
- env: TARGET=thumbv7m-none-eabi
10+
os: linux
11+
sudo: required
12+
- env: TARGET=thumbv7em-none-eabi
13+
os: linux
14+
sudo: required
615
- env: TARGET=i586-unknown-linux-gnu
716
os: linux
817
services: docker
@@ -84,6 +93,16 @@ matrix:
8493
os: osx
8594
- env: TARGET=x86_64-unknown-linux-gnu
8695
os: linux
96+
allow_failures:
97+
# Issue #2. Flaky test
98+
- env: TARGET=arm-unknown-linux-gnueabi
99+
os: linux
100+
# Issue #2. Flaky test
101+
- env: TARGET=arm-unknown-linux-gnueabihf
102+
os: linux
103+
# Issue #2. Flaky test
104+
- env: TARGET=armv7-unknown-linux-gnueabihf
105+
os: linux
87106

88107
before_install:
89108
- 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

+14-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,13 @@ install_binutils() {
3232
osx)
3333
brew install binutils
3434
;;
35-
*)
35+
linux)
36+
case $TARGET in
37+
thumbv*-none-eabi)
38+
sudo apt-get install -y --no-install-recommends \
39+
binutils-arm-none-eabi
40+
;;
41+
esac
3642
;;
3743
esac
3844
}
@@ -79,6 +85,12 @@ add_rustup_target() {
7985
fi
8086
}
8187

88+
install_xargo() {
89+
if [[ $CARGO == "xargo" ]]; then
90+
curl -sf "https://raw.githubusercontent.com/japaric/rust-everywhere/master/install.sh" | bash -s -- --from japaric/xargo
91+
fi
92+
}
93+
8294
configure_cargo() {
8395
if [[ $PREFIX ]]; then
8496
${PREFIX}gcc -v
@@ -99,6 +111,7 @@ main() {
99111
install_c_toolchain
100112
install_rust
101113
add_rustup_target
114+
install_xargo
102115
configure_cargo
103116
fi
104117
}

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)