-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
cargo t --doc
does not respect --color
when a compilation error occurs
#14403
Comments
cargo t --doc
does not respect --color when a compilation error occurscargo t --doc
does not respect --color
when a compilation error occurs
Note that For rustdoc, unlike cargo/src/cargo/ops/cargo_test.rs Lines 170 to 175 in cc74523
|
Yea, this is likely just an oversight, it should be passing |
Hello, I am currently working on this issue. |
Problem
When using
cargo
to run doctests,--color
is not respected during a compilation failure; howevercargo t --tests
does respect it andrustdoc --test
almost respects it. Similarlycargo t --doc
does respect--color
when a compilation failure does not occur.Steps
This portion above is always color and bold formatted:
In contrast,
has no color or formatting. Also notice the different error code, E0425, compared to E0423.
With the exception of the two instance of
FAILED
as red, the following has no color or formatting:Also notice that it has the same error code, E0425, as
cargo t --tests
even though I would have guessed for it to be the same ascargo t --doc
.Unsurprisingly when trying to retain color via
--color always
when pipingstdout
into a different process, the color is not retained presumably for the same reason that--color never
is not being respected when writing to a TTY.I think this might be related to the fact that
rustdoc
writes the compilation error tostdout
; thuscargo t --doc
also writes the formatted output tostdout
; howevercargo t --tests
writes the compilation error tostderr
. Normally bothstderr
andstdout
are not formatted though, so not sure why that would matter.Possible Solution(s)
No response
Notes
No response
Version
The text was updated successfully, but these errors were encountered: