Skip to content

Commit b338ccc

Browse files
committed
testing: first shot at testing with travis for arm, mips, android, ...
This is based on libc and the new docker-based testing infrastructure via posborne/rust-cross. Signed-off-by: Paul Osborne <[email protected]>
1 parent cd3fdaf commit b338ccc

File tree

2 files changed

+70
-15
lines changed

2 files changed

+70
-15
lines changed

.travis.yml

Lines changed: 33 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,55 @@
11
---
2-
sudo: false
2+
sudo: required
33
language: rust
44
rust:
55
- 1.1.0 # Oldest supported version
66
- 1.2.0
77
- 1.3.0
88
- 1.4.0
99
- 1.5.0
10+
- 1.6.0
11+
- 1.7.0
1012
- stable
1113
- beta
1214
- nightly
1315

14-
# Failures on nightly shouldn't fail the overall build.
15-
matrix:
16-
allow_failures:
17-
- rust: nightly
16+
script:
17+
- sh ci/run-docker.sh
1818

1919
os:
2020
- linux
2121
- osx
2222

2323
env:
24-
- RUST_TEST_THREADS=1 ARCH=x86_64
25-
- RUST_TEST_THREADS=1 ARCH=i686
24+
- ARCH=x86_64
25+
- ARCH=i686
2626

27-
script:
28-
- curl -sSL https://raw.githubusercontent.com/carllerche/travis-rust-matrix/master/test | RUST_TEST_THREADS=1 bash
29-
- cargo doc --no-deps
30-
31-
addons:
32-
apt:
33-
packages:
34-
- gcc-multilib
27+
# Failures on nightly shouldn't fail the overall build.
28+
matrix:
29+
fast_finish: true
30+
include:
31+
- os: linux
32+
env: TARGET=aarch64-unknown-linux-gnu DOCKER_IMAGE=posborne/rust-cross:arm
33+
rust: 1.7.0
34+
- os: linux
35+
env: TARGET=arm-unknown-linux-gnueabihf DOCKER_IMAGE=posborne/rust-cross:arm
36+
rust: 1.7.0
37+
- os: linux
38+
env: TARGET=mips-unknown-linux-gnu DOCKER_IMAGE=posborne/rust-cross:mips
39+
rust: 1.7.0
40+
- os: linux
41+
env: TARGET=mipsel-unknwon-linux-gnu DOCKER_IMAGE=posborne/rust-cross:mips
42+
rust: 1.7.0
43+
- os: linux
44+
env: TARGET=arm-linux-androideabi DOCKER_IMAGE=posborne/rust-cross:android
45+
rust: 1.7.0
46+
allow_failures:
47+
- rust: nightly
48+
- env: TARGET=aarch64-unknown-linux-gnu DOCKER_IMAGE=posborne/rust-cross:arm
49+
- env: TARGET=arm-unknown-linux-gnueabihf DOCKER_IMAGE=posborne/rust-cross:arm
50+
- env: TARGET=mips-unknown-linux-gnu DOCKER_IMAGE=posborne/rust-cross:mips
51+
- env: TARGET=mipsel-unknwon-linux-gnu DOCKER_IMAGE=posborne/rust-cross:mips
52+
- env: TARGET=arm-linux-androideabi DOCKER_IMAGE=posborne/rust-cross:android
3553

3654
# Deploy documentation to S3 for specific branches. At some
3755
# point, it would be nice to also support building docs for

ci/run-travis.sh

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/bin/bash
2+
#
3+
# Entry point for all travis builds, this will set up the Travis environment by
4+
# downloading any dependencies. It will then execute the `run.sh` script to
5+
# build and execute all tests.
6+
#
7+
# Much of this script was liberally stolen from rust-lang/libc
8+
#
9+
# Key variables that may be set from Travis:
10+
# - TRAVIS_RUST_VERSION: 1.1.0 ... stable/nightly/beta
11+
# - TRAVIS_OS_NAME: linux/osx
12+
# - DOCKER_IMAGE: posborne/rust-cross:arm
13+
# - TARGET: e.g. arm-unknown-linux-gnueabihf
14+
15+
set -ex
16+
17+
BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
18+
19+
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
20+
OS=unknown-linux-gnu
21+
else
22+
OS=apple-darwin
23+
fi
24+
25+
export HOST=$ARCH-$OS
26+
if [ "$TARGET" = "" ]; then
27+
TARGET=$HOST
28+
fi
29+
30+
if [ "$DOCKER_IMAGE" = "" ]; then
31+
RUST_TEST_THREADS=1 cargo test
32+
else
33+
export RUST_VERSION=${TRAVIS_RUST_VERSION}
34+
export RUST_TARGET=${TARGET}
35+
export DOCKER_IMAGE=${DOCKER_IMAGE}
36+
${BASE_DIR}/ci/run-docker.sh
37+
fi

0 commit comments

Comments
 (0)