Skip to content

Commit bd34459

Browse files
authored
Merge pull request #409 from dhardy/ci
Enable std by default in rand_core; adjust CI targets
2 parents 8c5b0ac + 5f888a7 commit bd34459

File tree

4 files changed

+27
-23
lines changed

4 files changed

+27
-23
lines changed

.travis.yml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,29 +11,32 @@ matrix:
1111
- rust: 1.22.0
1212
install:
1313
script:
14-
- cargo test --all --tests --no-default-features
14+
- cargo test --tests --no-default-features
15+
- cargo test --package rand_core --no-default-features
1516
- cargo test --features serde1,log
1617
- rust: stable
1718
os: osx
1819
install:
1920
script:
20-
- cargo test --all --tests --no-default-features
21+
- cargo test --tests --no-default-features
22+
- cargo test --package rand_core --no-default-features
2123
- cargo test --features serde1,log
2224
- rust: beta
2325
install:
2426
script:
25-
- cargo test --all --tests --no-default-features
26-
- cargo test --tests --no-default-features --features=serde1
27+
- cargo test --tests --no-default-features
28+
- cargo test --package rand_core --no-default-features
29+
- cargo test --features serde1,log
2730
- rust: nightly
2831
install:
2932
- cargo --list | egrep "^\s*deadlinks$" -q || cargo install cargo-deadlinks
3033
before_script:
3134
- pip install 'travis-cargo<0.2' --user && export PATH=$HOME/.local/bin:$PATH
3235
script:
33-
- cargo test --all --tests --no-default-features --features=alloc
34-
- cargo test --all --features=alloc
35-
- cargo test --features serde1,log,nightly
36-
- cargo test --benches
36+
- cargo test --tests --no-default-features --features=alloc
37+
- cargo test --package rand_core --no-default-features --features=alloc,serde1
38+
- cargo test --features serde1,log,nightly,alloc
39+
- cargo test --all --benches
3740
- cargo doc --no-deps --all --all-features
3841
- cargo deadlinks --dir target/doc
3942
after_success:
@@ -56,7 +59,7 @@ matrix:
5659
- rustup target add thumbv6m-none-eabi
5760
script:
5861
# Bare metal target; no std; only works on nightly
59-
- cargo build --all --no-default-features --target thumbv6m-none-eabi --release
62+
- cargo build --no-default-features --target thumbv6m-none-eabi --release
6063

6164
# Trust cross-built/emulated targets. We must repeat all non-default values.
6265
- rust: stable

appveyor.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ install:
3232
build: false
3333

3434
test_script:
35-
- cargo test --benches
36-
- cargo test --all
35+
- cargo test --all # cannot use --all and --features together
36+
- cargo test --all --benches
3737
- cargo test --features serde1,log,nightly
38-
- cargo test --all --tests --no-default-features --features=alloc
39-
- cargo test --tests --no-default-features --features=serde1
38+
- cargo test --tests --no-default-features --features=alloc,serde1
39+
- cargo test --package rand_core --no-default-features --features=alloc,serde1

rand_core/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ travis-ci = { repository = "rust-lang-nursery/rand" }
1818
appveyor = { repository = "alexcrichton/rand" }
1919

2020
[features]
21-
# Bug: https://github.com/rust-lang/cargo/issues/4361
22-
# default = ["std"]
21+
default = ["std"]
2322
std = ["alloc"] # use std library; should be default but for above bug
2423
alloc = [] # enables Vec and Box support without std
2524
serde1 = ["serde", "serde_derive"] # enables serde for BlockRng wrapper

utils/ci/script.sh

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,22 @@
33
set -ex
44

55
main() {
6-
if [ ! -z $DISABLE_TESTS ]; then
7-
cross build --all --no-default-features --target $TARGET --release
8-
if [ -z $DISABLE_STD ]; then
6+
if [ ! -z $DISABLE_TESTS ]; then # tests are disabled
7+
cross build --no-default-features --target $TARGET --release
8+
if [ -z $DISABLE_STD ]; then # std is enabled
99
cross build --features log,serde1 --target $TARGET
1010
fi
1111
return
1212
fi
1313

14-
if [ ! -z $NIGHTLY ]; then
15-
cross test --all --tests --no-default-features --features alloc --target $TARGET
16-
cross test --features serde1,log,nightly --target $TARGET
14+
if [ ! -z $NIGHTLY ]; then # have nightly Rust
15+
cross test --tests --no-default-features --features alloc --target $TARGET
16+
cross test --package rand_core --no-default-features --features alloc --target $TARGET
17+
cross test --features serde1,log,nightly,alloc --target $TARGET
1718
cross test --all --benches --target $TARGET
18-
else
19-
cross test --all --tests --no-default-features --target $TARGET
19+
else # have stable Rust
20+
cross test --tests --no-default-features --target $TARGET
21+
cross test --package rand_core --no-default-features --target $TARGET
2022
cross test --features serde1,log --target $TARGET
2123
fi
2224
}

0 commit comments

Comments
 (0)