Skip to content

Commit eb38ad0

Browse files
committed
Auto merge of #6426 - dwijnand:allow-testsuite-warnings-in-dev, r=nrc
Allow testsuite warnings in dev This makes the deny(warnings) in the testsuite conditional on a new "deny-warnings" feature, that is then enabled in CI. Ideally I could use the (reasonably well established) CI env var (like we do for proptests), but I don't know how to get the attribute to be defined in terms of an env var.
2 parents 4786249 + 0e031b5 commit eb38ad0

File tree

5 files changed

+7
-10
lines changed

5 files changed

+7
-10
lines changed

.travis.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ matrix:
4141
- rustup toolchain install nightly
4242
- cargo +nightly generate-lockfile -Z minimal-versions
4343
- cargo -V
44-
- cargo test
44+
- cargo test --features=deny-warnings
4545
if: branch != master OR type = pull_request
4646

4747
- env: TARGET=x86_64-unknown-linux-gnu
@@ -50,7 +50,7 @@ matrix:
5050
install:
5151
- mdbook --help || cargo install mdbook --force
5252
script:
53-
- cargo test
53+
- cargo test --features=deny-warnings
5454
- cargo doc --no-deps
5555
- (cd src/doc && mdbook build --dest-dir ../../target/doc)
5656
if: branch != master OR type = pull_request
@@ -61,7 +61,7 @@ matrix:
6161
before_script:
6262
- rustup target add $ALT
6363
script:
64-
- cargo test
64+
- cargo test --features=deny-warnings
6565

6666
notifications:
6767
email:

ARCHITECTURE.md

-4
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,6 @@ and run with `rustup run` (e.g `rustup run nightly
114114
<path-to-cargo>/target/debug/cargo <args>..`) (or set the `RUSTC` env var to point
115115
to nightly rustc).
116116

117-
Because the test suite has `#![deny(warnings)]` at times you might find it
118-
convenient to override this with `RUSTFLAGS`, for example
119-
`RUSTFLAGS="--cap-lints warn" cargo build`.
120-
121117
## Logging
122118

123119
Cargo uses [`env_logger`](https://docs.rs/env_logger/*/env_logger/), so you can set

Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -105,5 +105,6 @@ test = false
105105
doc = false
106106

107107
[features]
108+
deny-warnings = []
108109
vendored-openssl = ['openssl/vendored']
109110
pretty-env-logger = ['pretty_env_logger']

appveyor.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@ test_script:
2525
# we don't have ci time to run the full `cargo test` with `minimal-versions` like
2626
# - if defined MINIMAL_VERSIONS cargo +nightly generate-lockfile -Z minimal-versions && cargo +stable test
2727
# so we just run `cargo check --tests` like
28-
- if defined MINIMAL_VERSIONS cargo +nightly generate-lockfile -Z minimal-versions && cargo +1.31.0 check --tests
29-
- if NOT defined MINIMAL_VERSIONS cargo test
28+
- if defined MINIMAL_VERSIONS cargo +nightly generate-lockfile -Z minimal-versions && cargo +1.31.0 check --tests --features=deny-warnings
29+
- if NOT defined MINIMAL_VERSIONS cargo test --features=deny-warnings

tests/testsuite/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![warn(rust_2018_idioms)] // while we're getting used to 2018
2-
#![deny(warnings)]
2+
#![cfg_attr(feature="deny-warnings", deny(warnings))]
33
#![cfg_attr(feature = "cargo-clippy", allow(blacklisted_name))]
44
#![cfg_attr(feature = "cargo-clippy", allow(explicit_iter_loop))]
55

0 commit comments

Comments
 (0)