Skip to content

UI tests that pass --test to rustc fail on panic=abort targets #135819

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
japaric opened this issue Jan 21, 2025 · 0 comments · Fixed by #135823
Closed

UI tests that pass --test to rustc fail on panic=abort targets #135819

japaric opened this issue Jan 21, 2025 · 0 comments · Fixed by #135823
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@japaric
Copy link
Member

japaric commented Jan 21, 2025

Namely

By default, unit tests on panic=abort targets will abort the whole process. As these tests rely on #[should_panic] tests, they fail on those targets.

These tests can be made work on panic=abort targets with the additional -Zpanic_abort_tests flag. Both modes (with and without the -Z flag) can be tested using test revisions.

The other, simpler alternative is to mark the tests as needs-unwind to ignore them on panic=abort targets.

I'll send a PR implementing the first alternative.

@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jan 21, 2025
japaric added a commit to ferrocene/rust that referenced this issue Jan 21, 2025
using a second revision that also passes `-Zpanic_abort_test`

the first revision, which does not use the `-Z` flag, is configured to
only run on targets that support unwinding

fixes rust-lang#135819
@jieyouxu jieyouxu added A-testsuite Area: The testsuite used to check the correctness of rustc T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. C-bug Category: This is a bug. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Jan 21, 2025
jieyouxu added a commit to jieyouxu/rust that referenced this issue Jan 22, 2025
make UI tests that use `--test` work on panic=abort targets

By passing `-Zpanic_abort_test`.

fixes rust-lang#135819
jieyouxu added a commit to jieyouxu/rust that referenced this issue Jan 22, 2025
make UI tests that use `--test` work on panic=abort targets

By passing `-Zpanic_abort_test`.

fixes rust-lang#135819
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jan 22, 2025
make UI tests that use `--test` work on panic=abort targets

By passing `-Zpanic_abort_test`.

fixes rust-lang#135819
@bors bors closed this as completed in ece8b0c Jan 22, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants