WineHQ:winetest: use more info from the reports 2/2

Ferenc Wagner wferi at afavant.elte.hu
Wed Jan 5 16:28:18 CST 2005


ChangeLog: * Remove some unused structure.
           * Reformat table headers.
           * Link to the new informational files generated by dissect.

This patch is meant somewhat transitional.  The new version
of gather would generate broken links if applied to older
files, but shouldn't break anything.  I'm still looking for
a way to present visibility information on the main page,
but let's try this first.

Feri.

Index: winetest/gather
===================================================================
RCS file: /home/wine/tools/winetest/gather,v
retrieving revision 1.11
diff -u -r1.11 gather
--- winetest/gather	18 Jun 2004 16:02:00 -0000	1.11
+++ winetest/gather	5 Jan 2005 22:19:37 -0000
@@ -33,35 +33,22 @@
 
 # Group result containers.  Keys:
 # name: group name
+# id: directory name generated by dissect
 # extrema: hashes min and max error numbers to test names
 # digests: hashes report digests or "differ" to test names
 # tests: array of test hashes (name, tag, dir, results hash).
-my %w95  = (name => "Win95");
-my %w98  = (name => "Win98");
-my %me   = (name => "Me");
-my %nt3  = (name => "NT 3");
-my %nt4  = (name => "NT 4");
-my %w2k  = (name => "2000");
-my %xp   = (name => "XP");
-my %w2k3 = (name => "2003");
-
-# Map report directory names to Windwos versions and version groups
-my %ids = ("95"     => {name => "95",      group => \%w95},
-           "95sp1"  => {name => "SP1",     group => \%w95},
-           "95osr2" => {name => "OSR2",    group => \%w95},
-           "98"     => {name => "98",      group => \%w98},
-           "98sp1"  => {name => "SP1",     group => \%w98},
-           "98se"   => {name => "SE",      group => \%w98},
-           "me"     => {name => "Me",      group => \%me},
-           "nt3"    => {name => "NT 3.51", group => \%nt3},
-           "nt4"    => {name => "NT 4",    group => \%nt4},
-           "2000"   => {name => "2000",    group => \%w2k},
-           "xp"     => {name => "XP",      group => \%xp},
-           "2003"   => {name => "2003",    group => \%w2k3},
-          );
+my %w95  = (name => "Win95", id => "95");
+my %w98  = (name => "Win98", id => "98");
+my %me   = (name => "Me",    id => "me");
+my %nt3  = (name => "NT 3",  id => "nt3");
+my %nt4  = (name => "NT 4",  id => "nt4");
+my %w2k  = (name => "2000",  id => "2000");
+my %xp   = (name => "XP",    id => "xp");
+my %w2k3 = (name => "2003",  id => "2003");
+my %wine = (name => "Wine",  id => "wine");
 
 # Define the order of version groups in the summary
-my @groups = (\%w95, \%w98, \%me, \%nt3, \%nt4, \%w2k, \%xp, \%w2k3);
+my @groups = (\%w95, \%w98, \%me, \%nt3, \%nt4, \%w2k, \%xp, \%w2k3, \%wine);
 
 my ($outdated,undef) = glob "$datadir/*/outdated";
 exit 2 unless defined $outdated;
@@ -76,14 +63,14 @@
     (my $dir = $file) =~ s|^\Q$datadir/$build\E/(.*?)/summary.txt$|$1|;
     my $testref = {};
     (my $id, my @tag) = split /_/, $dir;
-    if (!exists $ids{$id}) {
+    my $group = undef;
+    foreach (@groups) { $group = $_ if $_->{id} eq $id; }
+    if (!defined $group) {
         print "Unknown architecture: $id in file $file\n";
         next;
     }
     $testref->{tag} = @tag?"@tag":"";
     $testref->{dir} = $dir;
-    $testref->{name} = $ids{$id}->{name}; # record origin
-    my $group = $ids{$id}->{group};
     if (!open TEST, "<$file") {
         print "can't open $file: $!\n";
         next;
@@ -135,9 +122,14 @@
     if (exists $_->{tests}) {
         my $testnum = @{$_->{tests}};
         if ($testnum > 1) {
-            $header .= "      <th><a href=\"#$_->{name}\">$_->{name} ($testnum)</a></th>\n";
+            $header .= "      <th><a href=\"#$_->{name}\">$_->{name}<br><small>$testnum reports</small></a></th>\n";
         } else {
-            $header .= "      <th><a href=\"$_->{tests}->[0]->{dir}/report\">$_->{name}</a></th>\n";
+            my $dir = $_->{tests}->[0]->{dir};
+            $header .= <<"EOF";
+    <th>$_->{name}<br>
+        <a href=\"$dir/version.txt\"><small>$_->{tests}->[0]->{tag}</small></a><br>
+        <a href=\"$dir/build.txt\">build</a> / <a href=\"$dir/report\">file</a></th>
+EOF
         }
     } else {
         $header .= "      <th>$_->{name}</th>\n";
@@ -200,7 +192,7 @@
 
 # Output a single cell of a test
 sub singletest {
-    my ($test, $testname) = @_;
+    my ($test, $testname, $groupname) = @_;
 
     if (!exists $test->{results}->{$testname}) {
         print OUT "      <td class=\"note\">.</td>\n";
@@ -218,7 +210,7 @@
       <td class="$class"><a
         href="$file"
         title="$count tests, $todo TODO, $error errors"
-        onMouseOver="refresh('$testname','$test->{name} $test->{tag}',$count,$todo,$error);"
+        onMouseOver="refresh('$testname','$groupname $test->{tag}',$count,$todo,$error);"
         >$error</a></td>
 EOF
         }
@@ -235,7 +227,7 @@
         if (!exists $group->{tests}) {
             print OUT "      <td class=\"note\">.</td>\n";
         } elsif (@{$group->{tests}} == 1) {
-            singletest ($group->{tests}->[0], $testname);
+            singletest ($group->{tests}->[0], $testname, $group->{name});
         } else {
             my $href = "href=\"#$group->{name}\"";
             if (exists $group->{extrema}->{$testname}) {
@@ -265,7 +257,12 @@
     next unless exists $group->{tests} && @{$group->{tests}} > 1;
 
     $header = "";
-    $header .= "      <th><a href=\"$_->{dir}/report\">$_->{name}<br><small>$_->{tag}</small></a>\n" foreach (@{$group->{tests}});
+    foreach (@{$group->{tests}}) {
+        $header .= <<"EOF";
+    <th><a href=\"$_->{dir}/version.txt\"><small>$_->{tag}</small></a><br>
+        <a href=\"$_->{dir}/build.txt\">build</a> / <a href=\"$_->{dir}/report\">file</a></th>
+EOF
+    }
     chop $header;
 
     print OUT <<"EOF";
@@ -294,7 +291,7 @@
       <td class="test">
         <a href="$alltests{$testname}">$testname</a></td>
 EOF
-        singletest ($_, $testname) foreach (@{$group->{tests}});
+        singletest ($_, $testname, $group->{name}) foreach (@{$group->{tests}});
     }
     print OUT <<"EOF";
   </tbody>



More information about the wine-patches mailing list