generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 135
Add --exact flag
#2527
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
Merged
Merged
Add --exact flag
#2527
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
86e81f9
Add --exact flag
jaisnan 8d5e752
Merge branch 'main' into add-exact-flag
jaisnan 00a367f
Add completion status to single harness, and address PR feedback
jaisnan fa0ae25
Merge branch 'main' of https://github.com/model-checking/kani into ad…
jaisnan cc55874
Merge branch 'add-exact-flag' of https://github.com/jaisnan/kani into…
jaisnan 2bbf0f8
Add doc comments
jaisnan 85936fe
Add summary to tests
jaisnan 50b0e8d
Merge branch 'main' into add-exact-flag
jaisnan 8431ef9
Merge branch 'main' of https://github.com/model-checking/kani into ad…
jaisnan cd72692
Add failure on any exact match failing
jaisnan ad8529a
add error on any missing harness with --exact
jaisnan d7c1494
Merge branch 'main' into add-exact-flag
jaisnan 0b5fb68
Merge branch 'main' of https://github.com/model-checking/kani into ad…
jaisnan 90ee54e
Address PR comments
jaisnan f03062f
add formatting
jaisnan 6b3febe
Fix expected files
jaisnan 4fc73ee
Merge branch 'add-exact-flag' of https://github.com/jaisnan/kani into…
jaisnan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| Checking harness check_foo... | ||
| Complete - 1 successfully verified harnesses, 0 failures, 1 total. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| // Copyright Kani Contributors | ||
| // SPDX-License-Identifier: Apache-2.0 OR MIT | ||
| // kani-flags: --harness check_foo --exact | ||
| //! Check for the summary line at the end of the verification output | ||
|
|
||
| #[kani::proof] | ||
| fn check_foo() { | ||
| assert!(1 == 1); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| Checking harness first::check_foo... | ||
| VERIFICATION:- SUCCESSFUL | ||
jaisnan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| Complete - 1 successfully verified harnesses, 0 failures, 1 total. | ||
23 changes: 23 additions & 0 deletions
23
tests/ui/exact-harness/check-qualified-name/select_harness_with_module.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| // Copyright Kani Contributors | ||
| // SPDX-License-Identifier: Apache-2.0 OR MIT | ||
| // kani-flags: --harness first::check_foo --exact | ||
| //! Ensure that only the specified harness is run | ||
|
|
||
| mod first { | ||
| #[kani::proof] | ||
| fn check_foo() { | ||
| assert!(1 == 1); | ||
| } | ||
|
|
||
| /// A harness that will fail verification if it is run. | ||
| #[kani::proof] | ||
| fn check_blah() { | ||
| assert!(1 == 2); | ||
| } | ||
|
|
||
| /// A harness that will fail verification if it is run. | ||
| #[kani::proof] | ||
| fn ignore_third_harness() { | ||
| assert!(3 == 2); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| Checking harness check_second_harness... | ||
| Checking harness check_first_harness... | ||
| Complete - 2 successfully verified harnesses, 0 failures, 2 total. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| // Copyright Kani Contributors | ||
| // SPDX-License-Identifier: Apache-2.0 OR MIT | ||
| // kani-flags: --harness check_first_harness --harness check_second_harness --exact | ||
| //! Ensure that we can select multiple harnesses at a time. | ||
| #[kani::proof] | ||
| fn check_first_harness() { | ||
| assert!(1 == 1); | ||
| } | ||
|
|
||
| #[kani::proof] | ||
| fn check_second_harness() { | ||
| assert!(2 == 2); | ||
| } | ||
|
|
||
| /// A harness that will fail verification if it is run. | ||
| #[kani::proof] | ||
| fn ignore_third_harness() { | ||
| assert!(3 == 2); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| Checking harness first::harness... | ||
| VERIFICATION:- SUCCESSFUL | ||
| Complete - 1 successfully verified harnesses, 0 failures, 1 total. | ||
|
|
23 changes: 23 additions & 0 deletions
23
tests/ui/exact-harness/check_substring_not_matching/select_harness_with_module.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| // Copyright Kani Contributors | ||
| // SPDX-License-Identifier: Apache-2.0 OR MIT | ||
| // kani-flags: --harness first::harness --exact | ||
| //! Ensure that only the harness specified with --exact is picked up | ||
|
|
||
| mod first { | ||
| #[kani::proof] | ||
| fn harness() { | ||
| assert!(1 == 1); | ||
| } | ||
|
|
||
| /// A harness that will fail verification if it is picked up. | ||
| #[kani::proof] | ||
| fn harness_1() { | ||
| assert!(1 == 2); | ||
| } | ||
|
|
||
| /// A harness that will fail verification if it is picked up. | ||
| #[kani::proof] | ||
| fn harness_2() { | ||
| assert!(3 == 2); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| error: Failed to match the following harness(es): | ||
| check_blah`, `check_foo | ||
| Please specify the fully-qualified name of a harness. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| // Copyright Kani Contributors | ||
| // SPDX-License-Identifier: Apache-2.0 OR MIT | ||
| // kani-flags: --harness existing --harness check_blah --harness check_foo --exact | ||
| //! Check that we error out with non-matching filters when --exact is used | ||
|
|
||
| mod first { | ||
| #[kani::proof] | ||
| fn check_foo() { | ||
| assert!(1 == 2); | ||
| } | ||
|
|
||
| #[kani::proof] | ||
| fn check_blah() { | ||
| assert!(2 == 2); | ||
| } | ||
|
|
||
| /// A harness that will fail verification if it is run. | ||
| #[kani::proof] | ||
| fn ignore_third_harness() { | ||
| assert!(3 == 2); | ||
| } | ||
| } | ||
|
|
||
| // This harness will be picked up | ||
| #[kani::proof] | ||
| fn existing() { | ||
| assert!(1 == 1); | ||
| } | ||
|
|
||
| #[kani::proof] | ||
| fn existing_harness() { | ||
| assert!(1 == 2); | ||
| } | ||
|
|
||
| /// A harness that will fail verification if it is run. | ||
| #[kani::proof] | ||
| fn ignored_harness() { | ||
| assert!(3 == 2); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| error: Failed to match the following harness(es): | ||
| ignore_third_harness | ||
| Please specify the fully-qualified name of a harness. |
22 changes: 22 additions & 0 deletions
22
tests/ui/exact-harness/incomplete-harness-name/incomplete_harness.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| // Copyright Kani Contributors | ||
| // SPDX-License-Identifier: Apache-2.0 OR MIT | ||
| // kani-flags: --harness ignore_third_harness --exact | ||
| //! Check that we error out with non-matching filters when --exact is used | ||
|
|
||
| mod first { | ||
| #[kani::proof] | ||
| fn check_foo() { | ||
| assert!(1 == 1); | ||
| } | ||
|
|
||
| #[kani::proof] | ||
| fn check_blah() { | ||
| assert!(2 == 2); | ||
| } | ||
|
|
||
| /// A harness that will fail verification if it is run. | ||
| #[kani::proof] | ||
| fn ignore_third_harness() { | ||
| assert!(3 == 2); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| Checking harness second::verify_foo... | ||
| Checking harness first::check_blah... | ||
| Complete - 2 successfully verified harnesses, 0 failures, 2 total. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.