Skip to content

Commit

Permalink
HTML report: Fix row coloring depending on test status
Browse files Browse the repository at this point in the history
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/[email protected]/
Acked-by: Petr Vorel <[email protected]>
Signed-off-by: Remi Peuvergne <[email protected]>
  • Loading branch information
Remi Peuvergne authored and pevik committed Sep 3, 2024
1 parent 5de66fe commit 7172f05
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tools/genhtml.pl
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ ()
"<td><p><strong>$termination_id_value[1]</strong></p></td>\n" .
"<td><p><strong>$corefile_value[1]</strong></p></td>\n";
$row_line =~ s/<tr>/<tr\ bgcolor=$background_colour>/;
$flag4++;
}
if ( $flag4 == 3 ) {
@variable_value_pair = split(/\ /, $line);
Expand All @@ -170,7 +171,6 @@ ()
$row_line = $row_line . "<td><p><strong>$cutime_value[1]</strong></p></td>\n" .
"<td><p><strong>$cstime_value[1]</strong></p></td></tr>\n";
}
$flag4++;
}
if ( $line =~ /$execution_tag/ ) {
$flag2 = 0;
Expand All @@ -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/ ) {
Expand Down

0 comments on commit 7172f05

Please sign in to comment.