Skip to content

Commit 4fdbb44

Browse files
committed
Test all targets with Rust nightly, beta, stable, and 1.13.0
1 parent 42cd3ba commit 4fdbb44

File tree

2 files changed

+47
-61
lines changed

2 files changed

+47
-61
lines changed

.travis.yml

Lines changed: 18 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,28 @@
11
language: rust
2-
rust: stable
2+
rust: nightly
33
sudo: required
44
dist: xenial
55
services: docker
66

77
matrix:
88
include:
9-
# 1.13.0 compat
10-
- env: TARGET=x86_64-unknown-linux-gnu
11-
rust: 1.13.0
12-
script: rm -f Cargo.lock && cargo build
13-
install: true
14-
15-
# build documentation
16-
- env: TARGET=x86_64-unknown-linux-gnu
9+
- name: "Documentation"
10+
env: TARGET=x86_64-unknown-linux-gnu
1711
rust: nightly
1812
script: sh ci/dox.sh
1913
install: true
14+
- name: "Shellcheck"
15+
install: true
16+
script:
17+
- shellcheck --version
18+
- shellcheck ci/*.sh
2019

21-
# stable compat
2220
- env: TARGET=x86_64-unknown-linux-gnu
23-
install: true
2421
- env: TARGET=i686-unknown-linux-gnu
22+
- env: TARGET=x86_64-unknown-linux-gnux32 OPT="--release"
2523
- os: osx
2624
env: TARGET=x86_64-apple-darwin
2725
osx_image: xcode10
28-
install: true
2926
- os: osx
3027
env: TARGET=i686-apple-darwin
3128
osx_image: xcode10
@@ -52,48 +49,24 @@ matrix:
5249
- env: TARGET=sparc64-unknown-linux-gnu
5350
- env: TARGET=asmjs-unknown-emscripten
5451
- env: TARGET=wasm32-unknown-emscripten
55-
56-
# beta
57-
- env: TARGET=x86_64-unknown-linux-gnu
58-
rust: beta
59-
install: true
60-
- os: osx
61-
env: TARGET=x86_64-apple-darwin
62-
osx_image: xcode10
63-
rust: beta
64-
install: true
65-
66-
# nightly
67-
- env: TARGET=x86_64-unknown-linux-gnu
68-
rust: nightly
69-
install: true
70-
- os: osx
71-
env: TARGET=x86_64-apple-darwin
72-
osx_image: xcode10
73-
rust: nightly
74-
install: true
75-
# not available on stable
76-
# without --release the build fails
77-
# see https://github.com/rust-lang/rust/issues/45417
78-
- env: TARGET=x86_64-unknown-linux-gnux32 OPT="--release"
79-
rust: nightly
80-
8152
- env: TARGET=wasm32-unknown-unknown
8253
install: rustup target add $TARGET
8354
script: cargo build --no-default-features --target $TARGET --release
8455

85-
- name: "Shellcheck"
86-
install: true
87-
script:
88-
- shellcheck --version
89-
- shellcheck ci/*.sh
90-
9156
allow_failures:
9257
# FIXME: https://github.com/rust-lang/libc/issues/1226
9358
- env: TARGET=asmjs-unknown-emscripten
9459
- env: TARGET=wasm32-unknown-emscripten
9560

96-
install: rustup target add $TARGET
61+
install:
62+
- rustup install beta
63+
- rustup install stable
64+
- rustup install 1.13.0
65+
- rustup target add $TARGET || true
66+
- rustup target add $TARGET --toolchain beta || true
67+
- rustup target add $TARGET --toolchain stable || true
68+
- rustup target add $TARGET --toolchain 1.13.0 || true
69+
9770
script:
9871
- cargo generate-lockfile --manifest-path libc-test/Cargo.toml
9972
- if [[ $TRAVIS_OS_NAME = "linux" ]]; then

ci/run.sh

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -80,20 +80,33 @@ if [ "$QEMU" != "" ]; then
8080
exec grep "^PASSED .* tests" "${CARGO_TARGET_DIR}/out.log"
8181
fi
8282

83-
# FIXME: x86_64-unknown-linux-gnux32 fail to compile without --release
84-
# See https://github.com/rust-lang/rust/issues/45417
85-
opt=
86-
if [ "$TARGET" = "x86_64-unknown-linux-gnux32" ]; then
87-
opt="--release"
88-
fi
83+
build_types="+nightly +beta +stable +1.13.0"
84+
for build_type in $build_types;
85+
do
86+
87+
opt=
88+
if [ "$TARGET" = "x86_64-unknown-linux-gnux32" ]; then
89+
# FIXME: x86_64-unknown-linux-gnux32 fail to compile without --release
90+
# See https://github.com/rust-lang/rust/issues/45417
91+
opt="--release"
92+
93+
# x86_64-unknown-linux-gnux32 is only available on nightly:
94+
if [ "$build_type" != "nightly" ]; then
95+
continue
96+
fi
97+
fi
98+
99+
# Building with --no-default-features is currently broken on rumprun because we
100+
# need cfg(target_vendor), which is currently unstable.
101+
if [ "$TARGET" != "x86_64-rumprun-netbsd" ]; then
102+
cargo "$build_type" test $opt --no-default-features --manifest-path libc-test/Cargo.toml --target "${TARGET}"
103+
fi
104+
105+
# Test the #[repr(align(x))] feature; requires Rust >= 1.25.0
106+
if [ "$build_type" != "+1.13.0" ]; then
107+
cargo "$build_type" test $opt --features align --manifest-path libc-test/Cargo.toml --target "${TARGET}"
108+
fi
109+
110+
exec cargo "$build_type" test $opt --manifest-path libc-test/Cargo.toml --target "${TARGET}"
111+
done
89112

90-
# Building with --no-default-features is currently broken on rumprun because we
91-
# need cfg(target_vendor), which is currently unstable.
92-
if [ "$TARGET" != "x86_64-rumprun-netbsd" ]; then
93-
cargo test $opt --no-default-features --manifest-path libc-test/Cargo.toml --target "${TARGET}"
94-
fi
95-
# Test the #[repr(align(x))] feature if this is building on Rust >= 1.25
96-
if [ "$(rustc --version | sed -E 's/^rustc 1\.([0-9]*)\..*/\1/')" -ge 25 ]; then
97-
cargo test $opt --features align --manifest-path libc-test/Cargo.toml --target "${TARGET}"
98-
fi
99-
exec cargo test $opt --manifest-path libc-test/Cargo.toml --target "${TARGET}"

0 commit comments

Comments
 (0)