diff --git a/Source/ExecutionEngine/ExecutionEngine.cs b/Source/ExecutionEngine/ExecutionEngine.cs index 78d20b958..1eec9f43c 100644 --- a/Source/ExecutionEngine/ExecutionEngine.cs +++ b/Source/ExecutionEngine/ExecutionEngine.cs @@ -673,7 +673,7 @@ private async Task VerifyEachImplementation(TextWriter output, CleanupRequest(requestId); } - if (Options.TrackVerificationCoverage && processedProgram.Program.AllCoveredElements.Any()) { + if (Options.Trace && Options.TrackVerificationCoverage && processedProgram.Program.AllCoveredElements.Any()) { Options.OutputWriter.WriteLine("Elements covered by verification: {0}", string.Join(", ", processedProgram.Program.AllCoveredElements.OrderBy(s => s))); } diff --git a/Test/civl/samples/GC.bpl b/Test/civl/samples/GC.bpl index 560489b9d..59c2b5154 100644 --- a/Test/civl/samples/GC.bpl +++ b/Test/civl/samples/GC.bpl @@ -293,6 +293,7 @@ requires call Yield_RootScanBarrierInv(); call UpdateMutatorPhase(tid); call Yield_Iso(); call ptr, absPtr := AllocRaw(tid, y); + assert {:layer 100} Iso(root, rootAbs, mem, memAbs, Color, toAbs, allocSet); } atomic action {:layer 101} AtomicWriteField({:linear "tid"} tid:Tid, x: idx, f: fld, y: idx) // x.f = y diff --git a/Test/coverage/verificationCoverage.bpl b/Test/coverage/verificationCoverage.bpl index 50b39a247..d2a38020a 100644 --- a/Test/coverage/verificationCoverage.bpl +++ b/Test/coverage/verificationCoverage.bpl @@ -1,15 +1,28 @@ // RUN: %boogie "%s" > "%t.plain" -// RUN: %diff "%s.expect.plain" "%t.plain" +// RUN: %diff "%s.expect" "%t.plain" +// RUN: %boogie -trackVerificationCoverage -trace "%s" > "%t.coverage" +// RUN %OutputCheck "%s" --file-to-check="%t.coverage" +// CHECK: Covered elements: a0, assert_a0, assert_r0, r0 +// CHECK: Covered elements: sinv_not_1$established, sinv_not_1$maintained, sinv1$assume_in_body, sinv1$established, sinv1$maintained, sinv2$assume_in_body, sinv2$established, sinv2$maintained, spost, spre1 +// CHECK: Covered elements: cont_assume_1, cont_assume_2 +// CHECK: Covered elements: false_req +// CHECK: Covered elements: cont_req_1, cont_req_2 +// CHECK: Covered elements: assumeFalse +// CHECK: Covered elements: tee0, tee1, ter0 +// CHECK: Covered elements: call2_tee1, tee_not_1, tee0$call1$ensures, tee0$call2$ensures, tee1$call2$ensures, ter0$call1$requires, ter0$call2$requires, ter1, xy_sum +// CHECK: Covered elements: a_gt_10, constrained, x_gt_10 +// CHECK: Covered elements: cont_ens_abs$call_cont$ensures, xpos_abs$call_cont$requires, xpos_caller +// CHECK: Elements covered by verification: a_gt_10, a0, assert_a0, assert_r0, assumeFalse, call2_tee1, constrained, cont_assume_1, cont_assume_2, cont_ens_abs$call_cont$ensures, cont_req_1, cont_req_2, false_req, r0, sinv_not_1$established, sinv_not_1$maintained, sinv1$assume_in_body, sinv1$established, sinv1$maintained, sinv2$assume_in_body, sinv2$established, sinv2$maintained, spost, spre1, tee_not_1, tee0, tee0$call1$ensures, tee0$call2$ensures, tee1, tee1$call2$ensures, ter0, ter0$call1$requires, ter0$call2$requires, ter1, x_gt_10, xpos_abs$call_cont$requires, xpos_caller, xy_sum // RUN: %boogie -trackVerificationCoverage "%s" > "%t.coverage" -// RUN: %diff "%s.expect.coverage" "%t.coverage" +// RUN: %diff "%s.expect" "%t.coverage" // RUN: %boogie -trackVerificationCoverage -typeEncoding:a -prune "%s" > "%t.coverage-a" -// RUN: %diff "%s.expect.coverage" "%t.coverage-a" +// RUN: %diff "%s.expect" "%t.coverage-a" // RUN: %boogie -trackVerificationCoverage -typeEncoding:p -prune "%s" > "%t.coverage-p" -// RUN: %diff "%s.expect.coverage" "%t.coverage-p" +// RUN: %diff "%s.expect" "%t.coverage-p" // RUN: %boogie -trackVerificationCoverage -normalizeDeclarationOrder:1 -prune "%s" > "%t.coverage-d" -// RUN: %diff "%s.expect.coverage" "%t.coverage-d" +// RUN: %diff "%s.expect" "%t.coverage-d" // RUN %boogie -trackVerificationCoverage -normalizeNames:1 -prune "%s" > "%t.coverage-n" -// RUN %diff "%s.expect.coverage" "%t.coverage-n" +// RUN %diff "%s.expect" "%t.coverage-n" // UNSUPPORTED: batch_mode procedure testRequiresAssign(n: int) diff --git a/Test/coverage/verificationCoverage.bpl.expect.plain b/Test/coverage/verificationCoverage.bpl.expect similarity index 100% rename from Test/coverage/verificationCoverage.bpl.expect.plain rename to Test/coverage/verificationCoverage.bpl.expect diff --git a/Test/coverage/verificationCoverage.bpl.expect.coverage b/Test/coverage/verificationCoverage.bpl.expect.coverage deleted file mode 100644 index 32f5d2408..000000000 --- a/Test/coverage/verificationCoverage.bpl.expect.coverage +++ /dev/null @@ -1,3 +0,0 @@ -Elements covered by verification: a_gt_10, a0, assert_a0, assert_r0, assumeFalse, call2_tee1, constrained, cont_assume_1, cont_assume_2, cont_ens_abs$call_cont$ensures, cont_req_1, cont_req_2, false_req, r0, sinv_not_1$established, sinv_not_1$maintained, sinv1$assume_in_body, sinv1$established, sinv1$maintained, sinv2$assume_in_body, sinv2$established, sinv2$maintained, spost, spre1, tee_not_1, tee0, tee0$call1$ensures, tee0$call2$ensures, tee1, tee1$call2$ensures, ter0, ter0$call1$requires, ter0$call2$requires, ter1, x_gt_10, xpos_abs$call_cont$requires, xpos_caller, xy_sum - -Boogie program verifier finished with 10 verified, 0 errors diff --git a/Test/unnecessaryassumes/unnecessaryassumes1.bpl b/Test/unnecessaryassumes/unnecessaryassumes1.bpl index 34377644f..e5ec0bbbe 100644 --- a/Test/unnecessaryassumes/unnecessaryassumes1.bpl +++ b/Test/unnecessaryassumes/unnecessaryassumes1.bpl @@ -1,6 +1,9 @@ // We use boogie instead of parallel-boogie here to fix the order of the output from /trackVerificationCoverage -// RUN: %boogie /trackVerificationCoverage "%s" > "%t" -// RUN: %diff "%s.expect" "%t" +// RUN: %boogie -trackVerificationCoverage -trace "%s" > "%t" +// RUN: %OutputCheck "%s" --file-to-check="%t" +// CHECK: Covered elements: s0 +// CHECK: Covered elements: s2, s3 +// CHECK: Elements covered by verification: s0, s2, s3 // UNSUPPORTED: batch_mode procedure test0(n: int) diff --git a/Test/unnecessaryassumes/unnecessaryassumes1.bpl.expect b/Test/unnecessaryassumes/unnecessaryassumes1.bpl.expect deleted file mode 100644 index 34f57618e..000000000 --- a/Test/unnecessaryassumes/unnecessaryassumes1.bpl.expect +++ /dev/null @@ -1,3 +0,0 @@ -Elements covered by verification: s0, s2, s3 - -Boogie program verifier finished with 3 verified, 0 errors