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

[Blocked on #1435] Support proptest arbitrary generation for bool and tuple #1467

Conversation

YoshikiTakashima
Copy link
Contributor

Description of changes:

Added support for arbitrary generation trait, and implemented it for booleans and tuples.

Resolved issues:

Resolves: #1363, PR 2/3

Call-outs:

  • This requires Support for Primitive Proptests #1435 to merge first. This is PR 2/3 to implement support for primitive types in proptest.
  • As of now, the diff looks large. However, once the above PR merges, the size of the PR should be around 10 files.
  • Since only primitives and tuples of them are supported, the test cases is only 1 file. Tthis test case is designed to test both tuples and booleans at once.

Testing:

  • How is this change tested? tests/cargo-kani/proptest/src/arbitrary_boolean.rs

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

Yoshi Takashima added 30 commits July 1, 2022 15:30
@YoshikiTakashima YoshikiTakashima requested a review from a team as a code owner August 5, 2022 22:55
Copy link
Contributor

@celinval celinval left a comment

Choose a reason for hiding this comment

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

Copying my comment from #1435

I don't think we should add the proptest code in our repository. We should probably do one of the following:

  1. Refactor the changes so we can extend proptest instead of forking from it.
  2. If we do need to fork proptest, we should create a separate repository with the fork. We should then add a submodule here to this fork.

Feel free to ping me offline if you want to discuss this further or if you have any suggestions.

@@ -80,10 +82,18 @@ impl KaniSession {
});
}

let mut symtabs = glob(&outdir.join("*.symtab.json"))?;
let mut metadata = glob(&outdir.join("*.kani-metadata.json"))?;
if std::env::var("IS_KANI_PROPTEST").is_ok() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this be a runtime option?

@YoshikiTakashima
Copy link
Contributor Author

Closing pull request in favor of merging to features/proptest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Primitive Proptests
2 participants