Skip to content

Doc tests use RUST_LOG variable #64309

Closed
@Vlad-Shcherbina

Description

@Vlad-Shcherbina

To reproduce

  1. cargo new --lib doctest_spam
  2. cd doctest_spam
  3. RUST_LOG=info cargo test --doc

Expected results

    Finished dev [unoptimized + debuginfo] target(s) in 0.01s
   Doc-tests doctest_spam

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

Because RUST_LOG is the env_logger's default for application-level logging and should not affect the output of the tools.

Actual results

    Finished dev [unoptimized + debuginfo] target(s) in 0.01s
   Doc-tests doctest_spam
[INFO  jobserver::imp] created a jobserver: Client { read: File { fd: 3, path: "pipe:[83958]", read: true, write: false }, write: File { fd: 4, path: "pipe:[83958]", read: false, write: true } }
[INFO  rustc_interface::util] codegen backend candidate: /home/username/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends
[INFO  rustc_interface::util] probing /home/username/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends for a codegen backend
[INFO  rustc_metadata::creader] resolving crate `extern crate std as std`
[INFO  rustc_metadata::creader] falling back to a load
...
<250 more lines of this>

Version info

$ cargo --version --verbose
cargo 1.39.0-nightly (fe0e5a48b 2019-09-04)
release: 1.39.0
commit-hash: fe0e5a48b75da2b405c8ce1ba2674e174ae11d5d
commit-date: 2019-09-04

$ rustc --version --verbose
rustc 1.39.0-nightly (2b8116dce 2019-09-08)
binary: rustc
commit-hash: 2b8116dced2c6c5d02e1c4359e89dc0919d6001b
commit-date: 2019-09-08
host: x86_64-unknown-linux-gnu
release: 1.39.0-nightly
LLVM version: 9.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions