Debian Codegraph @

tests/calculateoverallcoverage.awk

raw
1 # Calculates total statistics for source-based code coverage report created
2 # with `llvm-cov report` when at least one source file has been specified.
3
4 # NOTE: When at least one source file is passed to `llvm-cov`, the summaries
5 # are shown for each function in the listed files (and not for each file in the
6 # coverage data).
7
8 {
9 if($1 == "TOTAL") {
10 total_regions += $2;
11 missed_regions += $3;
12 total_lines += $5;
13 missed_lines += $6;
14 }
15 }
16
17 END {
18 covered_regions = total_regions - missed_regions;
19 covered_lines = total_lines - missed_lines;
20
21 print "Covered regions: " covered_regions;
22 print "Missed regions: " missed_regions;
23 print "Region cover: " covered_regions/total_regions*100 "%\n";
24 print "Covered lines: " covered_lines;
25 print "Missed lines: " missed_lines;
26 print "Line cover: " covered_lines/total_lines*100 "%";
27 }