diff options
author | Kuat Yessenov <kuat@csail.mit.edu> | 2011-12-23 01:15:27 -0500 |
---|---|---|
committer | Kuat Yessenov <kuat@csail.mit.edu> | 2011-12-23 01:15:27 -0500 |
commit | b07a60593b867c2b06c6044bea49380199a9eac9 (patch) | |
tree | df5a02333799f2736b4a0169d5a9c12c77ebaccd /Chalice/tests | |
parent | a587a83b6e78bcfe2f74173f0d9a4d3aeb54c6e3 (diff) |
Chalice: fix all refinement regression tests
Diffstat (limited to 'Chalice/tests')
-rw-r--r-- | Chalice/tests/refinements/AngelicExec.chalice | 2 | ||||
-rw-r--r-- | Chalice/tests/refinements/Answer | 95 | ||||
-rw-r--r-- | Chalice/tests/refinements/test.bat | 12 | ||||
-rw-r--r-- | Chalice/tests/runalltests.bat | 5 |
4 files changed, 65 insertions, 49 deletions
diff --git a/Chalice/tests/refinements/AngelicExec.chalice b/Chalice/tests/refinements/AngelicExec.chalice index 06ab9c83..582c3944 100644 --- a/Chalice/tests/refinements/AngelicExec.chalice +++ b/Chalice/tests/refinements/AngelicExec.chalice @@ -2,7 +2,7 @@ class A0 { method m(b: bool) {
var x;
if (b) {
- var x [0 <= x && x < 3];
+ spec x [0 <= x && x < 3];
} else {
x := 1;
}
diff --git a/Chalice/tests/refinements/Answer b/Chalice/tests/refinements/Answer index 8bd8a24b..aa387295 100644 --- a/Chalice/tests/refinements/Answer +++ b/Chalice/tests/refinements/Answer @@ -1,45 +1,50 @@ -Processing LoopSqRoot.chalice - -Boogie program verifier finished with 9 verified, 0 errors -Processing RecSqRoot.chalice - -Boogie program verifier finished with 11 verified, 0 errors -Processing SpecStmt.chalice - 12.5: Assertion might not hold. The expression at 12.12 might not evaluate to true. - 25.5: Assertion might not hold. The expression at 25.12 might not evaluate to true. - 33.5: Assertion might not hold. The expression at 33.12 might not evaluate to true. - -Boogie program verifier finished with 4 verified, 3 errors -Processing SumCubes.chalice - -Boogie program verifier finished with 6 verified, 0 errors -Processing TestTransform.chalice - -Boogie program verifier finished with 10 verified, 0 errors -Processing TestRefines.chalice - 28.5: Refinement may produce different value for pre-state local variable: c - -Boogie program verifier finished with 14 verified, 1 error -Processing RecFiniteDiff.chalice - -Boogie program verifier finished with 9 verified, 0 errors -Processing LoopFiniteDiff.chalice - -Boogie program verifier finished with 12 verified, 0 errors -Processing Pick.chalice - 26.25: Sequence index might be larger than or equal to the length of the sequence. - -Boogie program verifier finished with 11 verified, 1 error -Processing TestCoupling.chalice - 35.13: The postcondition at 35.13 might not hold. Insufficient fraction at 35.13 for A1.y. - 62.38: Location might not be readable. - 66.5: Location might not be writable - -Boogie program verifier finished with 17 verified, 3 errors -Processing Calculator.chalice - -Boogie program verifier finished with 15 verified, 0 errors -Processing AngelicExec.chalice - 14.5: Refinement may produce different value for a declared local variable: x - -Boogie program verifier finished with 11 verified, 1 error +Processing LoopSqRoot.chalice
+
+Boogie program verifier finished with 9 verified, 0 errors
+Processing RecSqRoot.chalice
+
+Boogie program verifier finished with 11 verified, 0 errors
+Processing SpecStmt.chalice
+ 12.5: Assertion might not hold. The expression at 12.12 might not evaluate to true.
+ 25.5: Assertion might not hold. The expression at 25.12 might not evaluate to true.
+ 33.5: Assertion might not hold. The expression at 33.12 might not evaluate to true.
+
+Boogie program verifier finished with 4 verified, 3 errors
+Processing SumCubes.chalice
+
+Boogie program verifier finished with 6 verified, 0 errors
+Processing TestTransform.chalice
+
+Boogie program verifier finished with 10 verified, 0 errors
+Processing TestRefines.chalice
+ 40.5: Refinement may produce a different value for the pre-state local variable: c
+ 46.21: Refinement may change a variable outside of the frame of the specification statement: k
+ 52.9: Refinement may produce a different value for the pre-state local variable: k
+
+Boogie program verifier finished with 16 verified, 3 errors
+Processing RecFiniteDiff.chalice
+
+Boogie program verifier finished with 9 verified, 0 errors
+Processing LoopFiniteDiff.chalice
+
+Boogie program verifier finished with 12 verified, 0 errors
+Processing Pick.chalice
+ 26.25: Sequence index might be larger than or equal to the length of the sequence.
+
+Boogie program verifier finished with 11 verified, 1 error
+Processing TestCoupling.chalice
+ 35.13: The postcondition at 35.13 might not hold. Insufficient fraction at 35.13 for A1.y.
+ 62.38: Location might not be readable.
+ 66.5: Location might not be writable
+
+Boogie program verifier finished with 17 verified, 3 errors
+Processing Calculator.chalice
+
+Boogie program verifier finished with 15 verified, 0 errors
+Processing AngelicExec.chalice
+ 14.5: Refinement may produce a different value for the declared variable: x
+
+Boogie program verifier finished with 11 verified, 1 error
+Processing RefinesLoop.chalice
+The program did not typecheck.
+2.1: a refinement cycle detected B->C->A
diff --git a/Chalice/tests/refinements/test.bat b/Chalice/tests/refinements/test.bat index b1adc199..986647d6 100644 --- a/Chalice/tests/refinements/test.bat +++ b/Chalice/tests/refinements/test.bat @@ -8,12 +8,16 @@ setlocal EnableDelayedExpansion set chalice="%~dp0\..\..\chalice.bat" set output=Output set answer=Answer -set parameters="-smoke -noTermination" +set parameters="-noTermination" set tests=LoopSqRoot,RecSqRoot,SpecStmt,SumCubes,TestTransform,TestRefines,RecFiniteDiff,LoopFiniteDiff,Pick,TestCoupling,Calculator,AngelicExec,RefinesLoop REM Remove stale output file if exist %output% del %output% +echo ------------------------------------- +echo Refinement extension regression tests +echo ------------------------------------- + REM Process each test for %%f in (%tests%) do ( echo Processing %%f.chalice >> %output% @@ -23,6 +27,8 @@ for %%f in (%tests%) do ( call %chalice% "%%f.chalice" "%parameters%" >> %output% 2>&1 ) +echo ------------------------------------- + REM Compare with the reference fc %answer% %output% > nul @@ -30,12 +36,12 @@ if not errorlevel 1 goto passTest goto failTest :passTest -echo Success +echo Passed if exist %output% del %output% if exist out.bpl del out.bpl exit /b 0 :failTest -echo Failure +echo Failed (see Output) exit /b 1 diff --git a/Chalice/tests/runalltests.bat b/Chalice/tests/runalltests.bat index c75863ed..54121bbe 100644 --- a/Chalice/tests/runalltests.bat +++ b/Chalice/tests/runalltests.bat @@ -24,6 +24,11 @@ for %%f in (examples permission-model general-tests regressions) do ( echo ------------------------------------------------------
)
+REM Run refinement regression tests
+cd refinements
+call test.bat
+cd ..
+
if !nosummary!==0 (
echo.
if !c!==0 (echo SUMMARY: completed !t! tests successfully.) else (echo SUMMARY: !c! of !t! tests failed.)
|