-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Test output should be coloured even when run simultaneously #9388
Comments
My understanding is that they're disabled for the reason you mentioned, color emission isn't one write call, but rather three (start, content, end). Because it's not one call to write, the output can get interleaved, causing "interesting" output in parallel tests. Although I'm perfectly ok with string concatenation to have one call to |
Couldn't the test runner simply be a single-task manager for running all the tests, receiving an message on success/failure and writing that to stdout sequentially? |
@Kimundi that's exactly right that the problem is that the tests themselves are outputing to stdout and that corrupts the colors printed by the test runner. Redirecting stdout per task would require the stdio types to be questionably sophisticated. A less-controversial approach might be to simply make logging redirectable per-task and not let tests use stdio directly at all. Perhaps as @chris-morgan mentioned the term code is doing something silly and splitting the escape codes across writes, but that would be kind of suprprising. |
See #782. |
Can |
Dup of #782? |
Yes, thanks @treeman |
Rustup Hopefully this is done right. changelog: None
At present, test output is done without colour1 unless
RUST_TEST_TASKS
is 1. On supported operating systems, colour should always be done, regardless of the value ofRUST_TEST_TASKS
.On a normal OS, you're just writing the likes of
testing foo... ^[[4mok^[[0m\n
, so I don't see what can go wrong with the formatting, assuming it's being done as one write call.Windows might have race conditions here on account of its make-an-API-call approach; I don't know. (Is it even supported for colouring?) But that's no reason to hold back the Dazzling Glory of Useful Colours from the proletariat 2.
1 "color", for those of you who speak en_US.
2 Something tells me the proletariat wouldn't be running Rust tests. Too bad. That's his fault, not mine.
The text was updated successfully, but these errors were encountered: