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

UI tests should fail if they ICE #51971

Closed
varkor opened this issue Jul 1, 2018 · 4 comments
Closed

UI tests should fail if they ICE #51971

varkor opened this issue Jul 1, 2018 · 4 comments
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc

Comments

@varkor
Copy link
Member

varkor commented Jul 1, 2018

Currently, ICEs are effectively ignored by UI tests. This means both that we can miss ICEs and that tests can change confusingly — it's only obvious that an ICE has occurred if the test is run manually. The output for ICEs in UI tests should be more obvious, and should cause the test to fail, regardless of the .stderr file.

src/test/ui/issue-50585.rs currently fails with an ICE, but this is not reflected anywhere, for example.

@estebank estebank added the A-testsuite Area: The testsuite used to check the correctness of rustc label Jul 2, 2018
@euclio
Copy link
Contributor

euclio commented Jul 2, 2018

This is because the status code for an ICE is the same as the status code for a regular compilation failure. When a UI test ICEs, as long as the correct error output is still present, it'll pass.

I think the cleanest solution would be to change the status code of rustc in the event of an ICE, but that probably warrants a wider conversation. There's precedent for doing this in gcc.

An alternative solution would be to scrape the output for the compiler unexpectedly panicked, etc., but this is more fragile.

euclio added a commit to euclio/rust that referenced this issue Jul 18, 2018
This commit changes the exit status of rustc to 1 in the presence of
compilation errors. In the event of an unexpected panic (ICE) the
standard panic error exit status of 101 remains.

A run-make test is added to ensure that the exit code does not regress,
and compiletest is updated to check for an exit status of 1 or 101,
depending on the mode and suite.

This is a breaking change for custom drivers.

Fixes rust-lang#51971.
bors added a commit that referenced this issue Jul 19, 2018
overhaul exit codes for rustc and rustdoc

This commit changes the exit status of rustc to 1 in the presence of
compilation errors. In the event of an unexpected panic (ICE) the
standard panic error exit status of 101 remains.

A run-make test is added to ensure that the exit code does not regress,
and compiletest is updated to check for an exit status of 1 or 101,
depending on the mode and suite.

This is a breaking change for custom drivers.

Note that while changes were made to the rustdoc binary, there is no
intended behavior change. rustdoc errors (i.e., failed lints) will still
report 101. While this could *also* hide potential ICEs, I will leave
that work to a future PR.

Fixes #51971.
@varkor
Copy link
Member Author

varkor commented Jul 19, 2018

@euclio: is this issue actually fixed? The pull request #52197 claims to fix it, but it doesn't modify any tests — and I'd be very surprised if none of the existing test suite ICEs (I've recently fixed one, and I can't believe that was the only one). Am I right in thinking #52197 makes it possible to distinguish, but doesn't actually make ICEs fail tests?

@euclio
Copy link
Contributor

euclio commented Jul 19, 2018 via email

@varkor
Copy link
Member Author

varkor commented Jul 19, 2018

Oh, that's a much better situation than I expected, thanks!

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

3 participants