my $statrows=[];
my $sth=$db->prepare($statement);
$sth->execute;
+
+# walk the set of result rows from the SQL query above
while (my $row = $sth->fetchrow_hashref)
{
next if (@members && ! grep {$_ eq $row->{sysname} } @members);
+
$row->{build_flags} =~ s/^\{(.*)\}$/$1/;
$row->{build_flags} =~ s/,/ /g;
$row->{build_flags} =~ s/_PC\b//g;
$row->{build_flags} = lc($row->{build_flags});
+
if (defined($row->{log_text}))
{ # convert to a hash, find ranges, output list of ranges
my $h = { split /\s+/, $row->{log_text} };
{
if ($h->{$k} ne $h->{$start})
{
+ # The result (skiped, Passed, Failed) for this testcase number
+ # is different to the start one of the range. Reset the
+ # start and the count, for a new range.
push @ranges, sprintf("%s %s %s", $h->{$start}, $start, $i);
$start = $k;
$i = 1;
}
else
{
+ # bump the size of this range
$i++;
}
}
else
{
+ # First ever range for this row
$start = $k;
$i = 1;
}
}
if (defined $start)
{
+ # add text for the range to list of ranges
push @ranges, sprintf("%s %s %s", $h->{$start}, $start, $i);
}