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

Print failure message on all tests that should panic, but don't #80868

Merged
merged 1 commit into from
Jan 28, 2021

Conversation

johanngan
Copy link
Contributor

Fixes #80861. Tests with the #[should_panic] attribute should always print a failure message if no panic occurs, regardless of whether or not an expected panic message is specified.

This already happens with should_panic tests without an expected
message. This commit fixes should_panic tests with an expected message
to have the same behavior.
@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @shepmaster (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 10, 2021
@jyn514 jyn514 added the A-libtest Area: `#[test]` / the `test` library label Jan 10, 2021
@JohnCSimon JohnCSimon added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 25, 2021
@m-ou-se m-ou-se assigned m-ou-se and unassigned shepmaster Jan 25, 2021
@m-ou-se
Copy link
Member

m-ou-se commented Jan 25, 2021

Thank you for fixing this, @johanngan!

@bors r+

@bors
Copy link
Contributor

bors commented Jan 25, 2021

📌 Commit b43aa96 has been approved by m-ou-se

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 25, 2021
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Jan 27, 2021
…ected, r=m-ou-se

Print failure message on all tests that should panic, but don't

Fixes rust-lang#80861. Tests with the `#[should_panic]` attribute should always print a failure message if no panic occurs, regardless of whether or not an `expected` panic message is specified.
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Jan 27, 2021
…ected, r=m-ou-se

Print failure message on all tests that should panic, but don't

Fixes rust-lang#80861. Tests with the `#[should_panic]` attribute should always print a failure message if no panic occurs, regardless of whether or not an `expected` panic message is specified.
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 28, 2021
Rollup of 13 pull requests

Successful merges:

 - rust-lang#70904 (Stabilize `Seek::stream_position` (feature `seek_convenience`))
 - rust-lang#79951 (Refractor a few more types to `rustc_type_ir` )
 - rust-lang#80868 (Print failure message on all tests that should panic, but don't)
 - rust-lang#81062 (Improve diagnostics for Precise Capture)
 - rust-lang#81277 (Make more traits of the From/Into family diagnostic items)
 - rust-lang#81284 (Make `-Z time-passes` less noisy)
 - rust-lang#81379 (Improve URLs handling)
 - rust-lang#81416 (Tweak suggestion for missing field in patterns)
 - rust-lang#81426 (const_evaluatable: expand abstract consts in try_unify)
 - rust-lang#81428 (compiletest: Add two more unit tests)
 - rust-lang#81430 (add const_evaluatable_checked test)
 - rust-lang#81433 (const_evaluatable: stop looking into type aliases)
 - rust-lang#81445 (Update cargo)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 9822663 into rust-lang:master Jan 28, 2021
@rustbot rustbot added this to the 1.51.0 milestone Jan 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-libtest Area: `#[test]` / the `test` library S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tests with #[should_panic(expected = *)] should print a failure message if no panic occurs
8 participants