-
Notifications
You must be signed in to change notification settings - Fork 270
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #4816 ### Description Add an option `--filter-position` to the `dafny verify` command, that allows verifying a single function or method, based on a file path and a line number. For example, `dafny verify dfyconfig.toml --filter-position=source1.dfy:5` will only verify something if it ranges over line 5 in the file `source1.dfy`. ### How has this been tested? Add a littish test `filter.dfy` <small>By submitting this pull request, I confirm that my contribution is made under the terms of the [MIT license](https://github.com/dafny-lang/dafny/blob/master/LICENSE.txt).</small>
- Loading branch information
1 parent
745b2f0
commit f90f5df
Showing
10 changed files
with
92 additions
and
5 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
Empty file.
7 changes: 7 additions & 0 deletions
7
Source/IntegrationTests/TestFiles/LitTests/LitTest/verification/Inputs/src/source1.dfy
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,7 @@ | ||
method Succeeds() | ||
ensures true { | ||
} | ||
|
||
method Fails() | ||
ensures false { | ||
} |
7 changes: 7 additions & 0 deletions
7
Source/IntegrationTests/TestFiles/LitTests/LitTest/verification/Inputs/src/source2.dfy
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,7 @@ | ||
method Succeeds2() | ||
ensures true { | ||
} | ||
|
||
method Fails2() | ||
ensures false { | ||
} |
11 changes: 11 additions & 0 deletions
11
Source/IntegrationTests/TestFiles/LitTests/LitTest/verification/boogie-filter.dfy
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,11 @@ | ||
// RUN: %verify --boogie-filter='*Succeeds*' --bprint:"%t.bpl" %s > %t | ||
// RUN: ! %verify %s >> %t | ||
// RUN: %diff "%s.expect" "%t" | ||
|
||
method Succeeds() | ||
ensures true { | ||
} | ||
|
||
method Fails() | ||
ensures false { | ||
} |
6 changes: 6 additions & 0 deletions
6
Source/IntegrationTests/TestFiles/LitTests/LitTest/verification/boogie-filter.dfy.expect
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,6 @@ | ||
|
||
Dafny program verifier finished with 1 verified, 0 errors | ||
boogie-filter.dfy(10,16): Error: a postcondition could not be proved on this return path | ||
boogie-filter.dfy(10,10): Related location: this is the postcondition that could not be proved | ||
|
||
Dafny program verifier finished with 1 verified, 1 error |
8 changes: 6 additions & 2 deletions
8
Source/IntegrationTests/TestFiles/LitTests/LitTest/verification/filter.dfy
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
18 changes: 15 additions & 3 deletions
18
Source/IntegrationTests/TestFiles/LitTests/LitTest/verification/filter.dfy.expect
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 |
---|---|---|
@@ -1,6 +1,18 @@ | ||
|
||
Dafny program verifier finished with 1 verified, 0 errors | ||
filter.dfy(10,16): Error: a postcondition could not be proved on this return path | ||
filter.dfy(10,10): Related location: this is the postcondition that could not be proved | ||
Dafny program verifier finished with 0 verified, 0 errors | ||
|
||
Dafny program verifier finished with 0 verified, 0 errors | ||
filter.dfy(14,16): Error: a postcondition could not be proved on this return path | ||
filter.dfy(14,10): Related location: this is the postcondition that could not be proved | ||
|
||
Dafny program verifier finished with 1 verified, 1 error | ||
filter.dfy(14,16): Error: a postcondition could not be proved on this return path | ||
filter.dfy(14,10): Related location: this is the postcondition that could not be proved | ||
|
||
Dafny program verifier finished with 0 verified, 1 error | ||
source1.dfy(6,16): Error: a postcondition could not be proved on this return path | ||
source1.dfy(6,10): Related location: this is the postcondition that could not be proved | ||
|
||
Dafny program verifier finished with 0 verified, 1 error | ||
|
||
Dafny program verifier finished with 1 verified, 0 errors |
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 @@ | ||
Add an option `--filter-position` to the `dafny verify` command, that allows verifying a single function or method, based on a file path and a line number. For example, `dafny verify dfyconfig.toml --filter-position=source1.dfy:5` will only verify thing that ranges over line 5 in the file `source1.dfy`. |