forked from model-checking/kani
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
--exact
flag (model-checking#2527)
- Loading branch information
Showing
17 changed files
with
314 additions
and
22 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 | ||
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 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 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 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 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 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 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 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 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 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 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.