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:
./x.py 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:
./x.py test -i --stage 1 src/test/ui-fulldeps/pprust-expr-roundtrip.rs --keep-stage 1 --test-args --nocapture
thread 'main' panicked at 'UnrecognizedOption("nocapture")',
the difference is, pprust-expr-roundtrip.rs 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