From 7172f05e5575d0270d9e254ab47028a54c758ca2 Mon Sep 17 00:00:00 2001 From: Remi Peuvergne Date: Wed, 28 Aug 2024 08:45:26 +0200 Subject: [PATCH] HTML report: Fix row coloring depending on test status The "state machine" was broken and the overall test status was obtained *after* if was used (in the get_background_colour_column function). Fix this with a change for flag4, which now increases only when we know test status. Link: https://lore.kernel.org/ltp/20240828064526.235050-1-rpeuvergne@free.fr/ Acked-by: Petr Vorel Signed-off-by: Remi Peuvergne --- tools/genhtml.pl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/genhtml.pl b/tools/genhtml.pl index d8f52663bb1..5a9256500ed 100644 --- a/tools/genhtml.pl +++ b/tools/genhtml.pl @@ -162,6 +162,7 @@ () "

$termination_id_value[1]

\n" . "

$corefile_value[1]

\n"; $row_line =~ s///; + $flag4++; } if ( $flag4 == 3 ) { @variable_value_pair = split(/\ /, $line); @@ -170,7 +171,6 @@ () $row_line = $row_line . "

$cutime_value[1]

\n" . "

$cstime_value[1]

\n"; } - $flag4++; } if ( $line =~ /$execution_tag/ ) { $flag2 = 0; @@ -186,18 +186,23 @@ () if ($line =~ "termination_id=1" ) { $detected_fail = 1; $failed_test_counter++; + $flag4 = 2; } elsif ($line =~ "termination_id=2" ) { $detected_brok = 1; $brok_test_counter++; + $flag4 = 2; } elsif ($line =~ "termination_id=4" ) { $detected_warn = 1; $warn_test_counter++; + $flag4 = 2; } elsif ($line =~ "termination_id=32" ) { $detected_conf = 1; $conf_test_counter++; + $flag4 = 2; } elsif ($line =~ "termination_id=0" ) { $detected_pass = 1; $test_passed++; + $flag4 = 2; } } if ( $line =~ /$output_tag/ ) {