Stream: t-compiler/help

Topic: why "--test-args --nocapture" not work on some test case?

Derek (Dec 21 2019 at 07:46, on Zulip):

I tried to run some testcases, from rustc-guide book, I use following command:
./ test -i --stage 1 src/libsyntax --keep-stage 1 --test-args --nocapture
it works, and I can get output from console for all println!().
however, this command is not work:
./ test -i --stage 1 src/test/ui-fulldeps/ --keep-stage 1 --test-args --nocapture
thread 'main' panicked at 'UnrecognizedOption("nocapture")',
the difference is, has a main method, this main method doesn't handle --nocapture.
my question is, in this case how can I get console output for all println!(). Thanks. I can't find answer from rustc-guide book. Thanks.

oli (Dec 21 2019 at 09:41, on Zulip):

I usually just put a panic!() at the end of the ui test so it breaks and shows me all the other output, but that's obviously not great

Derek (Dec 21 2019 at 18:14, on Zulip):

Thanks, At least it works!

Last update: Sep 18 2020 at 20:30UTC