diff options
author | Mauro Carvalho Chehab <mchehab@kernel.org> | 2022-05-20 10:33:10 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@kernel.org> | 2022-06-15 08:33:40 +0200 |
commit | dbe6a031860c1808dcb63d7816165ef4614828bc (patch) | |
tree | b278a3bbd8cd60a088c9588109a3df05802d8221 /scripts/code_cov_parse_info | |
parent | 4d9a8db54b4709a24a2e5a81a20fd8808e079ea1 (diff) |
code_cov_parse_info: output filters at the html report
Add a line after the code coverage summary printing the filters
that were used to produce the results, if any.
This is important specially when multiple filters could be used
to produce different reports.
Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'scripts/code_cov_parse_info')
-rwxr-xr-x | scripts/code_cov_parse_info | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/scripts/code_cov_parse_info b/scripts/code_cov_parse_info index 77291eb69..09f9aba57 100755 --- a/scripts/code_cov_parse_info +++ b/scripts/code_cov_parse_info @@ -538,8 +538,9 @@ my $html_prolog; my $html_epilog; my %report; -sub generate_report() +sub generate_report($) { + my $filter_str = shift; my $percent; my $prolog = ""; my $epilog = ""; @@ -715,6 +716,12 @@ sub generate_report() } print OUT " </tr>\n</table><p/>\n\n"; + if ($filter_str ne "") { + printf OUT "<p>Filters: %s.</p>\n", $filter_str; + } else { + print OUT "<p>(unfiltered results)</p>"; + } + if ($total > 1) { print OUT "<h2>Tests coverage</h2>\n"; @@ -904,8 +911,10 @@ foreach my $f (@ARGV) { } } +$filter_str =~ s/(.*),/$1 and/ if ($filter_str ne ""); + if ($gen_report) { - generate_report(); + generate_report($filter_str); exit 0; } @@ -920,7 +929,6 @@ print_summary() if ($stat); if ($has_filter) { my $percent = 100. * $stats{"used_files"} / $stats{"all_files"}; - $filter_str =~ s/(.*),/$1 and/; printf "Filters......:%s.\n", $filter_str; printf "Source files.: %.2f%% (%d of %d total)", $percent, $stats{"used_files"}, $stats{"all_files"}; |