forked from dafny-lang/dafny
-
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.
fix: Continue to compilation tests after comparing .verifier.expect (d…
…afny-lang#4356) This PR fixes and changes the behavior of `%testDafnyForEachCompiler` tests. The bug that is fixed had caused 16 compiler tests in the Dafny test suite to not run. Here is a description of the new behavior, where _italicized_ parts indicate changes from before: * Verification is expected to go through with a 0 exit code. * If there is a `.verifier.expect` file, then the actual output is expected to contain a blank line followed by a line that starts with `Dafny program verifier`, and this portion of the output will be removed before comparing the output. The remaining output is compared with the contents of the `.verifier.expect` file and is expected to match. * If there is no `.verifier.expect` file, the verifier output minus the `Dafny program verifier` line (see previous bullet) is expected to be empty. * When running the test for each compiler, if the output contains a line starting with `Dafny program verifier`, then _everything up to and include that line is removed_ before comparing the output. This PR adds add test in `Test/metatests`. Fixes dafny-lang#4355 <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> --------- Co-authored-by: Robin Salkeld <[email protected]>
- Loading branch information
1 parent
d8cd09f
commit 19cabf7
Showing
17 changed files
with
123 additions
and
34 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// RUN: ! %testDafnyForEachCompiler "%s" > "%t" | ||
// RUN: %diff "%s.testdafny.expect" "%t" | ||
|
||
method Main() { | ||
ghost var n := 15; | ||
if j :| 0 <= j < n { // this gives a no-trigger warning | ||
} | ||
print "hello\n"; | ||
} |
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 @@ | ||
good bye |
37 changes: 37 additions & 0 deletions
37
Test/metatests/TestBeyondVerifierExpect.dfy.testdafny.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,37 @@ | ||
Verifying... | ||
Executing on C#... | ||
AssertEqualWithDiff() Failure | ||
Diff (changing expected into actual): | ||
-good bye | ||
+hello | ||
|
||
|
||
Executing on JavaScript... | ||
AssertEqualWithDiff() Failure | ||
Diff (changing expected into actual): | ||
-good bye | ||
+hello | ||
|
||
|
||
Executing on Go... | ||
AssertEqualWithDiff() Failure | ||
Diff (changing expected into actual): | ||
-good bye | ||
+hello | ||
|
||
|
||
Executing on Java... | ||
AssertEqualWithDiff() Failure | ||
Diff (changing expected into actual): | ||
-good bye | ||
+hello | ||
|
||
|
||
Executing on Python... | ||
AssertEqualWithDiff() Failure | ||
Diff (changing expected into actual): | ||
-good bye | ||
+hello | ||
|
||
|
||
Executing on C++... |
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 @@ | ||
TestBeyondVerifierExpect.dfy(6,5): Warning: /!\ No terms found to trigger on. |
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,8 @@ | ||
// RUN: ! %testDafnyForEachCompiler "%s" > "%t" | ||
// RUN: %diff "%s.testdafny.expect" "%t" | ||
|
||
method Main() { | ||
ghost var n := 15; | ||
assert n < 12; // error: the verifier complains about this | ||
print "hello\n"; | ||
} |
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 @@ | ||
hello |
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,8 @@ | ||
Verifying... | ||
Verification failed. Output: | ||
TestDoesNotVerify.dfy(6,11): Error: assertion might not hold | ||
|
||
Dafny program verifier finished with 0 verified, 1 error | ||
|
||
Error: | ||
|
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 @@ | ||
TestDoesNotVerify.dfy(6,11): Error: assertion might not hold |
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 @@ | ||
// RUN: ! %testDafnyForEachCompiler "%s" > "%t" | ||
// RUN: %diff "%s.testdafny.expect" "%t" | ||
|
||
method Main() { | ||
ghost var n := 15; | ||
if j :| 0 <= j < n { // this gives a no-trigger warning | ||
} | ||
print "hello\n"; | ||
} |
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 @@ | ||
hello |
6 changes: 6 additions & 0 deletions
6
Test/metatests/TestMissingVerifierExpect.dfy.testdafny.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 @@ | ||
Verifying... | ||
AssertEqualWithDiff() Failure | ||
Diff (changing expected into actual): | ||
+TestMissingVerifierExpect.dfy(6,5): Warning: /!\ No terms found to trigger on. | ||
+ | ||
|
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 @@ | ||
// RUN: ! %testDafnyForEachCompiler "%s" > "%t" | ||
// RUN: %diff "%s.testdafny.expect" "%t" | ||
|
||
method Main() { | ||
ghost var n := 15; | ||
if j :| 0 <= j < n { // this gives a no-trigger warning | ||
} | ||
print "hello\n"; | ||
} |
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 @@ | ||
hello |
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 @@ | ||
Verifying... | ||
AssertEqualWithDiff() Failure | ||
Diff (changing expected into actual): | ||
-warning: out of bananas | ||
+TestWrongVerifierExpect.dfy(6,5): Warning: /!\ No terms found to trigger on. | ||
|
||
|
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 @@ | ||
warning: out of bananas |