1
1
language : rust
2
2
sudo : false
3
3
4
- # We aim to test all the following in any combination:
5
- # - standard tests, benches, documentation, all available features
6
- # - pinned stable, latest stable, beta and nightly Rust releases
7
- # - Linux, OS X, Android, iOS, bare metal (i.e. no_std)
8
- # - x86_64, ARMv7, a Big-Endian arch (MIPS)
4
+ # We support too many combinations of Rust releases, crate features, operating
5
+ # systems, and architectures to even remotely test all combinations.
6
+ # Yet it turns out we can test most of these independent of each other, because
7
+ # they serve different goals or test different pieces of code.
8
+ #
9
+ # RUST RELEASES
10
+ # Goal: make sure we don't use language features unavailable on a certain
11
+ # version, and build without warnings.
12
+ # We have different builders use 4 Rust releases, a pinned stable release,
13
+ # the latest stable, beta and nightly.
14
+ #
15
+ # ARCHITECTURES
16
+ # Goal: test against issues caused by differences in endianness, pointer sizes,
17
+ # etc.
18
+ # We run tests on 4 different architectures.
19
+ # - x64_84, default on Travis (Linux) and AppVeyor (Windows)
20
+ # - i686, second AppVeyor (Windows) configuration
21
+ # - MIPS, big-endian Linux emulated with QEMU (thanks to Trust)
22
+ # - ARMv7, Android emulated with QEMU (thanks to Trust)
23
+ #
24
+ # OPERATING SYSTEMS
25
+ # Goal: test on many operating systems, to verify the OsRng code, which is
26
+ # mostly architecture-independend.
27
+ # We run tests on Linux, OS X, Windows, Android (emulated), and Node.js (using
28
+ # cargo-web).
29
+ # One builder cross-compiles for many of the remaining OSes, which ensures we
30
+ # keep building, but doesn't run tests.
31
+ # OSes supported by Rand but which we can't cross-compile because there
32
+ # is no pre-build standard library available: Dragonfly BSD, Haiku, OpenBSD.
33
+ #
34
+ # CRATE FEATURES, TESTS, AND SUB-CRATES
35
+ # Goal: Run unit tests, doctests, examples, and benchmarks (converted to tests)
36
+ # for all crates, in configurations that cover all interesting
37
+ # combinations of features.
38
+ # Tests run on rand:
39
+ # - test no_std support, but only the unit tests:
40
+ # `cargo test --lib --no-default-features`
41
+ # - run unit tests and doctests with all features which are available on stable:
42
+ # `cargo test --features=serde1,log`
43
+ # - test examples:
44
+ # `cargo test --examples`
45
+ # Additional tests on nightly:
46
+ # - run unit tests and doctests with all features which are available on nightly:
47
+ # `cargo test --features=serde1,log,nightly`
48
+ # - test no_std support, including the nightly alloc feature:
49
+ # cargo test --lib --no-default-features --features alloc
50
+ # - run benchmarks as tests:
51
+ # `cargo test --benches --features=nightly`
52
+ # Tests on subcrates:
53
+ # `cargo test --package rand_core`
54
+ # `cargo test --package rand_core --features=alloc` (requires nightly)
55
+ # `cargo test --package rand_core --no-default-features`
56
+ # `cargo test --package rand_isaac --features=serde1`
57
+ # `cargo test --package rand_xorshift --features=serde1`
9
58
matrix :
10
59
include :
11
60
- rust : 1.22.0
61
+ env : DESCRIPTION="pinned stable Rust release"
12
62
install :
13
63
script :
14
- # TODO: use --tests instead of --lib on more recent compiler
15
64
- cargo test --lib --no-default-features
65
+ - cargo test --features=serde1,log
66
+ - cargo test --examples
67
+ - cargo test --package rand_core
16
68
- cargo test --package rand_core --no-default-features
17
- - cargo test --features serde1,log
69
+ - cargo test --package rand_isaac --features=serde1
70
+ # - cargo test --package rand_xorshift --features=serde1
71
+
18
72
- rust : stable
73
+ env : DESCRIPTION="stable Rust release, macOS, iOS (cross-compile only)"
19
74
os : osx
20
75
install :
76
+ - rustup target add aarch64-apple-ios
21
77
script :
22
- - cargo test --tests --no-default-features
78
+ - cargo test --lib --no-default-features
79
+ - cargo test --features=serde1,log
80
+ - cargo test --examples
81
+ - cargo test --package rand_core
23
82
- cargo test --package rand_core --no-default-features
24
- - cargo test --features serde1,log
83
+ - cargo test --package rand_isaac --features=serde1
84
+ # - cargo test --package rand_xorshift --features=serde1
85
+ - cargo build --target=aarch64-apple-ios
86
+
25
87
- rust : beta
88
+ env : DESCRIPTION="beta Rust release"
26
89
install :
27
90
script :
28
- - cargo test --tests --no-default-features
91
+ - cargo test --lib --no-default-features
92
+ - cargo test --features=serde1,log
93
+ - cargo test --examples
94
+ - cargo test --package rand_core
29
95
- cargo test --package rand_core --no-default-features
30
- - cargo test --features serde1,log
96
+ - cargo test --package rand_isaac --features=serde1
97
+ # - cargo test --package rand_xorshift --features=serde1
98
+
31
99
- rust : nightly
100
+ env : DESCRIPTION="nightly features, benchmarks, documentation"
32
101
install :
33
102
- cargo --list | egrep "^\s*deadlinks$" -q || cargo install cargo-deadlinks
103
+ - cargo deadlinks -V
34
104
before_script :
35
105
- pip install 'travis-cargo<0.2' --user && export PATH=$HOME/.local/bin:$PATH
36
106
script :
37
- - cargo test --tests --no-default-features --features=alloc
38
- - cargo test --package rand_core --no-default-features --features=alloc,serde1
39
- - cargo test --features serde1,log,nightly,alloc
40
- - cargo test --all --benches
107
+ - cargo test --lib --no-default-features --features alloc
108
+ - cargo test --features=serde1,log,nightly
109
+ - cargo test --benches --features=nightly
110
+ - cargo test --examples
111
+ - cargo test --package rand_core
112
+ - cargo test --package rand_core --no-default-features --features=alloc
113
+ - cargo test --package rand_isaac --features=serde1
114
+ # - cargo test --package rand_xorshift --features=serde1
41
115
# remove cached documentation, otherwise files from previous PRs can get included
42
116
- rm -rf target/doc
43
117
- cargo doc --no-deps --all --all-features
@@ -46,52 +120,53 @@ matrix:
46
120
- travis-cargo --only nightly doc-upload
47
121
48
122
- rust : nightly
123
+ env : DESCRIPTION="WASM via emscripten, stdweb and wasm-bindgen"
49
124
install :
50
125
- rustup target add wasm32-unknown-unknown
51
- # Use cargo-update since we need a real update-or-install command
52
- # Only install if not already installed:
53
- # - cargo --list | egrep "\binstall-update$" -q || cargo install cargo-update
54
- # - cargo install-update -i cargo-web
55
- # Cargo has errors with sub-commands so ignore updating for now:
126
+ - rustup target add wasm32-unknown-emscripten
127
+ # cargo-web takes ±10 min. to install, and cargo and cargo-update offer
128
+ # no reliable update-or-install command. We ignore updating for now
129
+ # (just drop the Travis' caches when necessary)
56
130
- cargo --list | egrep "^\s*web$" -q || cargo install cargo-web
131
+ - cargo web -V
132
+ addons :
133
+ chrome : stable
57
134
script :
58
- - cargo web test --target wasm32-unknown-unknown --nodejs --features=stdweb
59
-
60
- - rust : nightly
61
- install :
62
- - rustup target add wasm32-unknown-unknown
63
- script :
64
- - cargo build --target wasm32-unknown-unknown --features wasm-bindgen
135
+ # testing wasm32-unknown-emscripten fails because of rust-lang/rust#49877
136
+ - cargo build --target wasm32-unknown-emscripten
137
+ # - cargo web test --target wasm32-unknown-emscripten
138
+ # - cargo web test --nodejs --target wasm32-unknown-emscripten
139
+ - cargo web test --nodejs --target wasm32-unknown-unknown --features=stdweb
140
+ - cargo build --target wasm32-unknown-unknown --features=wasm-bindgen
65
141
66
142
- rust : nightly
143
+ env : DESCRIPTION="cross-platform builder (doesn't run tests)"
67
144
install :
68
- - rustup target add thumbv6m-none-eabi
145
+ - rustup target add x86_64-sun-solaris
146
+ - rustup target add x86_64-unknown-cloudabi
147
+ - rustup target add x86_64-unknown-freebsd
148
+ - rustup target add x86_64-unknown-fuchsia
149
+ - rustup target add x86_64-unknown-netbsd
150
+ - rustup target add x86_64-unknown-redox
69
151
script :
70
- # Bare metal target; no std; only works on nightly
71
- - cargo build --no-default-features --target thumbv6m-none-eabi --release
152
+ - cargo build --target=x86_64-sun-solaris
153
+ - cargo build --target=x86_64-unknown-cloudabi
154
+ - cargo build --target=x86_64-unknown-freebsd
155
+ - cargo build --target=x86_64-unknown-fuchsia
156
+ - cargo build --target=x86_64-unknown-netbsd
157
+ - cargo build --target=x86_64-unknown-redox
72
158
73
159
# Trust cross-built/emulated targets. We must repeat all non-default values.
74
160
- rust : stable
75
161
sudo : required
76
162
dist : trusty
77
163
services : docker
78
- env : TARGET=x86_64 -unknown-freebsd DISABLE_TESTS=1
164
+ env : DESCRIPTION="Linux (MIPS, big-endian)" TARGET=mips -unknown-linux-gnu
79
165
- rust : stable
80
166
sudo : required
81
167
dist : trusty
82
168
services : docker
83
- env : TARGET=mips-unknown-linux-gnu
84
- - rust : stable
85
- sudo : required
86
- dist : trusty
87
- services : docker
88
- env : TARGET=armv7-linux-androideabi DISABLE_TESTS=1
89
- - rust : stable
90
- os : osx
91
- sudo : required
92
- dist : trusty
93
- services : docker
94
- env : TARGET=armv7-apple-ios DISABLE_TESTS=1
169
+ env : DESCRIPTION="Android (ARMv7)" TARGET=armv7-linux-androideabi
95
170
96
171
before_install :
97
172
- set -e
0 commit comments