Skip to content
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

Track stderr color in UI tests #88254

Open
scrabsha opened this issue Aug 23, 2021 · 2 comments
Open

Track stderr color in UI tests #88254

scrabsha opened this issue Aug 23, 2021 · 2 comments
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc C-enhancement Category: An issue proposing an enhancement or a PR with one.

Comments

@scrabsha
Copy link
Contributor

scrabsha commented Aug 23, 2021

Disclaimer: the whole idea comes from @estebank on twitter (link). I'm just summarizing it here.

Now that we can emit super-fancy colored suggestions (PR #86532), it would be a good idea to track the color of the messages we emit for some special cases in the ui tests.

A good way to track the color of each character would be to generate an HTML file per test. This would be both human-friendly (reviewers can open the resulting HTML file on their browser) and testing framework-friendly (as every character color is tracked, we can spot regressions).

As suggested in the original tweet, explicit coloring can be triggered with a // generate-html header command. We can also add a -Z flag so that users can use it outside of rustc tests.

As a new rust-lang/rust contributor, I'd love to work on that, but I need some ideas of how to track colors from experienced rustc developers first.

Edits:

  • 2021-08-25: after some discussions with @ estabank on twitter, it seems that we don't want to track the colors of every ui test, but rather the ones for some special cases.
@scrabsha
Copy link
Contributor Author

After some research in the codebase, i think this could be implemented by adding a new variant to Destination and WritableDst to represent the fact that we're writing html code. This variant would contain a type responsible for figuring out what to write when asked to set a new color.

@Dylan-DPC Dylan-DPC added A-testsuite Area: The testsuite used to check the correctness of rustc C-enhancement Category: An issue proposing an enhancement or a PR with one. labels Feb 12, 2023
@estebank
Copy link
Contributor

With #121877 we can now better do this, but there seems to be some level of platform dependence on the output: #122029 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc C-enhancement Category: An issue proposing an enhancement or a PR with one.
Projects
None yet
Development

No branches or pull requests

3 participants