Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upPass stdout when running cargo test --verbose #2792
Comments
This comment has been minimized.
This comment has been minimized.
|
This is somewhat of an issue for the test harness rather than Cargo itself, as Cargo just runs the test binary and it then figures out what to do with the output. It seems reasonable to me, though, that |
This comment has been minimized.
This comment has been minimized.
|
I'm not sure which project is responsible for the test harness. Should I report the bug in rust-lang/rust repository? |
This comment has been minimized.
This comment has been minimized.
@pornel, I think you want
Hm, the harness currently does not accepts |
This comment has been minimized.
This comment has been minimized.
|
@alexcrichton what do you thing about making EDIT: hm, looks like this will bind Cargo to the particular test harness, which is unfortunate. |
This comment has been minimized.
This comment has been minimized.
|
Uh-oh. I've found there's a catch - the tests are run in parallel, so order of the output is shuffled (unless I run it with nocapture is helpful, but not ideal. Maybe |
This comment has been minimized.
This comment has been minimized.
|
The response to requests like this is always "we don't want to bind tightly to a specific test runner", which is a little silly because there's only one test runner currently. As it is, cargo knows that the user wants more output when they run What if |
This comment has been minimized.
This comment has been minimized.
|
@pornel yeah the harness currently lives in src/libtest in the rust-lang/rust repo, so having @matklad I'd personally want to avoid @durka this is basically what it looks like to err on the side of being conservative. This keeps the door open to alternate test harnesses in the future instead of forcing everyone to adhere to one set of wacky conventions that the first test harness just happened to set forth. With custom test harnesses, however, it's likely that Cargo will have a contract with all implementations of some form, however. For example flags like |
This comment has been minimized.
This comment has been minimized.
|
Yeah, what I'm advocating for is defining this contract, instead of using On Mon, Jun 20, 2016 at 12:32 PM, Alex Crichton notifications@github.com
|
This comment has been minimized.
This comment has been minimized.
|
It would probably be best to design much of custom test harnesses all at once in one RFC rather than piecemeal, and then this would interact with issues like #2790 |
This comment has been minimized.
This comment has been minimized.
|
Closing since this sounds like this issue should either be:
|
kornelski commentedJun 19, 2016
I wrote a new test and expected it to fail, but it unexpectedly passed. I've added
println!to the code to see what happened, but the text was hidden by cargo.I've tried
cargo test --verbose, but it still had suppressed output I wanted to see. I had to make the test panic to see the output.I prefer to always see all output, even if it means megabytes large dump to the terminal (my terminal handles that well). Could you make
--verbosebe really verbose or add another option (in~/.cargo/config) to always print everything?