Skip to content
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

Enable Concrete Playback Unit tests to run with --cfg kani #2353

Merged
merged 22 commits into from
Apr 7, 2023

Conversation

jaisnan
Copy link
Contributor

@jaisnan jaisnan commented Apr 6, 2023

Description of changes:

Fixes #1610 by creating a concrete_playback feature in kani_macros. Users can now call their unit tests with the command - RUSTFLAGS="--cfg=kani" cargo +nightly test.

Resolved issues:

Resolves #1610

Call-outs:

Still need to pass +nightly with the tests. Already recorded in #1609.

Testing:

  • How is this change tested? Regression 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.

@jaisnan jaisnan requested a review from a team as a code owner April 6, 2023 07:17
@karkhaz karkhaz self-requested a review April 6, 2023 18:33
@celinval
Copy link
Contributor

celinval commented Apr 6, 2023

Thanks Jai for fixing this. I was also thinking that we could improve this logic by making the default the behaviour that is today activated by concrete playback.

Instead of using #[cfg(kani)] in our libraries, we could use something like #[cfg(kani_symex)] which is set by our compiler together with the kani cfg.

I didn't want to suggest this before so this fix wouldn't get too big. But I think it would address @karkhaz important concern of cfg explosion.

…/main.rs

Co-authored-by: Adrian Palacios <73246657+adpaco-aws@users.noreply.github.com>
@jaisnan jaisnan enabled auto-merge (squash) April 7, 2023 00:21
@jaisnan jaisnan merged commit f266f0f into model-checking:main Apr 7, 2023
karkhaz added a commit to karkhaz/kani that referenced this pull request Apr 19, 2023
* The Kani reference now includes an
  ["Attributes"](https://model-checking.github.io/kani/reference/attributes.html)
  section that describes each of the attributes available in Kani
  ([pull request](model-checking#2359)
by @adpaco-aws)
* Users' choice of SAT solver, specified by the `solver` attribute,
  is now propagated to the loop-contract synthesizer ([pull
  request](model-checking#2320) by
  @qinheping)
* Unit tests generated by the concrete playback feature now compile
  correctly when using `RUSTFLAGS="--cfg=kani"` ([pull
  request](model-checking#2353) by
@jaisnan)
* The Rust toolchain is updated to 2023-02-18 ([pull
  request](model-checking#2384) by
  @tautschnig)
@karkhaz karkhaz mentioned this pull request Apr 19, 2023
4 tasks
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Concrete playback instructions don't work if user sets --cfg=kani
4 participants