Skip to content

Add a regression test for running verify-std command.#3236

Merged
celinval merged 2 commits intomodel-checking:mainfrom
celinval:issue-3226-std-regression
Jun 7, 2024
Merged

Add a regression test for running verify-std command.#3236
celinval merged 2 commits intomodel-checking:mainfrom
celinval:issue-3226-std-regression

Conversation

@celinval
Copy link
Contributor

@celinval celinval commented Jun 6, 2024

In #3226, we added a new command that allow Kani to verify properties in a custom standard library. In this PR, we create a script test that create a modified version of the standard library and runs Kani against it.

I also moved the script based tests to run after the more generic regression jobs. I think the script jobs are a bit harder to debug, they may take longer, and they are usually very specific to a few features. So probably best if we run the more generic tests first.

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

@celinval celinval requested a review from a team as a code owner June 6, 2024 22:30
Copy link
Contributor

@jaisnan jaisnan left a comment

Choose a reason for hiding this comment

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

lgtm now

@celinval celinval merged commit 0bb1325 into model-checking:main Jun 7, 2024
jaisnan added a commit that referenced this pull request Jun 11, 2024
### Approach So far

The approach so far has been to shift the `kani` library's functionality
to `kani_core` instead, which has no dependencies of its own. By moving
these API functions to macros, we delay the compilation of these to when
Kani is invoked.

Tested by using the regression tests added @celinval in
#3236 using the new
`verify-std` subcommand.

### Running Kani

To test Kani itself, we injected a proof inside the core library by
making these changes.

```  rust
#[cfg(kani)]
kani_core::kani_lib!(core);

#[cfg(kani)]
#[unstable(feature = "kani", issue = "none")]
pub mod verify {
    use crate::kani;

    #[kani::proof]
    pub fn harness() {
        kani::assert(true, "yay");
    }
}
```

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

---------

Co-authored-by: Celina G. Val <celinval@amazon.com>
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.

3 participants