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

Add implementation for the #[kani::should_panic] attribute #2315

Merged
merged 11 commits into from
Mar 24, 2023

Conversation

adpaco-aws
Copy link
Contributor

Description of changes:

This PR adds the implementation for the #[kani::should_panic] attribute.

Using the attribute will return the following results:

  1. VERIFICATION:- FAILED (encountered no panics, but at least one was expected) if there were no failures.
  2. VERIFICATION:- FAILED (encountered failures other than panics, which were unexpected) if there were failures but not all them had prop.property_class() == "assertion".
  3. VERIFICATION:- SUCCESSFUL (encountered one or more panics as expected) otherwise.

Resolved issues:

Resolves #600

Related RFC:

#2272

Call-outs:

Testing:

  • How is this change tested? Existing tests + 6 new ui tests

  • Is this a refactor change? No.

Checklist

  • Each commit message has a non-empty body, explaining why the change was made
  • Methods or procedures are documented
  • Regression or unit tests are included, or existing tests cover the modified code
  • My PR is restricted to a single feature or bugfix

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.

@adpaco-aws adpaco-aws requested a review from a team as a code owner March 23, 2023 18:57
kani-driver/src/call_cbmc.rs Outdated Show resolved Hide resolved
kani-driver/src/call_cbmc.rs Outdated Show resolved Hide resolved
tests/ui/should-panic-attribute/expected-panics/expected Outdated Show resolved Hide resolved
kani-driver/src/call_cbmc.rs Outdated Show resolved Hide resolved
library/kani_macros/src/lib.rs Outdated Show resolved Hide resolved
kani-driver/src/call_cbmc.rs Outdated Show resolved Hide resolved
@adpaco-aws
Copy link
Contributor Author

Changed the comments around FailedProperties as well. Ready to review again.

Copy link
Contributor

@zhassan-aws zhassan-aws left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @adpaco-aws! Looking forward to the documentation of this feature.

Copy link
Contributor

@zhassan-aws zhassan-aws left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, forgot to submit one minor comment.

Copy link
Contributor

@zhassan-aws zhassan-aws left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trying to submit it again.

tests/ui/should-panic-attribute/no-panics/test.rs Outdated Show resolved Hide resolved
@adpaco-aws adpaco-aws enabled auto-merge (squash) March 24, 2023 17:42
@adpaco-aws adpaco-aws merged commit bd1ac2d into model-checking:main Mar 24, 2023
@adpaco-aws adpaco-aws self-assigned this Mar 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Add support for common proof options
3 participants