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

test suite: error-pattern annotations are not checked in UI tests #52531

Closed
petrochenkov opened this issue Jul 19, 2018 · 0 comments
Closed

test suite: error-pattern annotations are not checked in UI tests #52531

petrochenkov opened this issue Jul 19, 2018 · 0 comments
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc

Comments

@petrochenkov
Copy link
Contributor

petrochenkov commented Jul 19, 2018

Sometimes //~ ERROR attached to a line in the local file cannot be used for testing an error message, because the message is attached to a "remote" span from some other file.
In this case error-pattern annotations can be used in compile-fail tests to check that some diagnostics present in the output regardless of span.

The problem is that such annotations are completely ignored in UI tests and don't check anything, so every such annotation is a potential bug going unnoticed.

error-pattern should either work in UI tests, or some #52175 -like mechanism should be used to remap remote spans into local spans and then //~ ERROR could be used for everything.

@petrochenkov petrochenkov added the A-testsuite Area: The testsuite used to check the correctness of rustc label Jul 19, 2018
davidtwco added a commit to davidtwco/rust that referenced this issue Aug 10, 2018
Previously, even if no expected errors were supplied, if a test execution failed
then supplied error patterns would not be checked. This commit modifies the
conditional that determines whether error patterns or expected errors are checked
to remedy this.

Further, this commit modifies the error pattern checking logic so that each pattern
is checked against all lines of the string. This is required for UI tests as the
stderr is in JSON format - all on one line - so in the previous implementation when the
first pattern was found on the first line (which was actually the entire error) then
no other patterns would be found on subsequent lines (as there weren't any).
bors added a commit that referenced this issue Aug 10, 2018
davidtwco added a commit to davidtwco/rust that referenced this issue Aug 13, 2018
Previously, even if no expected errors were supplied, if a test execution failed
then supplied error patterns would not be checked. This commit modifies the
conditional that determines whether error patterns or expected errors are checked
to remedy this.

Further, this commit modifies the error pattern checking logic so that each pattern
is checked against all lines of the string. This is required for UI tests as the
stderr is in JSON format - all on one line - so in the previous implementation when the
first pattern was found on the first line (which was actually the entire error) then
no other patterns would be found on subsequent lines (as there weren't any).
bors added a commit that referenced this issue Aug 13, 2018
bors added a commit that referenced this issue Aug 14, 2018
@bors bors closed this as completed in fe28bcf Aug 14, 2018
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
Projects
None yet
Development

No branches or pull requests

1 participant