[Tools 7/7] winetest: Add some heuristics to detect missing dlls in version 3 reports.

Francois Gouget fgouget at free.fr
Fri Mar 14 14:11:04 CDT 2008


---

This will get us the expected "n/a" status for missing dlls in reports 
from before 2007/03/05. However there's no point regenerating these just 
yet as more improvements will follow soon.


 winetest/dissect |   28 ++++++++++++++++++++++++----
 winetest/gather  |   10 ++++++++--
 2 files changed, 32 insertions(+), 6 deletions(-)

diff --git a/winetest/dissect b/winetest/dissect
index 82a6912..61024cd 100755
--- a/winetest/dissect
+++ b/winetest/dissect
@@ -153,13 +153,17 @@ if ($wine) {
 }
 
 # Dll information is only available in new type reports
+my %dllinfo;
+chomp;
 if (/^Dll info:\r?$/) {
-    open DLLINFO, ">$tmpdir/dllinfo.txt" or mydie "unable to open '$tmpdir/dllinfo.txt' for writing: $!\n";
-    while (($_ = <IN>) =~ s/^    //) { print DLLINFO; }
-    close DLLINFO or mydie "error writing to '$tmpdir/dllinfo.txt': $!\n";
+    while ($_ = <IN>) {
+        chomp;
+        last if (!/^\s+([^ =]+)=(.*)\r?$/);
+        $dllinfo{$1}=$2;
+    }
 }
 
-/Test output:\r?/ or mydie "no test header: $_";
+/^Test output:/ or mydie "no test header: $_";
 my ($dll, $unit, $source, $rev, $result);
 my ($lines,$total, $todo, $failed, $skipped);
 $dll = undef;                   # state machine starts
@@ -187,6 +191,14 @@ while (<IN>) {
         $todo += $3;
         $failed += $4;
         print OUT;
+    } elsif (/^.*$unit.*: Tests skipped: (?:$dll(?:\.dll)? cannot be loaded|$dll(?:\.dll)? not found|Could not load $dll(?:\.dll)?)\r?$/) {
+        # We find these lines in report version 3 files
+        $dllinfo{$dll}="dll is missing";
+        print OUT;
+    } elsif (/^.*$unit.*:Could not load $dll/) {
+        # We find these lines in report version 3 files
+        $dllinfo{$dll}="dll is missing";
+        print OUT;
     } elsif (/$dll:$unit done \((-?\d+)\)\r?$/) {
         chomp;                  # current test ended
         if ($lines==0) {
@@ -223,6 +235,14 @@ if (defined $dll) {
 close SUM or mydie "error writing to '$tmpdir/summary.txt': $!\n";
 close IN;
 
+if (%dllinfo) {
+    open DLLINFO, ">$tmpdir/dllinfo.txt" or mydie "unable to open '$tmpdir/dllinfo.txt' for writing: $!\n";
+    foreach my $dll (sort keys %dllinfo) {
+        print DLLINFO "$dll=$dllinfo{$dll}\n";
+    }
+    close DLLINFO or mydie "error writing to '$tmpdir/dllinfo.txt': $!\n";
+}
+
 my $builddir = "$datadir/$testbuild";
 foreach ($datadir, $builddir) {
     if (!(-d $_ || mkdir $_)) {
diff --git a/winetest/gather b/winetest/gather
index a84e5be..8208e19 100755
--- a/winetest/gather
+++ b/winetest/gather
@@ -139,7 +139,12 @@ foreach my $file (glob "$datadir/$build/*/summary.txt") {
             $report->{dllmissing}->{$dll} = 1;
             next;
         }
-        $report->{results}->{$testname} = [$count, $todo, $error, $skipped];
+        if ($count eq "0" and exists $report->{dllmissing}->{$dll}) {
+            # Mark this test as missing because of a missing dll
+            $report->{results}->{$testname} = ["dll missing", "-", "-", "-"];
+        } else {
+            $report->{results}->{$testname} = [$count, $todo, $error, $skipped];
+        }
         $alltests{$testname} = "http://cvs.winehq.org/cvsweb/wine/$source" . ($rev ne "-"?"#rev$rev":"")
             unless exists $alltests{$testname};
         if ($count ne "failed") {
@@ -309,8 +314,9 @@ sub singletest($$$) {
     } elsif ($count eq "dll missing") {
         my ($dll, $unit) = split(/:/, $testname);
         $dll.=".dll" if ($dll !~ /\./);
+        my $href=(-r "$datadir/$build/$file") ? "href=\"$file\"" : "";
         print OUT <<"EOF";
-      <td class="skip_pass"><a
+      <td class="skip_pass"><a $href
         title="No tests run as $dll is not present on this system"
         >n/a</a></td>
 EOF
-- 
1.5.4.1



More information about the wine-patches mailing list