[Tools v2 1/2] winetest: Refresh errors.html separately from the main index.

Francois Gouget fgouget at codeweavers.com
Wed May 17 04:27:01 CDT 2017


The two operations are quite independent.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
 winetest/build-errors  | 87 ++++++++++++++++++++++++++++++++++++++++++++++++++
 winetest/build-index   | 41 ------------------------
 winetest/winetest.cron |  1 +
 3 files changed, 88 insertions(+), 41 deletions(-)
 create mode 100755 winetest/build-errors

diff --git a/winetest/build-errors b/winetest/build-errors
new file mode 100755
index 00000000..a719fb50
--- /dev/null
+++ b/winetest/build-errors
@@ -0,0 +1,87 @@
+#!/usr/bin/perl
+#
+# Copyright 2008 Alexandre Julliard <julliard at winehq.org>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+# This program creates the global index of rejected reports.
+
+use strict;
+use warnings;
+use open ':utf8';
+use CGI qw(:standard);
+
+sub BEGIN
+{
+    if ($0 !~ m=^/=)
+    {
+        # Turn $0 into an absolute path so it can safely be used in @INC
+        require Cwd;
+        $0 = Cwd::cwd() . "/$0";
+    }
+    unshift @INC, $1 if ($0 =~ m=^(/.*)/[^/]+$=);
+}
+use vars qw/$workdir/;
+require "winetest.conf";
+
+
+use POSIX qw(locale_h strftime);
+setlocale(LC_ALL, "C");
+
+sub long_date($)
+{
+    my ($date) = @_;
+    return strftime("%b %d %H:%M:%S", gmtime($date));
+}
+
+
+# generate a table of the errors encountered during processing
+
+chdir($workdir) or die "could not chdir to the work directory: $!";
+
+my @errors;
+
+opendir DIR, "queue" or die "cannot open 'queue'";
+foreach my $dir (readdir DIR)
+{
+    next unless $dir =~ /^err.....$/;
+    open ERR, "queue/$dir/error" or next;
+    my $msg = <ERR>;
+    chomp $msg;
+    my $date = (stat ERR)[9];
+    close ERR;
+    push @errors, { msg => $msg, date => $date, url => "../queue/$dir/report" };
+}
+closedir DIR;
+
+open OUT, ">data/errors.html.new" or die "cannot create 'data/errors.html.new'";
+
+print OUT start_html( -title => "Errors caught during Wine test report processing",
+                      -style => {src => "/summary.css"},
+                      -encoding => "utf-8" );
+print OUT "<div class=\"main\"><h2>Errors caught during Wine test report processing</h2>\n";
+print OUT "<table class=\"report\"><thead><tr><th class=\"date\">Date</th><th class=\"commitlink\">Error</th></thread>\n";
+
+foreach my $err (sort { $b->{date} <=> $a->{date}; } @errors)
+{
+    printf OUT "<tr><td class=\"date\">%s</td>\n", long_date($err->{date});
+    printf OUT "<td class=\"commitlink\"><a href=\"%s\">%s</a></td></tr>\n", $err->{url}, escapeHTML($err->{msg});
+}
+print OUT "</table>", end_html();
+close OUT;
+
+rename "data/errors.html.new", "data/errors.html" or unlink "data/errors.html.new";
+
+exit 0;
diff --git a/winetest/build-index b/winetest/build-index
index d30fbbb3..d301f98d 100755
--- a/winetest/build-index
+++ b/winetest/build-index
@@ -69,12 +69,6 @@ sub short_date($)
     return strftime("%b %d", gmtime($date));
 }
 
-sub long_date($)
-{
-    my ($date) = @_;
-    return strftime("%b %d %H:%M:%S", gmtime($date));
-}
-
 
 my %w95     = (name => "Win95");
 my %w98     = (name => "Win98");
@@ -335,39 +329,4 @@ close OUT;
 
 rename "data/index.html.new", "data/index.html" or unlink "data/index.html.new";
 
-# generate a table of the errors encountered during processing
-
-my @errors;
-
-opendir DIR, "queue" or die "cannot open 'queue'";
-foreach my $dir (readdir DIR)
-{
-    next unless $dir =~ /^err.....$/;
-    open ERR, "queue/$dir/error" or next;
-    my $msg = <ERR>;
-    chomp $msg;
-    my $date = (stat ERR)[9];
-    close ERR;
-    push @errors, { msg => $msg, date => $date, url => "../queue/$dir/report" };
-}
-closedir DIR;
-
-open OUT, ">data/errors.html.new" or die "cannot create 'data/errors.html.new'";
-
-print OUT start_html( -title => "Errors caught during Wine test report processing",
-                      -style => {src => "/summary.css"},
-                      -encoding => "utf-8" );
-print OUT "<div class=\"main\"><h2>Errors caught during Wine test report processing</h2>\n";
-print OUT "<table class=\"report\"><thead><tr><th class=\"date\">Date</th><th class=\"commitlink\">Error</th></thread>\n";
-
-foreach my $err (sort { $b->{date} <=> $a->{date}; } @errors)
-{
-    printf OUT "<tr><td class=\"date\">%s</td>\n", long_date($err->{date});
-    printf OUT "<td class=\"commitlink\"><a href=\"%s\">%s</a></td></tr>\n", $err->{url}, escapeHTML($err->{msg});
-}
-print OUT "</table>", end_html();
-close OUT;
-
-rename "data/errors.html.new", "data/errors.html" or unlink "data/errors.html.new";
-
 exit 0;
diff --git a/winetest/winetest.cron b/winetest/winetest.cron
index 4fbd5a24..45581e2f 100755
--- a/winetest/winetest.cron
+++ b/winetest/winetest.cron
@@ -46,6 +46,7 @@ if [ ! -f $lock ]; then
     then
         mkdir -p data/tests old-data
         $tools/build-index
+        $tools/build-errors
     fi
 
     # archive old results
-- 
2.11.0




More information about the wine-patches mailing list