Try again to handle multifold builds without losing singlefold build status.

This commit is contained in:
David Brown 2016-07-14 20:14:23 +01:00
parent a42d4c4a03
commit 73ff9f50a2

View file

@ -60,37 +60,47 @@ while ((my $pid = wait) > 0) {print "Child pid $pid completed.\n";}
my %status = (); my %status = ();
my $fn;
my $date;
my $time;
my $branch;
my $os;
my $compiler;
my $datamodel;
my $compilerok;
my $libraryok;
my $sourcechange;
my $tests;
my $key;
my $ver;
sub clearvars {
$time = ""; $branch = ""; $os = ""; $compiler = "";
$datamodel = ""; $compilerok = ""; $libraryok = ""; $sourcechange = "";
$tests = ""; $key = ""; $ver = "";
}
sub logstatus { sub logstatus {
my ($fn, $date, $time, $os, $compiler, $datamodel, $branch, $compilerok, $libraryok, $sourcechange, $tests) = @_; my ($fn) = @_;
if ($compiler ne "") { if ($compiler ne "") {
$status{$os-$compiler-$datamodel} = $status{"$os-$compiler-$datamodel"} =
[$fn, $date, $time, $os, $compiler, $datamodel, $branch, $compilerok, $libraryok, $sourcechange, $tests]; [$fn, $date, $time, $os, $compiler, $datamodel, $branch, $compilerok, $libraryok, $sourcechange, $tests];
} }
clearvars();
} }
sub parselog { sub parselog {
my ($fn) = @_; ($fn) = @_;
#print "Parsing log $fn\n"; clearvars();
my $date = "";
my $time = "";
my $branch = "";
my $os = "";
my $compiler = "";
my $datamodel = "";
my $compilerok = "";
my $libraryok = "";
my $sourcechange = "";
my $tests = "";
my $key = "";
my $ver = "";
open(my $log, $fn) // die "Couldn't open build log $fn."; open(my $log, $fn) // die "Couldn't open build log $fn.";
while (<$log>) { while (<$log>) {
if (/^([0-9\/]+) ([0-9.]+) .+\.log$/) {$date = $1} if (/^([0-9\/]+) ([0-9.]+) .+\.log$/) {$date = $1}
if (/^([0-9.]+) /) {$time = $1} if (/^([0-9.]+) /) {$time = $1}
# 19.39.58 Configuration: 1.95 [2016/07/14] for gcc LP64 on centos
if (/^[^ ]+ Configuration: ([0-9a-zA-Z.]+) \[[0-9\/]+\] for (.+) *$/) { if (/^[^ ]+ Configuration: ([0-9a-zA-Z.]+) \[[0-9\/]+\] for (.+) *$/) {
logstatus($fn, $date, $time, $os, $compiler, $datamodel, $branch, $compilerok, $libraryok, $sourcechange, $tests); logstatus($fn);
$ver = $1; $ver = $1;
printf "--- Config for $fn: $1 for $2.\n";
} }
if (/^[^ ]+ --- Cleaning branch ([^ ]+) ([^ ]+) ([^ ]+) ([^ ]+) ---$/) { if (/^[^ ]+ --- Cleaning branch ([^ ]+) ([^ ]+) ([^ ]+) ([^ ]+) ---$/) {
($branch, $os, $compiler, $datamodel) = ($1, $2, $3, $4, $5); ($branch, $os, $compiler, $datamodel) = ($1, $2, $3, $4, $5);
@ -105,7 +115,7 @@ sub parselog {
if (/^([0-9.]+) --- Confidence tests passed ---$/) {$tests = "Passed";} if (/^([0-9.]+) --- Confidence tests passed ---$/) {$tests = "Passed";}
} }
close($log); close($log);
logstatus($fn, $date, $time, $os, $compiler, $datamodel, $branch, $compilerok, $libraryok, $sourcechange, $tests); logstatus($fn);
} }
opendir DIR, "log" // die "Could not open log directory."; opendir DIR, "log" // die "Could not open log directory.";
@ -134,7 +144,7 @@ sub svgtext {
my $rows = keys %status; my $rows = keys %status;
my $width = 620; my $width = 630;
my $height = ($rows+2.2) * $lineheight; my $height = ($rows+2.2) * $lineheight;
open(my $svg, ">build-status.svg") // die "Could not create build-status.svg."; open(my $svg, ">build-status.svg") // die "Could not create build-status.svg.";
@ -150,11 +160,11 @@ my $col2 = 97;
my $col3 = 160; my $col3 = 160;
my $col4 = 220; my $col4 = 220;
my $col5 = 280; my $col5 = 280;
my $col6 = 320; my $col6 = 330;
my $col7 = 370; my $col7 = 380;
my $col8 = 430; my $col8 = 440;
my $col9 = 480; my $col9 = 490;
my $col10 = 560; my $col10 = 570;
svgtext($svg, $col1, 0, "#e0e0e0", "Date"); svgtext($svg, $col1, 0, "#e0e0e0", "Date");
svgtext($svg, $col3, 0, "#e0e0e0", "Branch"); svgtext($svg, $col3, 0, "#e0e0e0", "Branch");