-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Add UI testing to compiler test suite #33000
Comments
Here is my plan:
The last point is very important. This will get super annoying if every tweak to the UI requires hand-editing the Colors would normally be disabled (because output of compiler is not a tty), but they could be tested explicitly via a A nice feature of this is that if this is a PR that adjusts the rustc output, we will be able to look at the diffs in the One concern I have is that there may be differences across platforms. Ideally we would probably suppress those with filters, or else maybe have distinct cc @brson |
Cargo's tests are pretty similar to this where we literally run |
I left a FIXME with this issue in the code -- we had to do some hacks in the new JSON-based testing harness that I'd prefer to undo when such testing is available. |
I believe we've since added this, so closing. |
There is a FIXME related to this issue, |
Currently, we don't have a way to easily test that errors have proper formatting. This means we could potentially have regressions in terms of readability that we don't immediately catch. It also means that possibly future improvements, like #32756, don't have a way to thoroughly catch where tweaks to formatting one one kind of error impact other errors in unintended ways.
A possible additional aspect of this kind of UI testing is that it allows us to not only test formatting but optionally we could also add the ability to test the highlighting to ensure that the errors are using the expected coloring.
Additionally, we currently have hacks in the unit test suite that check for column offsets (like compile-fail/symbol-names/issue-32709.rs). Having a more structured UI test allows tests to do specific formatting checks like column numbers.
The text was updated successfully, but these errors were encountered: