Link to build status that can access logs, add date, time and branch to status.

This commit is contained in:
David Brown 2016-07-10 14:21:49 +01:00
parent 5c8b98dd05
commit 2c2fa4963c
3 changed files with 205 additions and 47 deletions

View file

@ -75,7 +75,7 @@ sub parselog {
my $tests = "";
open(my $log, $fn) // die "Couldn't open build log $fn.";
while (<$log>) {
if (/^([0-9\/]+) [0-9.]+ [^ ]+\.log$/) {$date = $1;}
if (/^([0-9\/]+) [0-9.]+ [^ ]+\.log$/) {$date = $1; $time = $2}
if (/^[^ ]+ --- Cleaning branch ([^ ]+) ([^ ]+) ([^ ]+) ([^ ]+) ---$/) {
($branch, $os, $compiler, $datamodel) = ($1, $2, $3, $4, $5);
}
@ -121,8 +121,8 @@ sub svgtext {
my $rows = keys %status;
my $width = 680;
my $height = ($rows+2) * $lineheight;
my $width = 1080;
my $height = ($rows+2.2) * $lineheight;
open(my $svg, ">build-status.svg") // die "Could not create build-status.svg.";
print $svg '<svg width="680" height="', $height, '"';
@ -132,34 +132,43 @@ print $svg '<rect x="3" y="3" width="', $width-6, '" height="', $height-6, '"';
print $svg ' rx="20" ry="20" fill="#404040"';
print $svg ' stroke="#20c020" stroke-width="4"/>', "\n";
my $col1 = 20;
my $col2 = 110;
my $col3 = 200;
my $col4 = 310;
my $col5 = 400;
my $col6 = 475;
my $col7 = 580;
my $col1 = 20;
my $col2 = 120;
my $col3 = 220;
my $col4 = 320;
my $col5 = 420;
my $col6 = 520;
my $col7 = 620;
my $col8 = 720;
my $col9 = 820;
my $col10 = 920;
svgtext($svg, $col1, 0, "#e0e0e0", "OS");
svgtext($svg, $col2, 0, "#e0e0e0", "Compiler");
svgtext($svg, $col3, 0, "#e0e0e0", "Data model");
svgtext($svg, $col4, 0, "#e0e0e0", "Compiler");
svgtext($svg, $col5, 0, "#e0e0e0", "Library");
svgtext($svg, $col6, 0, "#e0e0e0", "C Source");
svgtext($svg, $col7, 0, "#e0e0e0", "Tests");
svgtext($svg, $col1, 0, "#e0e0e0", "Date");
svgtext($svg, $col2, 0, "#e0e0e0", "Time");
svgtext($svg, $col3, 0, "#e0e0e0", "Branch");
svgtext($svg, $col4, 0, "#e0e0e0", "OS");
svgtext($svg, $col5, 0, "#e0e0e0", "Compiler");
svgtext($svg, $col6, 0, "#e0e0e0", "Data model");
svgtext($svg, $col7, 0, "#e0e0e0", "Compiler");
svgtext($svg, $col8, 0, "#e0e0e0", "Library");
svgtext($svg, $col9, 0, "#e0e0e0", "C Source");
svgtext($svg, $col10, 0, "#e0e0e0", "Tests");
my $i=1;
for my $key (sort keys %status) {
my ($fn, $date, $time, $os, $compiler, $datamodel, $branch,
$compilerok, $libraryok, $sourcechange, $tests) = @{$status{$key}};
print $svg '<a xlink:href="', $fn, '">';
svgtext($svg, $col1, $i, "#c0c0c0", $os);
svgtext($svg, $col2, $i, "#c0c0c0", $compiler);
svgtext($svg, $col3, $i, "#c0c0c0", $datamodel);
svgtext($svg, $col4, $i, "#60ff60", $compilerok);
svgtext($svg, $col5, $i, "#60ff60", $libraryok);
svgtext($svg, $col6, $i, "#60ff60", $sourcechange);
svgtext($svg, $col7, $i, "#60ff60", $tests);
svgtext($svg, $col1, $i, "#c0c0c0", $date);
svgtext($svg, $col2, $i, "#c0c0c0", $time);
svgtext($svg, $col3, $i, "#c0c0c0", $branch);
svgtext($svg, $col4, $i, "#c0c0c0", $os);
svgtext($svg, $col5, $i, "#c0c0c0", $compiler);
svgtext($svg, $col6, $i, "#c0c0c0", $datamodel);
svgtext($svg, $col7, $i, "#60ff60", $compilerok);
svgtext($svg, $col8, $i, "#60ff60", $libraryok);
svgtext($svg, $col9, $i, "#60ff60", $sourcechange);
svgtext($svg, $col10, $i, "#60ff60", $tests);
print $svg '</a>';
$i++;
}

View file

@ -1,23 +0,0 @@
# Checksum tests
#
# Checksums object binaries (*.o) and compares with previous
# checksum for this branch.
#
# Note: OPC.o and OPM.o are omitted as they both have text string constants
# that include the build date.
md5=md5
if which md5sum >/dev/null 2>&1; then md5=md5sum; fi
if [ -f $1 ]
then
$md5 *.o | egrep -v "OP[CM]\\.o" >newsums
if diff -b $1 newsums
then printf "\n--- Object file checksums match ---\n"
else printf "\n--- Object file checksum mismatch ---\n"
fi
rm newsums
else
$md5 *.o | egrep -v "OP[CM]\\.o" >$1
printf "\n--- Object files checksummed ---\n"
fi