2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-15 13:02:11 +00:00

Script and HTML to generate build log summary.

[SVN r21024]
This commit is contained in:
Rene Rivera
2003-12-01 00:56:28 +00:00
parent 4e9ebe6d49
commit 70aed83e65
2 changed files with 108 additions and 0 deletions

32
build-logs-index.shtml Normal file
View File

@@ -0,0 +1,32 @@
<!--
Copyright Rene Rivera 2003.
This is the page wrapper for the summary table of buld logs.
This calls the script "build-logs.pl" to generate the summary
table. This file should be place at:
http://boost.sourceforge.net/build-logs/index.shtml
Which is at this location in the shell SourceForge services:
/home/groups/b/bo/boost/htdocs/build-logs/index.shtml
The build-logs.pl script handles individual placement
of the calling shtml file, so this file can be placed anywhere
one wants a build summary page, and has build log files
in it.
-->
<html>
<head>
<title>Boost Build Logs</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<table border="0">
<tr>
<td><img border="0" src="/c++boost.gif" width="277" height="86"></td>
<td>
<h1>Boost Build Logs</h1>
</td>
</table>
<!--#exec cmd="/usr/bin/perl /home/groups/b/bo/boost/cgi-bin/build-logs.pl" -->
</body>
</html>

76
build-logs.pl Normal file
View File

@@ -0,0 +1,76 @@
#!/usr/bin/perl
#~ Copyright 2003, Rene Rivera.
#~ Use, modification and distribution are subject to the Boost Software
#~ License Version 1.0. (See accompanying file LICENSE_1_0.txt or
#~ http://www.boost.org/LICENSE_1_0.txt)
use FileHandle;
use Time::Local;
my $logdir = "$ENV{PWD}";
#~ my $logdir = "C:\\CVSROOTs\\Boost\\boost";
#~ open STDOUT,">C:\\CVSROOTs\\Boost\\boost\\build-logs.html";
opendir LOGS, "$logdir";
my @logs = grep /build-.*log$/, readdir LOGS;
closedir LOGS;
my @bgcolor = ( "bgcolor=\"#EEEEFF\"", "" );
print "<table>\n";
print "<tr>\n",
"<th align=\"left\" bgcolor=\"#DDDDDD\">Build</th>\n",
"<th align=\"left\" bgcolor=\"#DDDDDD\">Library</th>\n",
"<th align=\"left\" bgcolor=\"#DDDDDD\">Warnings</th>\n",
"<th align=\"left\" bgcolor=\"#DDDDDD\">Failures</th>\n",
"</tr>\n";
foreach $l (sort { lc($a) cmp lc($b) } @logs)
{
my $log = $l;
my $fh = new FileHandle;
if ($fh->open("<$logdir/$log"))
{
my $content = join('',$fh->getlines());
$fh->close;
print
"<tr>\n",
" <td valign=\"top\"><a href=\"",$log,"\">",$log,"</a></td>\n";
my %failures;
my %warnings;
my $action_regex = "\\n[\\w\\+\\-]+\\s(?:bin|stage)";
my @actions = ($content =~ /($action_regex(?:.(?!$action_regex))*.)/gis);
my $action_target;
foreach my $a (@actions)
{
my ($at) = ($a =~ /$action_regex.boost.libs.([^\\\/]*.[^\\\/]*.[^\\\/]*)/gi);
my ($action) = ($a =~/\n([\w\+\-]+)/);
if ($at) { $action_target = $at; }
my ($lib) = ($action_target =~ /([^\\\/]*)/i);
$failures{$lib} += 0;
$warnings{$lib} += 0;
my ($f) = ($a =~ /\n\.\.\.failed\s([^\s]+)/is);
if ($f && $f eq "$action") { $failures{$lib} += 1; }
$warnings{$lib} += scalar ($a =~ /(warning(?:\s#\d+)?\:)/gis);
}
my @libs = sort(keys %failures);
foreach my $l (0..scalar(@libs)-1)
{
print
" <td ",$bgcolor[$l %2],">",$libs[$l],"</td>\n",
" <td ",$bgcolor[$l %2],">";
if ($warnings{$libs[$l]} > 0) { print $warnings{$libs[$l]}; }
print "</td>\n",
" <td ",$bgcolor[$l %2],"><strong><font color=\"#FF0000\">";
if ($failures{$libs[$l]} > 0) { print $failures{$libs[$l]}; }
else { print "&nbsp;"; }
print "</font></strong></td>\n",
"</tr>\n";
if ($l < scalar(@libs))
{
print
"<tr>\n",
" <td></td>\n";
}
}
print "<tr><td colspan=\"4\"><hr></td></tr>\n";
}
}
print "</table>\n";