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 that pass --test to rustc fail on panic=abort targets #135819

Open
japaric opened this issue Jan 21, 2025 · 0 comments · May be fixed by #135823
Open

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

japaric opened this issue Jan 21, 2025 · 0 comments · May be 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
japaric added a commit to ferrocene/rust that referenced this issue Jan 21, 2025
by adding `-Zpanic_abort_test`, which is a no-op on panic=unwind targets

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
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
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-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