-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Optionally allow writing to stdout in test runs #13374
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I agree. Sometimes I write "interactive" tests which are intended to print something to the terminal. Previously it worked, and when I was porting old code to the new compiler, it surprised me that some tests became silent. This is a very useful feature sometimes. Probably add a flag to test binary? |
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
Apr 24, 2014
A new flag to the test runner, --nocapture, can be passed to instruct that the output of tests should not be captured by default. The behavior can also be triggered via a RUST_TEST_NOCAPTURE environment variable being set. Closes rust-lang#13374
bors
added a commit
that referenced
this issue
Apr 24, 2014
A new flag to the test runner, --nocapture, can be passed to instruct that the output of tests should not be captured by default. The behavior can also be triggered via a RUST_TEST_NOCAPTURE environment variable being set. Closes #13374
bors
added a commit
to rust-lang-ci/rust
that referenced
this issue
Oct 18, 2022
Update manual now stable can be installed with rustup this a new PR for rust-lang#13374 as `bors squash` seemed to have broken `bors` _______ `rustup` can now install `rust-analyzer` for the stable tool-chain. This commit removes the note that `rustup` can only install for the nightly branch and adjusts the command. I also added a note on how to find the path to the `rust-analyzer` binary when installed using `rustup`, and suggestions on how to work around it not being placed in `~/.cargo/bin`. I thought it would be ideal to point everyone to use `rustup run stable rust-analyzer` to start `rust-analyzer`. That would make it trivial to switch to nightly however I could not get this to work in `nvim` therefore I left it as a suggestion at the end.
bors
added a commit
to rust-lang-ci/rust
that referenced
this issue
Sep 24, 2024
Remove unnecessary symbols and add missing symbols *Please write a short comment explaining your change (or "none" for internal only changes)* changelog: Remove unnecessary symbols and add missing symbols
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently writes to stdout are redirected when running tests. However, in some cases it could be useful to allow writing to stdout. For instance, I was writing a wrapper for a C library and got a segment fault error. This caused my test to fail abruptly, as a result of which no useful output could be seen, since stdout was captured and the test wouldn't print the logs unless it failed normally.
I was able to get around this using
std::io::stdio::stdout()
, but that's not ideal.The text was updated successfully, but these errors were encountered: