$row->{build_flags} =~ s/_PC\b//g;
$row->{build_flags} = lc($row->{build_flags});
if (defined($row->{log_text}))
- { # convert to a hash
- $row->{log_text} = { split /\s+/, $row->{log_text} };
+ { # convert to a hash, find ranges, output list of ranges
+ my $h = { split /\s+/, $row->{log_text} };
+ my $i;
+ my $start;
+ my @ranges;
+
+ foreach my $k (sort {$a<=>$b} keys %$h)
+ {
+ if (defined $start)
+ {
+ if ($h->{$k} ne $h->{$start})
+ {
+ push @ranges, sprintf("%s %s %s", $h->{$start}, $start, $i);
+ $start = $k;
+ $i = 1;
+ }
+ else
+ {
+ $i++;
+ }
+ }
+ else
+ {
+ $start = $k;
+ $i = 1;
+ }
+ }
+ if (defined $start)
+ {
+ push @ranges, sprintf("%s %s %s", $h->{$start}, $start, $i);
+ }
+
+ $row->{log_text} = \@ranges;
}
push(@$statrows,$row);
}
[%- CASE 'OK' %]pass[% CASE 'ContribCheck' %]warn[% CASE [ 'Check' 'InstallCheck' ] %]warnx[% CASE %]fail[% END %]"
[%- END -%]
[%# The IF-backstop is ugly and I'm not understanding why the res_img lookup does not for for '.' -%]
-[%- BLOCK test_result %]<img src="[% IF res_imgs.$r.defined ; res_imgs.$r ; ELSE %]/img/t_notdone.gif [% END %]" title="[% test %]" alt="[% r %]" height="16" width="1" class="inline" align="bottom" />[%- END -%]
+[%- BLOCK colour ; IF res_imgs.$c.defined ; res_imgs.$c ; ELSE %]/img/t_notdone.gif [% END; END %]
+[%- BLOCK colourbar %]<img src="[% PROCESS colour %]" title="[% st %]" alt="[% c %]" height="16" width="[% w %]" class="inline" align="bottom" />[%- END -%]
[% WRAPPER 'page.tt'
title = 'Exim BuildFarm Status'
bodyclass = 'none'
[%- IF row.stage != 'OK' %]Details[% ELSE %]Config[% END -%]</a></td>
<td class="flags">[% FOREACH flag IN row.build_flags.split().sort() ; PROCESS img ; END %]</td>
- <td class="tests">[% FOREACH test IN row.log_text.keys.nsort ; r = row.log_text.$test ; PROCESS test_result ; END %]</td>
+ <td class="tests">[% FOREACH range IN row.log_text ;
+ r = range.split(' '); c = r.0; st = r.1; w = r.2; PROCESS colourbar; END %]</td>
</tr>
[% END %]
</table>