Skip to content

libtest: Only colorize output if stdout is a tty #14571

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

Merged
merged 1 commit into from
Jun 1, 2014
Merged

libtest: Only colorize output if stdout is a tty #14571

merged 1 commit into from
Jun 1, 2014

Conversation

bnoordhuis
Copy link
Contributor

Fixes #14570.

@sfackler
Copy link
Member

sfackler commented Jun 1, 2014

It'd be nice to add a flag to force colored output too but I don't know if that needs to block this.

Now that I think about it, since test output is captured now, we may be able to remove the single task requirement as well.

bors added a commit that referenced this pull request Jun 1, 2014
@bors bors closed this Jun 1, 2014
@bors bors merged commit 87ecd4f into rust-lang:master Jun 1, 2014
@bnoordhuis
Copy link
Contributor Author

It'd be nice to add a flag to force colored output too but I don't know if that needs to block this.

I've been thinking the same thing. I'll try to follow up with a patch later this week.

Now that I think about it, since test output is captured now, we may be able to remove the single task requirement as well.

I'm not sure what you mean. Do you want to remove RUST_TEST_TASKS?

@bnoordhuis bnoordhuis deleted the libtest-check-isatty branch June 1, 2014 09:40
@sfackler
Copy link
Member

sfackler commented Jun 1, 2014

RUST_TEST_TASKS would stay, but use_color wouldn't check it. We used to because there was no synchronization of the test result output which meant that colored output would break everything. That's no longer the case, so we should be able to color output no matter what.

For the flag, it'd probably make the most sense to mirror rustc's:

    --color auto|always|never
                        Configure coloring of output: auto = colorize, if
                        output goes to a tty (default); always = always
                        colorize output; never = never colorize output

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RUST_TEST_TASKS=1 colors output when stdout is not a tty
3 participants