Skip to content
This repository was archived by the owner on Aug 12, 2021. It is now read-only.

Commit c537071

Browse files
committed
Run tests on more targets using cross and coument platform support
1 parent c3f88d9 commit c537071

File tree

3 files changed

+171
-7
lines changed

3 files changed

+171
-7
lines changed

.travis.yml

Lines changed: 80 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,96 @@ matrix:
88
- name: "Tools"
99
install: true
1010
script: sh ci/tools.sh
11-
- name: "x86_64-unknown-linux-gnu"
12-
env: TARGET=x86_64-unknown-linux-gnu
13-
- name: "i686-unknown-linux-gnu"
14-
env: TARGET=i686-unknown-linux-gnu
11+
12+
# cross targets:
13+
- name: "aarch64-linux-android"
14+
env: TARGET=aarch64-linux-android CROSS=1
15+
- name: "aarch64-unknown-linux-gnu"
16+
env: TARGET=aarch64-unknown-linux-gnu CROSS=1
17+
- name: "arm-linux-androideabi"
18+
env: TARGET=arm-linux-androideabi CROSS=1
19+
- name: "arm-unknown-linux-gnueabi"
20+
env: TARGET=arm-unknown-linux-gnueabi CROSS=1
21+
- name: "arm-unknown-linux-musleabi"
22+
env: TARGET=arm-unknown-linux-musleabi CROSS=1
23+
- name: "armv7-linux-androideabi"
24+
env: TARGET=armv7-linux-androideabi CROSS=1
25+
- name: "armv7-unknown-linux-gnueabihf"
26+
env: TARGET=armv7-unknown-linux-gnueabihf CROSS=1
27+
- name: "armv7-unknown-linux-musleabihf"
28+
env: TARGET=armv7-unknown-linux-musleabihf CROSS=1
29+
- name: "i586-unknown-linux-gnu"
30+
env: TARGET=i586-unknown-linux-gnu CROSS=1
31+
addons: &gcc_multilib
32+
apt:
33+
packages:
34+
- gcc-multilib
35+
- name: "i586-unknown-linux-musl"
36+
env: TARGET=i586-unknown-linux-musl CROSS=1
37+
addons: &gcc_multilib
38+
apt:
39+
packages:
40+
- gcc-multilib
41+
1542
- name: "i686-apple-darwin"
1643
env: TARGET=i686-apple-darwin
1744
os: osx
1845
osx_image: xcode10
46+
- name: "i686-linux-android"
47+
env: TARGET=i686-linux-android CROSS=1
48+
- name: "i686-pc-windows-gnu"
49+
env: TARGET=i686-pc-windows-gnu CROSS=1
50+
- name: "i686-unknown-freebsd"
51+
env: TARGET=i686-unknown-freebsd NORUN=1 CROSS=1
52+
- name: "i686-unknown-linux-gnu"
53+
env: TARGET=i686-unknown-linux-gnu CROSS=1
54+
addons: *gcc_multilib
55+
- name: "i686-unknown-linux-musl"
56+
env: TARGET=i686-unknown-linux-musl CROSS=1
57+
- name: "mips-unknown-linux-gnu"
58+
env: TARGET=mips-unknown-linux-gnu CROSS=1
59+
- name: "mips64-unknown-linux-gnuabi64"
60+
env: TARGET=mips64-unknown-linux-gnuabi64 CROSS=1
61+
- name: "mips64el-unknown-linux-gnuabi64"
62+
env: TARGET=mips64el-unknown-linux-gnuabi64 CROSS=1
63+
- name: "mipsel-unknown-linux-gnu"
64+
env: TARGET=mipsel-unknown-linux-gnu CROSS=1
65+
- name: "powerpc-unknown-linux-gnu"
66+
env: TARGET=powerpc-unknown-linux-gnu CROSS=1
67+
- name: "powerpc64-unknown-linux-gnu"
68+
env: TARGET=powerpc64-unknown-linux-gnu CROSS=1
69+
- name: "powerpc64le-unknown-linux-gnu"
70+
env: TARGET=powerpc64le-unknown-linux-gnu CROSS=1
71+
- name: "s390x-unknown-linux-gnu"
72+
env: TARGET=s390x-unknown-linux-gnu CROSS=1 NORUN=1
73+
- name: "sparc64-unknown-linux-gnu"
74+
env: TARGET=sparc64-unknown-linux-gnu CROSS=1 NORUN=1
1975
- name: "x86_64-apple-darwin"
2076
env: TARGET=x86_64-apple-darwin
2177
os: osx
2278
osx_image: xcode10
2379
install: true
80+
- name: "x86_64-linux-android"
81+
env: TARGET=x86_64-linux-android CROSS=1
82+
- name: "x86_64-sun-solaris"
83+
env: TARGET=x86_64-sun-solaris NORUN=1 CROSS=1
84+
- name: "x86_64-unknown-freebsd"
85+
env: TARGET=x86_64-unknown-freebsd NORUN=1 CROSS=1
86+
- name: "x86_64-unknown-linux-gnu"
87+
env: TARGET=x86_64-unknown-linux-gnu
88+
install: true
89+
- name: "x86_64-unknown-linux-musl"
90+
env: TARGET=x86_64-unknown-linux-musl CROSS=1
91+
- name: "x86_64-unknown-netbsd"
92+
env: TARGET=x86_64-unknown-netbsd NORUN=1 CROSS=1
93+
94+
install:
95+
- travis_retry rustup target add $TARGET
96+
- |
97+
if [ "$CROSS" = "1" ]; then
98+
cargo install cross
99+
fi
24100
25-
install: travis_retry rustup target add $TARGET
26101
script:
27102
- cargo generate-lockfile
28103
- sh ci/run.sh "${TARGET}"

README

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
[![Build Status](https://travis-ci.com/rust-lang/libtest.svg?branch=master)](https://travis-ci.com/rust-lang/libtest) [![Build Status](https://dev.azure.com/gonzalobg88/libtest/_apis/build/status/rust-lang.libtest?branchName=master)](https://dev.azure.com/gonzalobg88/libtest/_build/latest?definitionId=1&branchName=master) [![Latest Version]][crates.io] [![docs]][master_docs]
2+
3+
libtest - Rust's built-in unit-testing and benchmarking framework
4+
===
5+
6+
See [The Rust Programming Language chapter on
7+
Testing](https://doc.rust-lang.org/book/ch11-00-testing.html).
8+
9+
## Platform support
10+
11+
The following table describes the supported platforms: "build" shows whether the
12+
library compiles without issues for a given target, while "run" shows whether
13+
the full testsuite passes on the target.
14+
15+
| Target | Build | Run |
16+
|-----------------------------------|-------|-----|
17+
| `aarch64-linux-android` | ✓ | ✓ |
18+
| `aarch64-unknown-linux-gnu` | ✓ | ✓ |
19+
| `arm-linux-androideabi` | ✓ | ✓ |
20+
| `arm-unknown-linux-gnueabi` | ✓ | ✓ |
21+
| `arm-unknown-linux-musleabi` | ✓ | ✓ |
22+
| `armv7-linux-androideabi` | ✓ | ✓ |
23+
| `armv7-unknown-linux-gnueabihf` | ✓ | ✓ |
24+
| `armv7-unknown-linux-musleabihf` | ✓ | ✓ |
25+
| `i586-unknown-linux-gnu` | ✓ | ✓ |
26+
| `i586-unknown-linux-musl` | ✓ | ✓ |
27+
| `i686-linux-android` | ✓ | ✓ |
28+
| `i686-pc-windows-gnu` | ✓ | ✓ |
29+
| `i686-apple-darwin` | ✓ | ✓ |
30+
| `i686-unknown-freebsd` | ✓ | ✗ |
31+
| `i686-unknown-linux-gnu` | ✓ | ✓ |
32+
| `i686-unknown-linux-musl` | ✓ | ✓ |
33+
| `mips-unknown-linux-gnu` | ✓ | ✓ |
34+
| `mips64-unknown-linux-gnuabi64` | ✓ | ✓ |
35+
| `mips64el-unknown-linux-gnuabi64` | ✓ | ✓ |
36+
| `mipsel-unknown-linux-gnu` | ✓ | ✓ |
37+
| `powerpc-unknown-linux-gnu` | ✓ | ✓ |
38+
| `powerpc64-unknown-linux-gnu` | ✓ | ✓ |
39+
| `powerpc64le-unknown-linux-gnu` | ✓ | ✓ |
40+
| `sparc64-unknown-linux-gnu` | ✓ | ✗ |
41+
| `s390x-unknown-linux-gnu` | ✓ | ✓ |
42+
| `x86_64-apple-darwin` | ✓ | ✓ |
43+
| `x86_64-sun-solaris` | ✓ | ✗ |
44+
| `x86_64-linux-android` | ✓ | ✓ |
45+
| `x86_64-pc-windows-gnu` | ✓ | ✓ |
46+
| `x86_64-pc-windows-msvc` | ✓ | ✓ |
47+
| `x86_64-unknown-freebsd` | ✓ | ✗ |
48+
| `x86_64-unknown-linux-gnu` | ✓ | ✓ |
49+
| `x86_64-unknown-linux-musl` | ✓ | ✓ |
50+
| `x86_64-unknown-netbsd` | ✓ | ✗ |
51+
52+
## License
53+
54+
This project is licensed under either of
55+
56+
* [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0)
57+
([LICENSE-APACHE](LICENSE-APACHE))
58+
59+
* [MIT License](http://opensource.org/licenses/MIT)
60+
([LICENSE-MIT](LICENSE-MIT))
61+
62+
at your option.
63+
64+
## Contributing
65+
66+
We welcome all people who want to contribute.
67+
68+
Contributions in any form (issues, pull requests, etc.) to this project
69+
must adhere to Rust's [Code of Conduct].
70+
71+
Unless you explicitly state otherwise, any contribution intentionally submitted
72+
for inclusion in `libtest` by you, as defined in the Apache-2.0 license, shall
73+
be dual licensed as above, without any additional terms or conditions.
74+
75+
[Code of Conduct]: https://www.rust-lang.org/en-US/conduct.html
76+
[Latest Version]: https://img.shields.io/crates/v/libtest.svg
77+
[crates.io]: https://crates.io/crates/libtest
78+
[docs]: https://docs.rs/libtest/badge.svg
79+
[docs.rs]: https://docs.rs/libtest/

ci/run.sh

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,15 @@ set -ex
44

55
: "${TARGET?The TARGET environment variable must be set.}"
66

7-
cargo test -vv --all --target="${TARGET}"
8-
cargo test -vv --all --target="${TARGET}" --release
7+
CARGO="cargo"
8+
if [ "${CROSS}" = "1" ]; then
9+
CARGO=cross
10+
fi
11+
12+
CMD="test"
13+
if [ "${NORUN}" = "1" ]; then
14+
CMD=build
15+
fi
16+
17+
"${CARGO}" "${CMD}" -vv --all --target="${TARGET}"
18+
"${CARGO}" "${CMD}" -vv --all --target="${TARGET}" --release

0 commit comments

Comments
 (0)