From dbe6a031860c1808dcb63d7816165ef4614828bc Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Fri, 20 May 2022 10:33:10 +0200 Subject: 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 Signed-off-by: Mauro Carvalho Chehab --- scripts/code_cov_parse_info | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/scripts/code_cov_parse_info b/scripts/code_cov_parse_info index 77291eb6..09f9aba5 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 " \n

\n\n"; + if ($filter_str ne "") { + printf OUT "

Filters: %s.

\n", $filter_str; + } else { + print OUT "

(unfiltered results)

"; + } + if ($total > 1) { print OUT "

Tests coverage

\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"}; -- cgit v1.2.3