Skip to content

Commit 409dcbc

Browse files
committed
Merge branch 'leo/115-ada_2022_doc' into 'master'
Document iterator filters are considered as decisions See merge request eng/cov/gnatcoverage!246 Iterator filters, introduced with Ada 2022, can control the flow of the program. As such when adding support for this construct, the tool now considers their predicate as decisions for decision level coverage. This change documents this in the user guide. Part of eng/cov/gnatcoverage#115
2 parents 7fbcdea + e1ba256 commit 409dcbc

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

doc/gnatcov/cov_source.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -777,6 +777,10 @@ performs Statement and Decision Coverage assessments combined together.
777777
* The iteration predicate of Ada quantified expressions, in the same
778778
contexts as for if-expressions.
779779

780+
* The iterator filter predicate optionally present in a loop parameter
781+
specification or in an iterator specification, in the same context as
782+
if-expressions.
783+
780784
The expression may be of essentially any type in C. In Ada, this may
781785
be the standard Boolean type, or subtypes of it, or derived types
782786
thereof. Here are a few examples show-casing decisions in a variety of
@@ -793,6 +797,9 @@ contexts::
793797
Z := (for all X of Container => P(X)); -- "P(X)", quantified-expression predicate
794798
T := (for some X of Container => P(X));
795799

800+
for I in 1 .. 10 when (I mod 2) = 0 loop ... -- "(I mod 2) = 0", iterator filter predicate
801+
F := (for Elt of Container when Pred (Elt) => Elt); -- "Pred (Elt)", iterator filter predicate
802+
796803

797804
The coverage status of a decision obligation is determined as
798805
follows:

0 commit comments

Comments
 (0)