User: knarf Date: 2011/03/30 09:13 AM
Modified: /release-info/ parse_testsuite_results.cgi
Log: fix table headers
File Changes:
Directory: /release-info/ =========================
File [modified]: parse_testsuite_results.cgi Delta lines: +11 -10 =================================================================== --- release-info/parse_testsuite_results.cgi 2011-03-30 13:46:37 UTC (rev 469) +++ release-info/parse_testsuite_results.cgi 2011-03-30 14:13:34 UTC (rev 470) @@ -9,12 +9,7 @@ # get list of log files my @filenames = (); opendir(DIR, ".") || die "cannot open dir: $!"; -foreach (sort readdir(DIR)) { - next if (-d); - if (/^[^.].*__\d+_\d+.log$/) { - push(@filenames, $_); - } -} +@filenames = grep { /^[^.].*__\d+_\d+.log$/ && -f "$_" } sort readdir(DIR); closedir DIR;
my %results = (); @@ -115,7 +110,10 @@ # general table heading my $table_entries = "<tr><th rowspan='2'>Thorn</th><th rowspan='2'>Test</th>"; foreach my $host (sort(keys(%allhosts))) { - $table_entries .= "<th colspan='".scalar(keys(%{$allhosts{$host}}))."'>$host</th>"; + my $ncols = 0; + foreach my $nprocs (sort(keys(%{$allhosts{$host}}))) { + foreach my $nthreads (sort(keys(%{$allhosts{$host}{$nprocs}}))) { $ncols++; } } + $table_entries .= "<th colspan='$ncols'>$host</th>"; } # host table headings $table_entries .= "</tr>\n<tr>"; @@ -124,7 +122,7 @@ foreach my $nthreads (sort(keys(%{$allhosts{$host}{$nprocs}}))) { my $color = " style="background-color:#d0d0d0;""; if ($nprocs != "1") { $color = " style="background-color:#e0e0e0;""; } - $table_entries .= "<th$color>$nprocs $nthreads</th>"; + $table_entries .= "<th$color>$nprocs;$nthreads</th>"; } } } @@ -178,7 +176,10 @@ # Things for the top of the table my $table_entries_h .= "<tr><th rowspan='4' colspan='2'>Totals</th>"; foreach my $host (sort(keys(%allhosts))) { - $table_entries_h .= "<th colspan='".scalar(keys(%{$allhosts{$host}}))."'>$host</th>"; + my $ncols = 0; + foreach my $nprocs (sort(keys(%{$allhosts{$host}}))) { + foreach my $nthreads (sort(keys(%{$allhosts{$host}{$nprocs}}))) { $ncols++; } } + $table_entries_h .= "<th colspan='$ncols'>$host</th>"; } $table_entries_h .= "</tr>\n<tr>"; foreach my $host (sort(keys(%allhosts))) { @@ -186,7 +187,7 @@ foreach my $nthreads (sort(keys(%{$allhosts{$host}{$nprocs}}))) { my $color = " style="background-color:#d0d0d0;""; if ($nprocs != "1") { $color = " style="background-color:#e0e0e0;""; } - $table_entries_h .= "<th$color>$nprocs $nthreads</th>"; + $table_entries_h .= "<th$color>$nprocs;$nthreads</th>"; } } }