-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathannotations-cobertura.ads
59 lines (53 loc) · 3.19 KB
/
annotations-cobertura.ads
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
------------------------------------------------------------------------------
-- --
-- GNATcoverage --
-- --
-- Copyright (C) 2023-2024, AdaCore --
-- --
-- GNATcoverage is free software; you can redistribute it and/or modify it --
-- under terms of the GNU General Public License as published by the Free --
-- Software Foundation; either version 3, or (at your option) any later --
-- version. This software is distributed in the hope that it will be useful --
-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- --
-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public --
-- License for more details. You should have received a copy of the GNU --
-- General Public License distributed with this software; see file --
-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy --
-- of the license. --
------------------------------------------------------------------------------
with Coverage;
package Annotations.Cobertura is
-- Generate a report in the Cobertura report format. This report format
-- is designed for integration with standard continuous integration
-- systems, e.g. gitlab CI, which do not support standard gnatcov report
-- formats. The only specification for this format is a document type
-- definition found there:
-- https://github.com/cobertura/web/blob/master/htdocs/xml/coverage-04.dtd
--
-- This is a partial report in the sense that gnatcov coverage metrics
-- can't be specified accurately in the Cobertura report format. This
-- format provides
--
-- * Line coverage metrics: whether a line was covered, and the number
-- of coverage hits.
--
-- * Condition coverage metrics: whether a line is branching (talking
-- Cobertura terminology, which means whether it has any condition).
-- For each condition, whether its true / false / both valuation(s)
-- were covered.
--
-- Obviously, neither decision and MC/DC coverage can be expressed using
-- the aforementioned metrics without little tweaks. We actually chose
-- to represent decision coverage in the condition coverage metrics:
-- a decision (gnatcov) is represented as a condition (cobertura). We drop
-- the MC/DC coverage as we can't express it.
--
-- Note that for now, at least some of the continuous integration systems
-- (this is the case for gitlab at least) do not integrate condition
-- coverage results, which means that users won't have decision coverage
-- results over their code if they use it with gitlab.
procedure Generate_Report (Context : Coverage.Context_Access);
function Installed return Boolean;
-- Return whether the DTD is installed, i.e. the required resource files
-- are installed in lib/gnatcoverage/.
end Annotations.Cobertura;