llvm_cov_json/types/summary.rs
1use serde::Deserialize;
2
3/// Summary of the different metrics.
4#[derive(Debug, PartialEq, Deserialize)]
5pub struct Summary {
6 /// Summary of all branches.
7 pub branches: BranchSummary,
8 /// Summary of all functions.
9 pub functions: FunctionSummary,
10 /// Summary of all instantiations.
11 pub instantiations: InstantiationSummary,
12 /// Summary of all lines of code.
13 pub lines: LineSummary,
14 /// Summary of all regions.
15 pub regions: RegionSummary,
16}
17
18/// Summary of the branches metric.
19#[derive(Debug, PartialEq, Deserialize)]
20pub struct BranchSummary {
21 /// Total number of branches that cloud potentially be covered,
22 pub count: u64,
23 /// Number of covered branches.
24 pub covered: u64,
25 /// Number of the branches that have not been covered.
26 pub notcovered: u64,
27 /// The fraction of branches covered in percent.
28 pub percent: f32,
29}
30
31/// Summary of the functions metric.
32#[derive(Debug, PartialEq, Deserialize)]
33pub struct FunctionSummary {
34 /// Total number of function.
35 pub count: u64,
36 /// Number of functions covered.
37 pub covered: u64,
38 /// Fraction of functions that have been covered in percent.
39 pub percent: f32,
40}
41
42/// Summary of the instations metric.
43#[derive(Debug, PartialEq, Deserialize)]
44pub struct InstantiationSummary {
45 /// Number of instations, i.e., total count of macros that have been instantiated.
46 pub count: u64,
47 /// Number of macro instantiations that have been covered.
48 pub covered: u64,
49 /// Fraction of instantiations that have been covered in percent.
50 pub percent: f32,
51}
52
53/// Summary of the lines metric.
54#[derive(Debug, PartialEq, Deserialize)]
55pub struct LineSummary {
56 /// Number of lines that could be covered.
57 pub count: u64,
58 /// Number of lines that have been covered.
59 pub covered: u64,
60 /// Fraction of lines that have been covered in percent.
61 pub percent: f32,
62}
63
64/// Summary of the regions metric.
65#[derive(Debug, PartialEq, Deserialize)]
66pub struct RegionSummary {
67 /// Number of total regions.
68 pub count: u64,
69 /// Number of covered regions.
70 pub covered: u64,
71 /// Number of the regions that have not been covered.
72 pub notcovered: u64,
73 /// Fraction of regions that have been covered in percent.
74 pub percent: f32,
75}