IntelliJ IDEA, Rust, tests, "show stdout/stderr in tests"

IntelliJ/IDEA by default hides stdout output when all assertions pass.

In order to show stdout output, we need to go to the configuration of the test and check a box labeled “Show stdout/stderr in tests”.

Unfortunately, we have to do this for every test – which gets a bit tedious.

Is there a way to set a global rust/test/stdout policy of always showing stdout/stderr on all tests?

You can try passing cargo test — —nocapture Which has worked for me. The only issue is it doesn’t IntelliJ can’t read it so on errors/warnings you can’t click on the line number and be taken directly there in the corresponding file.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.