Skip to content

Commit 6887bd2

Browse files
committed
travis: Cleanup code and check minimal versions
By using --package, we can make the testing scripts much more readable. We also remove deprecated keys/functionality so that the .travis.yml file validates without warnings.
1 parent d9cad9d commit 6887bd2

File tree

2 files changed

+31
-31
lines changed

2 files changed

+31
-31
lines changed

.travis.yml

Lines changed: 31 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,32 @@
11
language: rust
2-
sudo: false
2+
os: linux
33

4-
matrix:
4+
jobs:
55
include:
6-
- name: "Linux, 1.32.0"
6+
- &minimal_version
7+
name: "Linux, 1.32.0"
78
rust: 1.32.0
8-
os: linux
9+
script:
10+
- cargo test
11+
# We can't run the tests on 1.32 due to rust-lang/rust#48216
12+
- cargo build --package cpurand-getrandom
913

10-
- name: "OSX, 1.32.0"
11-
rust: 1.32.0
14+
- <<: *minimal_version
15+
name: "OSX, 1.32.0"
1216
os: osx
1317

1418
- name: "Linux, stable"
1519
rust: stable
20+
script:
21+
- cargo test --package getrandom --package cpurand-getrandom
1622

1723
- name: "OSX+iOS, stable"
1824
rust: stable
1925
os: osx
2026
install:
2127
- rustup target add aarch64-apple-ios
2228
script:
23-
- cargo test
29+
- cargo test --package getrandom --package cpurand-getrandom --tests
2430
- cargo build --target aarch64-apple-ios
2531

2632
- name: "Linux, beta"
@@ -68,41 +74,41 @@ matrix:
6874
# This is actually useful as it finds stuff such as rust-random/rand#669
6975
- cargo web test --target wasm32-unknown-emscripten --no-run
7076
- cargo web test --target asmjs-unknown-emscripten --no-run
71-
# wasi tests
7277
- cargo test --target wasm32-wasi
73-
# stdweb tests (Node, Chrome)
74-
- cd custom/stdweb
75-
- cargo web test --nodejs --target=wasm32-unknown-unknown
76-
- cargo web test --target=wasm32-unknown-unknown
77-
# wasm-bindgen tests (Node, Firefox, Chrome)
78-
- cd ../wasm-bindgen
79-
- cargo test --target wasm32-unknown-unknown --test node
80-
- GECKODRIVER=$HOME/geckodriver cargo test --target wasm32-unknown-unknown --test web
81-
- CHROMEDRIVER=$HOME/chromedriver cargo test --target wasm32-unknown-unknown --test web
78+
# stdweb (wasm32-unknown-unknown) tests (Node, Chrome)
79+
- cargo web test --package stdweb-getrandom
80+
- cargo web test --package stdweb-getrandom --nodejs
81+
# wasm-bindgen (wasm32-unknown-unknown) tests (Node, Firefox, Chrome)
82+
- cargo test --package wasm-bindgen-getrandom
83+
--target wasm32-unknown-unknown --test node
84+
- GECKODRIVER=$HOME/geckodriver
85+
cargo test --package wasm-bindgen-getrandom
86+
--target wasm32-unknown-unknown --test web
87+
- CHROMEDRIVER=$HOME/chromedriver
88+
cargo test --package wasm-bindgen-getrandom
89+
--target wasm32-unknown-unknown --test web
8290

8391
- &nightly_and_docs
8492
name: "Linux, nightly, docs"
8593
rust: nightly
86-
os: linux
8794
install:
8895
- rustup target add wasm32-unknown-unknown
8996
- cargo --list | egrep "^\s*deadlinks$" -q || cargo install cargo-deadlinks
9097
- cargo deadlinks -V
9198
script:
92-
# Check that our tests pass in the default configuration
93-
- cargo test
94-
- cargo test --benches
9599
# Check that setting various features does not break the build
96100
- cargo build --features=std
97101
- cargo build --features=custom
98102
# remove cached documentation, otherwise files from previous PRs can get included
99103
- rm -rf target/doc
100104
- cargo doc --no-deps --features=std,custom
101-
- cargo doc --no-deps --manifest-path=custom/wasm-bindgen/Cargo.toml --target=wasm32-unknown-unknown
105+
- cargo doc --no-deps --package cpurand-getrandom
106+
- cargo doc --no-deps --package wasm-bindgen-getrandom --target=wasm32-unknown-unknown
102107
- cargo deadlinks --dir target/doc
103-
# also test minimum dependency versions are usable
108+
# Check that our tests pass in the default/minimal configuration
109+
- cargo test --package getrandom --package cpurand-getrandom --tests --benches
104110
- cargo generate-lockfile -Z minimal-versions
105-
- cargo test --features=std,custom
111+
- cargo test --package getrandom --package cpurand-getrandom --tests --benches
106112

107113
- <<: *nightly_and_docs
108114
name: "OSX, nightly, docs"
@@ -120,7 +126,7 @@ matrix:
120126
- rustup target add x86_64-fortanix-unknown-sgx
121127
# For no_std targets
122128
- rustup component add rust-src
123-
- cargo install cargo-xbuild || true
129+
- cargo --list | egrep "^\s*xbuild$" -q || cargo install cargo-xbuild
124130
script:
125131
# We test that getrandom and cpurand build for all x86 targets
126132
- cd custom/cpurand
@@ -155,7 +161,6 @@ matrix:
155161
- name: "Linux (MIPS, big-endian)"
156162
env: TARGET=mips-unknown-linux-gnu
157163
rust: stable
158-
sudo: required
159164
dist: trusty
160165
services: docker
161166
install:
@@ -167,7 +172,6 @@ matrix:
167172
- name: "Android (ARMv7)"
168173
env: TARGET=armv7-linux-androideabi
169174
rust: stable
170-
sudo: required
171175
dist: trusty
172176
services: docker
173177
install:
@@ -194,9 +198,6 @@ before_install:
194198
before_script:
195199
- export RUSTFLAGS="-D warnings"
196200

197-
script:
198-
- cargo test
199-
200201
after_script: set +e
201202

202203
cache:

benches/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#![feature(test)]
2-
extern crate getrandom;
32
extern crate test;
43

54
#[bench]

0 commit comments

Comments
 (0)