WineHQ:winetest: use more info from the reports (catch-all resend)

Ferenc Wagner wferi at afavant.elte.hu
Tue Jan 11 06:15:52 CST 2005


Hi Jer,

since you gave me some more time to chew on this, hereby I
revoke the previous two patches: don't commit them, this
patch below provides their functionality and more.  Old
reports processed by an unpatched dissect will lead to
broken links, but I don't think anybody would care.

ChangeLog: * Extract build info and OS version from the reports.
           * Link to them from the table headers.
           * Put reports from Wine into a separate column.
           * Color-code desktop visibility info.

Feri.

Index: winetest/dissect
===================================================================
RCS file: /home/wine/tools/winetest/dissect,v
retrieving revision 1.15
diff -u -r1.15 dissect
--- winetest/dissect	2 Sep 2004 19:02:58 -0000	1.15
+++ winetest/dissect	11 Jan 2005 12:00:36 -0000
@@ -87,12 +87,18 @@
 
 $_ = <IN>;
 /^Build info:\r?$/ or mydie "no Build info header: $_";
-while (($_ = <IN>) =~ /^    /) { }
+open BINFO, ">$tmpdir/build.txt" or mydie "can't write $tmpdir/build.txt: $!";
+while (($_ = <IN>) =~ s/^    //) { print BINFO; }
+close BINFO or mydie "error writing $tmpdir/build.txt: $!";
 
-my ($version, $major, $minor, $plid);
+my ($wine, $version, $major, $minor, $plid);
 /^Operating system version:\r?$/ or mydie "no OS header: $_";
+open OSVER, ">$tmpdir/version.txt" or mydie "can't write $tmpdir/version.txt: $!";
 while (($_ = <IN>) =~ /^\s*([a-zA-Z]+)=(.*?)\r?$/) {
-    if ($1 eq "dwMajorVersion") {
+    print OSVER "$1=$2\n";
+    if      ($1 eq "bRunningUnderWine") {
+        $wine = $2;
+    } elsif ($1 eq "dwMajorVersion") {
         $major = $2;
     } elsif ($1 eq "dwMinorVersion") {
         $minor = $2;
@@ -100,6 +106,8 @@
         $plid = $2;
     }
 }
+close OSVER or mydie "error writing $tmpdir/version.txt: $!";
+
 $version = "unknown";
 if ($plid==1 && $major==4) {
     if      ($minor==0) {
@@ -126,6 +134,10 @@
 } elsif ($plid==3) {
     $version = "ce$major$minor";
 }
+if ($wine) {
+    $tag = "_$version$tag";
+    $version = "wine";
+}
 
 /Test output:\r?/ or mydie "no test header: $_";
 my ($unit, $test, $source, $rev, $result);
@@ -163,7 +175,7 @@
     $result = "failed - -";
     goto FINISH;
 }
-close SUM;
+close SUM or mydie "error writing $tmpdir/summary.txt: $!";
 close IN;
 
 my $builddir = "$datadir/$testbuild";
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	11 Jan 2005 12:00:36 -0000
@@ -35,6 +35,7 @@
 # name: group name
 # extrema: hashes min and max error numbers to test names
 # digests: hashes report digests or "differ" to test names
+# visible: whether winetest ran on a visible desktop
 # tests: array of test hashes (name, tag, dir, results hash).
 my %w95  = (name => "Win95");
 my %w98  = (name => "Win98");
@@ -44,24 +45,14 @@
 my %w2k  = (name => "2000");
 my %xp   = (name => "XP");
 my %w2k3 = (name => "2003");
+my %wine = (name => "Wine");
 
-# 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},
-          );
+# Map dissect's IDs to the above hashes
+my %idmap = (95=>\%w95, 98=>\%w98, me=>\%me, nt3=>\%nt3, nt4=>\%nt4,
+             2000=>\%w2k, xp=>\%xp, 2003=>\%w2k3, wine=>\%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 +67,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 = $idmap{$id};
+    $tag[0] = $idmap{$tag[0]}->{name} if $id eq "wine";
+    if (!defined $group || !defined $tag[0]) {
         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;
@@ -125,6 +116,20 @@
         }
     }
     close TEST;
+
+    (my $verfile = $file) =~ s|summary.txt$|version.txt|;
+    if (!open VER, "<$verfile") {
+        print "can't open $verfile: $!\n";
+        next;
+    }
+    $testref->{visible} = 0;
+    while (<VER>) {
+        if (/^bRunningOnVisibleDesktop=(.*)$/ && $1 ne "0") {
+            $testref->{visible} = 1;
+            last;
+        }
+    }
+    close VER;
     push @{$group->{tests}}, $testref;
 }
 
@@ -135,9 +140,15 @@
     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 $test = $_->{tests}->[0];
+            $header .= <<"EOF";
+    <th>$_->{name}<br><small>
+        <a href=\"$test->{dir}/build.txt\">$test->{tag}</a><br>
+        <a href=\"$test->{dir}/version.txt\">[info]</a>
+        <a href=\"$test->{dir}/report\">[file]</a></small></th>
+EOF
         }
     } else {
         $header .= "      <th>$_->{name}</th>\n";
@@ -179,7 +190,8 @@
 <h3>Legend</h3>
 <p class="legend">All tests <span class="pass">pass</span> in all reports<br>
    Some tests <span class="mixed">fail</span> in some reports<br>
-   Some tests <span class="fail">fail</span> in all reports
+   Some tests <span class="fail">fail</span> in all reports<br>
+   This <span class="vis_fail">border</span> signals a test running on a visible desktop
 </p>
 <h1>Main summary for build <a href="$url">$build</a></h1>
 <table class="report">
@@ -200,10 +212,11 @@
 
 # Output a single cell of a test
 sub singletest {
-    my ($test, $testname) = @_;
+    my ($test, $testname, $groupname) = @_;
+    my $vis = $test->{visible}?"vis_":"";
 
     if (!exists $test->{results}->{$testname}) {
-        print OUT "      <td class=\"note\">.</td>\n";
+        print OUT "      <td class=\"${vis}note\">.</td>\n";
     } else {
         my $file = "$test->{dir}/$testname.txt";
         my ($count, $todo, $error) = @{$test->{results}->{$testname}};
@@ -211,15 +224,15 @@
             my $msg = $todo eq "-"?"crash":
                       $todo == 258?"timeout":"failed";
             my $fail = -r "$datadir/$build/$file"?"<a href=\"$file\">$msg</a>":$msg;
-            print OUT "      <td class=\"note\">$fail</td>\n";
+            print OUT "      <td class=\"${vis}note\">$fail</td>\n";
         } else {
             my $class = $error?"fail":"pass";
             print OUT <<"EOF";
-      <td class="$class"><a
+      <td class="$vis$class"><a
         href="$file"
         title="$count tests, $todo TODO, $error errors"
-        onMouseOver="refresh('$testname','$test->{name} $test->{tag}',$count,$todo,$error);"
-        >$error</a></td>
+        onMouseOver="refresh('$testname','$groupname $test->{tag}',$count,$todo,$error);"
+        ><div>$error</div></a></td>
 EOF
         }
     }
@@ -235,7 +248,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}) {
@@ -246,7 +259,7 @@
                 print OUT <<"EOF";
       <td class="$class"><a $href$title
         onMouseOver="refresh('$testname','$group->{name}','-','-','$errors');"
-        >$max</a></td>
+        ><div>$max</div></a></td>
 EOF
             } else {
                 print OUT "      <td class=\"note\"><a $href>.</a></td>\n";
@@ -265,7 +278,13 @@
     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><small><a href=\"$_->{dir}/build.txt\">$_->{tag}</a><br>
+        <a href=\"$_->{dir}/version.txt\">[info]</a>
+        <a href=\"$_->{dir}/report\">[file]</a></small></th>
+EOF
+    }
     chop $header;
 
     print OUT <<"EOF";
@@ -294,7 +313,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>
Index: winetest/summary.css
===================================================================
RCS file: /home/wine/tools/winetest/summary.css,v
retrieving revision 1.4
diff -u -r1.4 summary.css
--- winetest/summary.css	23 Apr 2004 14:49:24 -0000	1.4
+++ winetest/summary.css	11 Jan 2005 12:00:36 -0000
@@ -8,16 +8,44 @@
         text-align: center;
 }
 .pass {
-	background-color: #60ff60;
+        background-color: #60ff60;
+        border-right-style: solid;
+        border-left-style: solid;
+        border-width: thick;
+        border-color: #60ff60;
 }
 .mixed {
-	background-color: #ffff40;
+        background-color: #ffff40;
+        border-right-style: solid;
+        border-left-style: solid;
+        border-width: thick;
+        border-color: #ffff40;
 }
 .fail {
-	background-color: #ff5050;
+        background-color: #ff5050;
+        border-right-style: solid;
+        border-left-style: solid;
+        border-width: thick;
+        border-color: #ff5050;
+}
+.vis_pass {
+        background-color: #60ff60;
+        border-right-style: solid;
+        border-left-style: solid;
+        border-width: thick;
+        border-left-color: #60ff60;
+        border-right-color: #0070ff;
+}
+.vis_fail {
+        background-color: #ff5050;
+        border-right-style: solid;
+        border-left-style: solid;
+        border-width: thick;
+        border-left-color: #ff5050;
+        border-right-color: #0070ff;
 }
 td {
-	text-align: center;
+        text-align: center;
 }
 
 table.report {
@@ -34,30 +62,29 @@
         vertical-align: middle;
 }
 table.report thead th {
-	border-bottom-style: solid;
+        border-bottom-style: solid;
 }
 table.report tfoot th {
-	border-top-style: solid;
+        border-top-style: solid;
 }
 table.report td :link {
         color: black;
 }
+table.report td.vis_note {
+        border-right-style: solid;
+        border-left-style: solid;
+        border-width: thick;
+        border-left-color: #ffffff;
+        border-right-color: #0070ff;
+}
 table.report td.note :link, table.report td.note :visited {
         text-decoration: underline;
 }
-table.report td a {
-        padding-left: 1em;
-        padding-right: 1em;
-}
-table.report td.test a {
-        padding-left: 0;
-        padding-right: 0;
-}
 table.report td.test :link {
-	color: blue;
+        color: blue;
 }
 table.report td.test {
-	text-align: left;
+        text-align: left;
 }
 form td {
         text-align: left;



More information about the wine-patches mailing list