blob: 0dbacda4a7d6cdab0ca2a36c3f780fab1d45ca90 [file] [log] [blame]
Patrick Jenkinsfe030d72006-07-06 21:19:32 +00001#!/usr/bin/perl
Patrick Jenkinsfe030d72006-07-06 21:19:32 +00002use POSIX qw(strftime);
3use File::Copy;
4use Socket;
5
6#
7# Program: NewNightlyTest.pl
8#
9# Synopsis: Perform a series of tests which are designed to be run nightly.
10# This is used to keep track of the status of the LLVM tree, tracking
11# regressions and performance changes. Submits this information
Reid Spencerfa34d7b2006-08-13 09:53:02 +000012# to llvm.org where it is placed into the nightlytestresults database.
Patrick Jenkinsfe030d72006-07-06 21:19:32 +000013#
14# Modified heavily by Patrick Jenkins, July 2006
15#
16# Syntax: NightlyTest.pl [OPTIONS] [CVSROOT BUILDDIR WEBDIR]
17# where
18# OPTIONS may include one or more of the following:
19# -nocheckout Do not create, checkout, update, or configure
20# the source tree.
21# -noremove Do not remove the BUILDDIR after it has been built.
Patrick Jenkinsa5c04d62006-07-07 17:31:38 +000022# -noremoveresults Do not remove the WEBDIR after it has been built.
Patrick Jenkinsfe030d72006-07-06 21:19:32 +000023# -nobuild Do not build llvm. If tests are enabled perform them
24# on the llvm build specified in the build directory
25# -notest Do not even attempt to run the test programs. Implies
26# -norunningtests.
27# -norunningtests Do not run the Olden benchmark suite with
28# LARGE_PROBLEM_SIZE enabled.
Patrick Jenkinsfe030d72006-07-06 21:19:32 +000029# -nodejagnu Do not run feature or regression tests
30# -parallel Run two parallel jobs with GNU Make.
31# -release Build an LLVM Release version
Jim Laskey27b8ba02006-09-28 17:49:20 +000032# -release-asserts Build an LLVM ReleaseAsserts version
Patrick Jenkinsfe030d72006-07-06 21:19:32 +000033# -enable-llcbeta Enable testing of beta features in llc.
Reid Spencer2bae1f52006-11-24 20:34:16 +000034# -enable-lli Enable testing of lli (interpreter) features, default is off
Patrick Jenkinsfe030d72006-07-06 21:19:32 +000035# -disable-llc Disable LLC tests in the nightly tester.
36# -disable-jit Disable JIT tests in the nightly tester.
37# -disable-cbe Disable C backend tests in the nightly tester.
Evan Chenge04c90b2008-01-12 04:27:18 +000038# -disable-lto Disable link time optimization.
Patrick Jenkinsfe030d72006-07-06 21:19:32 +000039# -verbose Turn on some debug output
40# -debug Print information useful only to maintainers of this script.
41# -nice Checkout/Configure/Build with "nice" to reduce impact
42# on busy servers.
43# -f2c Next argument specifies path to F2C utility
44# -nickname The next argument specifieds the nickname this script
45# will submit to the nightlytest results repository.
46# -gccpath Path to gcc/g++ used to build LLVM
47# -cvstag Check out a specific CVS tag to build LLVM (useful for
48# testing release branches)
Reid Spencerece1f682007-07-02 06:19:57 +000049# -usecvs Check code out from the (old) CVS Repository instead of from
50# the standard Subversion repository.
Patrick Jenkinsfe030d72006-07-06 21:19:32 +000051# -target Specify the target triplet
52# -cflags Next argument specifies that C compilation options that
53# override the default.
54# -cxxflags Next argument specifies that C++ compilation options that
55# override the default.
56# -ldflags Next argument specifies that linker options that override
57# the default.
Patrick Jenkins215b48f2006-07-07 18:50:51 +000058# -compileflags Next argument specifies extra options passed to make when
59# building LLVM.
Patrick Jenkins0e9402f2006-08-11 23:02:09 +000060# -use-gmake Use gmake instead of the default make command to build
Patrick Jenkins1cd46912006-07-27 01:17:17 +000061# llvm and run tests.
Patrick Jenkinsfe030d72006-07-06 21:19:32 +000062#
63# ---------------- Options to configure llvm-test ----------------------------
Patrick Jenkins215b48f2006-07-07 18:50:51 +000064# -extraflags Next argument specifies extra options that are passed to
65# compile the tests.
66# -noexternals Do not run the external tests (for cases where povray
67# or SPEC are not installed)
68# -with-externals Specify a directory where the external tests are located.
Patrick Jenkins0e9402f2006-08-11 23:02:09 +000069# -submit-server Specifies a server to submit the test results too. If this
70# option is not specified it defaults to
71# llvm.org. This is basically just the address of the
72# webserver
73# -submit-script Specifies which script to call on the submit server. If
74# this option is not specified it defaults to
Jim Laskey6d8a1b72006-09-15 17:03:36 +000075# /nightlytest/NightlyTestAccept.php. This is basically
Patrick Jenkins0e9402f2006-08-11 23:02:09 +000076# everything after the www.yourserver.org.
Tanya Lattnerc1611882008-03-10 07:28:08 +000077# -nosubmit Do not report the test results back to a submit server.
Patrick Jenkinsfe030d72006-07-06 21:19:32 +000078#
79# CVSROOT is the CVS repository from which the tree will be checked out,
80# specified either in the full :method:user@host:/dir syntax, or
81# just /dir if using a local repo.
82# BUILDDIR is the directory where sources for this test run will be checked out
83# AND objects for this test run will be built. This directory MUST NOT
84# exist before the script is run; it will be created by the cvs checkout
85# process and erased (unless -noremove is specified; see above.)
86# WEBDIR is the directory into which the test results web page will be written,
87# AND in which the "index.html" is assumed to be a symlink to the most recent
88# copy of the results. This directory will be created if it does not exist.
89# LLVMGCCDIR is the directory in which the LLVM GCC Front End is installed
90# to. This is the same as you would have for a normal LLVM build.
91#
92##############################################################
93#
94# Getting environment variables
95#
96##############################################################
Reid Spencerfa34d7b2006-08-13 09:53:02 +000097my $HOME = $ENV{'HOME'};
Reid Spencer99e865a2007-04-07 04:41:16 +000098my $SVNURL = $ENV{"SVNURL"};
Reid Spencerc9a15d52007-06-26 17:08:16 +000099$SVNURL = 'https://llvm.org/svn/llvm-project' unless $SVNURL;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000100my $CVSRootDir = $ENV{'CVSROOT'};
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000101$CVSRootDir = "/home/vadve/shared/PublicCVS" unless $CVSRootDir;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000102my $BuildDir = $ENV{'BUILDDIR'};
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000103$BuildDir = "$HOME/buildtest" unless $BuildDir;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000104my $WebDir = $ENV{'WEBDIR'};
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000105$WebDir = "$HOME/cvs/testresults-X86" unless $WebDir;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000106
107##############################################################
108#
109# Calculate the date prefix...
110#
111##############################################################
112@TIME = localtime;
113my $DATE = sprintf "%4d-%02d-%02d", $TIME[5]+1900, $TIME[4]+1, $TIME[3];
114my $DateString = strftime "%B %d, %Y", localtime;
115my $TestStartTime = gmtime() . "GMT<br>" . localtime() . " (local)";
116
117##############################################################
118#
119# Parse arguments...
120#
121##############################################################
122$CONFIGUREARGS="";
Patrick Jenkins49717a42006-07-21 01:39:42 +0000123$nickname="";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000124$NOTEST=0;
John Criswelleecd7112007-06-29 19:12:50 +0000125$USESVN=1;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000126$NORUNNINGTESTS=0;
Patrick Jenkins1cd46912006-07-27 01:17:17 +0000127$MAKECMD="make";
Patrick Jenkins0e9402f2006-08-11 23:02:09 +0000128$SUBMITSERVER = "llvm.org";
Jim Laskey6d8a1b72006-09-15 17:03:36 +0000129$SUBMITSCRIPT = "/nightlytest/NightlyTestAccept.php";
Tanya Lattnerc1611882008-03-10 07:28:08 +0000130$SUBMIT = 1;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000131
132while (scalar(@ARGV) and ($_ = $ARGV[0], /^[-+]/)) {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000133 shift;
134 last if /^--$/; # Stop processing arguments on --
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000135
136 # List command line options here...
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000137 if (/^-nocheckout$/) { $NOCHECKOUT = 1; next; }
138 if (/^-nocvsstats$/) { $NOCVSSTATS = 1; next; }
139 if (/^-noremove$/) { $NOREMOVE = 1; next; }
140 if (/^-noremoveresults$/){ $NOREMOVERESULTS = 1; next; }
141 if (/^-notest$/) { $NOTEST = 1; $NORUNNINGTESTS = 1; next; }
142 if (/^-norunningtests$/) { $NORUNNINGTESTS = 1; next; }
143 if (/^-parallel$/) { $MAKEOPTS = "$MAKEOPTS -j2 -l3.0"; next; }
144 if (/^-release$/) { $MAKEOPTS = "$MAKEOPTS ENABLE_OPTIMIZED=1 ".
145 "OPTIMIZE_OPTION=-O2"; $BUILDTYPE="release"; next;}
Jim Laskey27b8ba02006-09-28 17:49:20 +0000146 if (/^-release-asserts$/){ $MAKEOPTS = "$MAKEOPTS ENABLE_OPTIMIZED=1 ".
147 "DISABLE-ASSERTIONS=1 ".
Reid Spencer93c456c2006-10-19 15:24:04 +0000148 "OPTIMIZE_OPTION=-O2";
149 $BUILDTYPE="release-asserts"; next;}
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000150 if (/^-enable-llcbeta$/) { $PROGTESTOPTS .= " ENABLE_LLCBETA=1"; next; }
Reid Spencer2bae1f52006-11-24 20:34:16 +0000151 if (/^-enable-lli$/) { $PROGTESTOPTS .= " ENABLE_LLI=1";
152 $CONFIGUREARGS .= " --enable-lli"; next; }
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000153 if (/^-disable-llc$/) { $PROGTESTOPTS .= " DISABLE_LLC=1";
154 $CONFIGUREARGS .= " --disable-llc_diffs"; next; }
155 if (/^-disable-jit$/) { $PROGTESTOPTS .= " DISABLE_JIT=1";
156 $CONFIGUREARGS .= " --disable-jit"; next; }
157 if (/^-disable-cbe$/) { $PROGTESTOPTS .= " DISABLE_CBE=1"; next; }
Evan Chenge04c90b2008-01-12 04:27:18 +0000158 if (/^-disable-lto$/) { $PROGTESTOPTS .= " DISABLE_LTO=1"; next; }
Evan Cheng3d64f1c2008-01-14 17:58:03 +0000159 if (/^-test-opts$/) { $PROGTESTOPTS .= " $ARGV[0]"; shift; next; }
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000160 if (/^-verbose$/) { $VERBOSE = 1; next; }
161 if (/^-debug$/) { $DEBUG = 1; next; }
162 if (/^-nice$/) { $NICE = "nice "; next; }
163 if (/^-f2c$/) { $CONFIGUREARGS .= " --with-f2c=$ARGV[0]";
164 shift; next; }
165 if (/^-with-externals$/) { $CONFIGUREARGS .= " --with-externals=$ARGV[0]";
166 shift; next; }
167 if (/^-submit-server/) { $SUBMITSERVER = "$ARGV[0]"; shift; next; }
168 if (/^-submit-script/) { $SUBMITSCRIPT = "$ARGV[0]"; shift; next; }
Tanya Lattnerc1611882008-03-10 07:28:08 +0000169 if (/^-nosubmit$/) { $SUBMIT = 0; next; }
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000170 if (/^-nickname$/) { $nickname = "$ARGV[0]"; shift; next; }
171 if (/^-gccpath/) { $CONFIGUREARGS .=
172 " CC=$ARGV[0]/gcc CXX=$ARGV[0]/g++";
173 $GCCPATH=$ARGV[0]; shift; next; }
174 else { $GCCPATH=""; }
175 if (/^-cvstag/) { $CVSCOOPT .= " -r $ARGV[0]"; shift; next; }
176 else { $CVSCOOPT="";}
Reid Spencerece1f682007-07-02 06:19:57 +0000177 if (/^-usecvs/) { $USESVN = 0; }
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000178 if (/^-target/) { $CONFIGUREARGS .= " --target=$ARGV[0]";
179 shift; next; }
180 if (/^-cflags/) { $MAKEOPTS = "$MAKEOPTS C.Flags=\'$ARGV[0]\'";
181 shift; next; }
182 if (/^-cxxflags/) { $MAKEOPTS = "$MAKEOPTS CXX.Flags=\'$ARGV[0]\'";
183 shift; next; }
184 if (/^-ldflags/) { $MAKEOPTS = "$MAKEOPTS LD.Flags=\'$ARGV[0]\'";
185 shift; next; }
186 if (/^-compileflags/) { $MAKEOPTS = "$MAKEOPTS $ARGV[0]"; shift; next; }
187 if (/^-use-gmake/) { $MAKECMD = "gmake"; shift; next; }
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000188 if (/^-extraflags/) { $CONFIGUREARGS .=
189 " --with-extra-options=\'$ARGV[0]\'"; shift; next;}
190 if (/^-noexternals$/) { $NOEXTERNALS = 1; next; }
191 if (/^-nodejagnu$/) { $NODEJAGNU = 1; next; }
192 if (/^-nobuild$/) { $NOBUILD = 1; next; }
193 print "Unknown option: $_ : ignoring!\n";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000194}
195
196if ($ENV{'LLVMGCCDIR'}) {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000197 $CONFIGUREARGS .= " --with-llvmgccdir=" . $ENV{'LLVMGCCDIR'};
Tanya Lattner849c9a22007-04-13 04:36:48 +0000198 $LLVMGCCPATH = $ENV{'LLVMGCCDIR'};
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000199}
Tanya Lattner849c9a22007-04-13 04:36:48 +0000200else {
201 $LLVMGCCPATH = "";
202}
203
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000204if ($CONFIGUREARGS !~ /--disable-jit/) {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000205 $CONFIGUREARGS .= " --enable-jit";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000206}
207
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000208if (@ARGV != 0 and @ARGV != 3 and $VERBOSE) {
209 foreach $x (@ARGV) {
210 print "$x\n";
211 }
212 print "Must specify 0 or 3 options!";
Patrick Jenkinsf58473f2006-07-27 01:03:46 +0000213}
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000214
215if (@ARGV == 3) {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000216 $CVSRootDir = $ARGV[0];
217 $BuildDir = $ARGV[1];
218 $WebDir = $ARGV[2];
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000219}
220
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000221if ($CVSRootDir eq "" or
222 $BuildDir eq "" or
223 $WebDir eq "") {
224 die("please specify a cvs root directory, a build directory, and a ".
Patrick Jenkinsf58473f2006-07-27 01:03:46 +0000225 "web directory");
226 }
227
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000228if ($nickname eq "") {
229 die ("Please invoke NewNightlyTest.pl with command line option " .
230 "\"-nickname <nickname>\"");
Patrick Jenkins514e2582006-07-20 22:28:43 +0000231}
Patrick Jenkins1cd46912006-07-27 01:17:17 +0000232
Jim Laskey27b8ba02006-09-28 17:49:20 +0000233if ($BUILDTYPE ne "release" && $BUILDTYPE ne "release-asserts") {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000234 $BUILDTYPE = "debug";
Patrick Jenkins26ba6092006-07-23 22:57:28 +0000235}
Patrick Jenkins514e2582006-07-20 22:28:43 +0000236
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000237##############################################################
238#
239#define the file names we'll use
240#
241##############################################################
242my $Prefix = "$WebDir/$DATE";
243my $BuildLog = "$Prefix-Build-Log.txt";
Reid Spencer99e865a2007-04-07 04:41:16 +0000244my $COLog = "$Prefix-CVS-Log.txt";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000245my $OldenTestsLog = "$Prefix-Olden-tests.txt";
246my $SingleSourceLog = "$Prefix-SingleSource-ProgramTest.txt.gz";
247my $MultiSourceLog = "$Prefix-MultiSource-ProgramTest.txt.gz";
Patrick Jenkins26ba6092006-07-23 22:57:28 +0000248my $ExternalLog = "$Prefix-External-ProgramTest.txt.gz";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000249my $DejagnuLog = "$Prefix-Dejagnu-testrun.log";
250my $DejagnuSum = "$Prefix-Dejagnu-testrun.sum";
251my $DejagnuTestsLog = "$Prefix-DejagnuTests-Log.txt";
252if (! -d $WebDir) {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000253 mkdir $WebDir, 0777;
Patrick Jenkins03137752006-08-21 20:45:57 +0000254 if($VERBOSE){
255 warn "$WebDir did not exist; creating it.\n";
256 }
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000257}
258
259if ($VERBOSE) {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000260 print "INITIALIZED\n";
Reid Spencer99e865a2007-04-07 04:41:16 +0000261 if ($USESVN) {
262 print "SVN URL = $SVNURL\n";
263 } else {
264 print "CVS Root = $CVSRootDir\n";
265 }
266 print "COLog = $COLog\n";
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000267 print "BuildDir = $BuildDir\n";
268 print "WebDir = $WebDir\n";
269 print "Prefix = $Prefix\n";
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000270 print "BuildLog = $BuildLog\n";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000271}
272
273##############################################################
274#
275# Helper functions
276#
277##############################################################
278sub GetDir {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000279 my $Suffix = shift;
280 opendir DH, $WebDir;
281 my @Result = reverse sort grep !/$DATE/, grep /[-0-9]+$Suffix/, readdir DH;
282 closedir DH;
283 return @Result;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000284}
285
286#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
287#
288# DiffFiles - Diff the current version of the file against the last version of
289# the file, reporting things added and removed. This is used to report, for
290# example, added and removed warnings. This returns a pair (added, removed)
291#
292#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
293sub DiffFiles {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000294 my $Suffix = shift;
295 my @Others = GetDir $Suffix;
296 if (@Others == 0) { # No other files? We added all entries...
297 return (`cat $WebDir/$DATE$Suffix`, "");
298 }
299# Diff the files now...
300 my @Diffs = split "\n", `diff $WebDir/$DATE$Suffix $WebDir/$Others[0]`;
301 my $Added = join "\n", grep /^</, @Diffs;
302 my $Removed = join "\n", grep /^>/, @Diffs;
303 $Added =~ s/^< //gm;
304 $Removed =~ s/^> //gm;
305 return ($Added, $Removed);
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000306}
307
308#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
309#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
310sub GetRegex { # (Regex with ()'s, value)
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000311 $_[1] =~ /$_[0]/m;
312 return $1
313 if (defined($1));
314 return "0";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000315}
316
317#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
318#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
319sub GetRegexNum {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000320 my ($Regex, $Num, $Regex2, $File) = @_;
321 my @Items = split "\n", `grep '$Regex' $File`;
322 return GetRegex $Regex2, $Items[$Num];
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000323}
324
325#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
326#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
327sub ChangeDir { # directory, logical name
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000328 my ($dir,$name) = @_;
329 chomp($dir);
330 if ( $VERBOSE ) { print "Changing To: $name ($dir)\n"; }
331 $result = chdir($dir);
332 if (!$result) {
333 print "ERROR!!! Cannot change directory to: $name ($dir) because $!";
334 return false;
335 }
336 return true;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000337}
338
339#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
340#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
341sub ReadFile {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000342 if (open (FILE, $_[0])) {
343 undef $/;
344 my $Ret = <FILE>;
345 close FILE;
346 $/ = '\n';
347 return $Ret;
348 } else {
349 print "Could not open file '$_[0]' for reading!\n";
350 return "";
351 }
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000352}
353
354#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
355#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
356sub WriteFile { # (filename, contents)
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000357 open (FILE, ">$_[0]") or die "Could not open file '$_[0]' for writing!\n";
358 print FILE $_[1];
359 close FILE;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000360}
361
362#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
363#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
364sub CopyFile { #filename, newfile
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000365 my ($file, $newfile) = @_;
366 chomp($file);
367 if ($VERBOSE) { print "Copying $file to $newfile\n"; }
368 copy($file, $newfile);
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000369}
370
371#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
372#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
373sub AddRecord {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000374 my ($Val, $Filename,$WebDir) = @_;
375 my @Records;
376 if (open FILE, "$WebDir/$Filename") {
377 @Records = grep !/$DATE/, split "\n", <FILE>;
378 close FILE;
379 }
380 push @Records, "$DATE: $Val";
381 WriteFile "$WebDir/$Filename", (join "\n", @Records) . "\n";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000382}
383
384#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
385#
386# FormatTime - Convert a time from 1m23.45 into 83.45
387#
388#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
389sub FormatTime {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000390 my $Time = shift;
391 if ($Time =~ m/([0-9]+)m([0-9.]+)/) {
392 $Time = sprintf("%7.4f", $1*60.0+$2);
393 }
394 return $Time;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000395}
396
397#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick Jenkinsb9c65eb2006-08-18 18:00:21 +0000398#
399# This function is meant to read in the dejagnu sum file and
400# return a string with only the results (i.e. PASS/FAIL/XPASS/
401# XFAIL).
402#
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000403#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
404sub GetDejagnuTestResults { # (filename, log)
Patrick Jenkinsb9c65eb2006-08-18 18:00:21 +0000405 my ($filename, $DejagnuLog) = @_;
406 my @lines;
407 $/ = "\n"; #Make sure we're going line at a time.
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000408
Patrick Jenkinsb9c65eb2006-08-18 18:00:21 +0000409 if( $VERBOSE) { print "DEJAGNU TEST RESULTS:\n"; }
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000410
Patrick Jenkinsb9c65eb2006-08-18 18:00:21 +0000411 if (open SRCHFILE, $filename) {
412 # Process test results
413 while ( <SRCHFILE> ) {
414 if ( length($_) > 1 ) {
415 chomp($_);
Jim Laskey01d7bcf2006-09-20 09:20:22 +0000416 if ( m/^(PASS|XPASS|FAIL|XFAIL): .*\/llvm\/test\/(.*)$/ ) {
417 push(@lines, "$1: test/$2");
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000418 }
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000419 }
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000420 }
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000421 }
Patrick Jenkinsb9c65eb2006-08-18 18:00:21 +0000422 close SRCHFILE;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000423
Patrick Jenkinsb9c65eb2006-08-18 18:00:21 +0000424 my $content = join("\n", @lines);
425 return $content;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000426}
427
428
Patrick Jenkinsb9c65eb2006-08-18 18:00:21 +0000429
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000430#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
431#
432# This function acts as a mini web browswer submitting data
433# to our central server via the post method
434#
435#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
436sub SendData{
437 $host = $_[0];
438 $file = $_[1];
439 $variables=$_[2];
440
441 $port=80;
442 $socketaddr= sockaddr_in $port, inet_aton $host or die "Bad hostname\n";
Patrick Jenkinsadea55e2006-07-17 16:41:19 +0000443 socket SOCK, PF_INET, SOCK_STREAM, getprotobyname('tcp') or
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000444 die "Bad socket\n";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000445 connect SOCK, $socketaddr or die "Bad connection\n";
446 select((select(SOCK), $| = 1)[0]);
447
448 #creating content here
449 my $content;
450 foreach $key (keys (%$variables)){
451 $value = $variables->{$key};
452 $value =~ s/([^A-Za-z0-9])/sprintf("%%%02X", ord($1))/seg;
453 $content .= "$key=$value&";
454 }
455
456 $length = length($content);
457
458 my $send= "POST $file HTTP/1.0\n";
Lauro Ramos Venancio46040232007-05-03 14:05:07 +0000459 $send.= "Host: $host\n";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000460 $send.= "Content-Type: application/x-www-form-urlencoded\n";
461 $send.= "Content-length: $length\n\n";
462 $send.= "$content";
463
Patrick Jenkinse8501eb2006-08-07 01:54:37 +0000464 print SOCK $send;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000465 my $result;
466 while(<SOCK>){
467 $result .= $_;
468 }
469 close(SOCK);
470
471 my $sentdata="";
Patrick Jenkins4c4e3562006-07-07 21:40:34 +0000472 foreach $x (keys (%$variables)){
Patrick Jenkins7267bd62006-07-10 18:35:41 +0000473 $value = $variables->{$x};
474 $sentdata.= "$x => $value\n";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000475 }
476 WriteFile "$Prefix-sentdata.txt", $sentdata;
Patrick Jenkins4c4e3562006-07-07 21:40:34 +0000477
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000478
479 return $result;
480}
481
Patrick Jenkins215b48f2006-07-07 18:50:51 +0000482##############################################################
483#
484# Getting Start timestamp
485#
486##############################################################
Patrick Jenkinsb67e1182006-07-21 21:43:09 +0000487$starttime = `date "+20%y-%m-%d %H:%M:%S"`;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000488
489##############################################################
490#
491# Create the CVS repository directory
492#
493##############################################################
494if (!$NOCHECKOUT) {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000495 if (-d $BuildDir) {
496 if (!$NOREMOVE) {
497 if ( $VERBOSE ) {
498 print "Build directory exists! Removing it\n";
499 }
500 system "rm -rf $BuildDir";
Reid Spencer99e865a2007-04-07 04:41:16 +0000501 mkdir $BuildDir or die "Could not create checkout directory $BuildDir!";
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000502 } else {
Jim Laskey6d8a1b72006-09-15 17:03:36 +0000503 if ( $VERBOSE ) {
504 print "Build directory exists!\n";
505 }
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000506 }
Jim Laskey6d8a1b72006-09-15 17:03:36 +0000507 } else {
Reid Spencer99e865a2007-04-07 04:41:16 +0000508 mkdir $BuildDir or die "Could not create checkout directory $BuildDir!";
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000509 }
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000510}
Reid Spencer99e865a2007-04-07 04:41:16 +0000511ChangeDir( $BuildDir, "checkout directory" );
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000512
513
514##############################################################
515#
Reid Spencer99e865a2007-04-07 04:41:16 +0000516# Check out the llvm tree, using either SVN or CVS
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000517#
518##############################################################
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000519if (!$NOCHECKOUT) {
Reid Spencerceb9d782007-07-02 06:16:32 +0000520 if ( $VERBOSE ) { print "CHECKOUT STAGE:\n"; }
Reid Spencer99e865a2007-04-07 04:41:16 +0000521 if ($USESVN) {
522 my $SVNCMD = "$NICE svn co $SVNURL";
523 if ($VERBOSE) {
Reid Spencer1c01cf92007-06-29 03:12:42 +0000524 print "( time -p $SVNCMD/llvm/trunk llvm; cd llvm/projects ; " .
525 "$SVNCMD/test-suite/trunk llvm-test ) > $COLog 2>&1\n";
Reid Spencer99e865a2007-04-07 04:41:16 +0000526 }
Reid Spencerceb9d782007-07-02 06:16:32 +0000527 system "( time -p $SVNCMD/llvm/trunk llvm; cd llvm/projects ; " .
528 "$SVNCMD/test-suite/trunk llvm-test ) > $COLog 2>&1\n";
Reid Spencer99e865a2007-04-07 04:41:16 +0000529 } else {
530 my $CVSOPT = "";
531 $CVSOPT = "-z3" # Use compression if going over ssh.
532 if $CVSRootDir =~ /^:ext:/;
533 my $CVSCMD = "$NICE cvs $CVSOPT -d $CVSRootDir co -P $CVSCOOPT";
Reid Spencerceb9d782007-07-02 06:16:32 +0000534 if ($VERBOSE) {
535 print "( time -p $CVSCMD llvm; cd llvm/projects ; " .
536 "$CVSCMD llvm-test ) > $COLog 2>&1\n";
537 }
Reid Spencer99e865a2007-04-07 04:41:16 +0000538 system "( time -p $CVSCMD llvm; cd llvm/projects ; " .
Reid Spencerb5fda752007-04-07 05:20:07 +0000539 "$CVSCMD llvm-test ) > $COLog 2>&1\n";
Reid Spencer99e865a2007-04-07 04:41:16 +0000540 }
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000541}
Reid Spencer99e865a2007-04-07 04:41:16 +0000542ChangeDir( $BuildDir , "Checkout directory") ;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000543ChangeDir( "llvm" , "llvm source directory") ;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000544
545##############################################################
546#
547# Get some static statistics about the current state of CVS
548#
549# This can probably be put on the server side
550#
551##############################################################
Reid Spencer99e865a2007-04-07 04:41:16 +0000552my $CheckoutTime_Wall = GetRegex "([0-9.]+)", `grep '^real' $COLog`;
553my $CheckoutTime_User = GetRegex "([0-9.]+)", `grep '^user' $COLog`;
554my $CheckoutTime_Sys = GetRegex "([0-9.]+)", `grep '^sys' $COLog`;
555my $CheckoutTime_CPU = $CVSCheckoutTime_User + $CVSCheckoutTime_Sys;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000556
Reid Spencer99e865a2007-04-07 04:41:16 +0000557my $NumFilesInCVS = 0;
558my $NumDirsInCVS = 0;
559if ($USESVN) {
560 $NumFilesInCVS = `egrep '^A' $COLog | wc -l` + 0;
561 $NumDirsInCVS = `sed -e 's#/[^/]*$##' $COLog | sort | uniq | wc -l` + 0;
562} else {
563 $NumFilesInCVS = `egrep '^U' $COLog | wc -l` + 0;
564 $NumDirsInCVS = `egrep '^cvs (checkout|server|update):' $COLog | wc -l` + 0;
565}
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000566
567##############################################################
568#
569# Extract some information from the CVS history... use a hash so no duplicate
570# stuff is stored. This gets the history from the previous days worth
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000571# of cvs activity and parses it.
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000572#
573##############################################################
574
Reid Spencer99e865a2007-04-07 04:41:16 +0000575# This just computes a reasonably accurate #of seconds since 2000. It doesn't
576# have to be perfect as its only used for comparing date ranges within a couple
577# of days.
578sub ConvertToSeconds {
579 my ($sec, $min, $hour, $day, $mon, $yr) = @_;
580 my $Result = ($yr - 2000) * 12;
581 $Result += $mon;
582 $Result *= 31;
583 $Result += $day;
584 $Result *= 24;
585 $Result += $hour;
586 $Result *= 60;
587 $Result += $min;
588 $Result *= 60;
589 $Result += $sec;
590 return $Result;
591}
592
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000593my (%AddedFiles, %ModifiedFiles, %RemovedFiles, %UsersCommitted, %UsersUpdated);
594
Reid Spencer99e865a2007-04-07 04:41:16 +0000595if (!$NOCVSSTATS) {
596 if ($VERBOSE) { print "CHANGE HISTORY ANALYSIS STAGE\n"; }
Reid Spencer776964a2007-04-04 06:59:36 +0000597
Reid Spencer99e865a2007-04-07 04:41:16 +0000598 if ($USESVN) {
599 @SVNHistory = split /<logentry/, `svn log --xml --verbose -r{$DATE}:HEAD`;
600 # Skip very first entry because it is the XML header cruft
601 shift @SVNHistory;
602 my $Now = time();
603 foreach $Record (@SVNHistory) {
604 my @Lines = split "\n", $Record;
605 my ($Author, $Date, $Revision);
606 # Get the date and see if its one we want to process.
607 my ($Year, $Month, $Day, $Hour, $Min, $Sec);
608 if ($Lines[3] =~ /<date>(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})/){
609 $Year = $1; $Month = $2; $Day = $3; $Hour = $4; $Min = $5; $Sec = $6;
610 }
611 my $Then = ConvertToSeconds($Sec, $Min, $Hour, $Day, $Month, $Year);
612 # Get the current date and compute when "yesterday" is.
613 my ($NSec, $NMin, $NHour, $NDay, $NMon, $NYear) = gmtime();
614 my $Now = ConvertToSeconds( $NSec, $NMin, $NHour, $NDay, $NMon, $NYear);
615 if (($Now - 24*60*60) > $Then) {
616 next;
617 }
618 if ($Lines[1] =~ / revision="([0-9]*)">/) {
619 $Revision = $1;
620 }
621 if ($Lines[2] =~ /<author>([^<]*)<\/author>/) {
622 $Author = $1;
623 }
624 $UsersCommitted{$Author} = 1;
625 $Date = $Year . "-" . $Month . "-" . $Day;
626 $Time = $Hour . ":" . $Min . ":" . $Sec;
627 print "Rev: $Revision, Author: $Author, Date: $Date, Time: $Time\n";
628 for ($i = 6; $i < $#Lines; $i += 2 ) {
629 if ($Lines[$i] =~ /^ action="(.)">([^<]*)</) {
630 if ($1 == "A") {
631 $AddedFiles{$2} = 1;
632 } elsif ($1 == 'D') {
633 $RemovedFiles{$2} = 1;
634 } elsif ($1 == 'M' || $1 == 'R' || $1 == 'C') {
635 $ModifiedFiles{$2} = 1;
636 } else {
637 print "UNMATCHABLE: $Lines[$i]\n";
638 }
639 }
640 }
641 }
642 } else {
643 @CVSHistory = split "\n", `cvs history -D '1 day ago' -a -xAMROCGUW`;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000644#print join "\n", @CVSHistory; print "\n";
645
Reid Spencer99e865a2007-04-07 04:41:16 +0000646 my $DateRE = '[-/:0-9 ]+\+[0-9]+';
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000647
648# Loop over every record from the CVS history, filling in the hashes.
Reid Spencer99e865a2007-04-07 04:41:16 +0000649 foreach $File (@CVSHistory) {
650 my ($Type, $Date, $UID, $Rev, $Filename);
651 if ($File =~ /([AMRUGC]) ($DateRE) ([^ ]+) +([^ ]+) +([^ ]+) +([^ ]+)/) {
652 ($Type, $Date, $UID, $Rev, $Filename) = ($1, $2, $3, $4, "$6/$5");
653 } elsif ($File =~ /([W]) ($DateRE) ([^ ]+)/) {
654 ($Type, $Date, $UID, $Rev, $Filename) = ($1, $2, $3, "", "");
655 } elsif ($File =~ /([O]) ($DateRE) ([^ ]+) +([^ ]+)/) {
656 ($Type, $Date, $UID, $Rev, $Filename) = ($1, $2, $3, "", "$4/");
657 } else {
658 print "UNMATCHABLE: $File\n";
659 next;
660 }
661 # print "$File\nTy = $Type Date = '$Date' UID=$UID Rev=$Rev File = '$Filename'\n";
662
663 if ($Filename =~ /^llvm/) {
664 if ($Type eq 'M') { # Modified
665 $ModifiedFiles{$Filename} = 1;
666 $UsersCommitted{$UID} = 1;
667 } elsif ($Type eq 'A') { # Added
668 $AddedFiles{$Filename} = 1;
669 $UsersCommitted{$UID} = 1;
670 } elsif ($Type eq 'R') { # Removed
671 $RemovedFiles{$Filename} = 1;
672 $UsersCommitted{$UID} = 1;
673 } else {
674 $UsersUpdated{$UID} = 1;
675 }
676 }
677 }
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000678
Reid Spencer99e865a2007-04-07 04:41:16 +0000679 my $TestError = 1;
680 } #$USESVN
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000681}#!NOCVSSTATS
682
683my $CVSAddedFiles = join "\n", sort keys %AddedFiles;
684my $CVSModifiedFiles = join "\n", sort keys %ModifiedFiles;
685my $CVSRemovedFiles = join "\n", sort keys %RemovedFiles;
686my $UserCommitList = join "\n", sort keys %UsersCommitted;
687my $UserUpdateList = join "\n", sort keys %UsersUpdated;
688
689##############################################################
690#
691# Build the entire tree, saving build messages to the build log
692#
693##############################################################
694if (!$NOCHECKOUT && !$NOBUILD) {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000695 my $EXTRAFLAGS = "--enable-spec --with-objroot=.";
696 if ( $VERBOSE ) {
697 print "CONFIGURE STAGE:\n";
698 print "(time -p $NICE ./configure $CONFIGUREARGS $EXTRAFLAGS) " .
699 "> $BuildLog 2>&1\n";
700 }
701 system "(time -p $NICE ./configure $CONFIGUREARGS $EXTRAFLAGS) " .
702 "> $BuildLog 2>&1";
703 if ( $VERBOSE ) {
704 print "BUILD STAGE:\n";
705 print "(time -p $NICE $MAKECMD $MAKEOPTS) >> $BuildLog 2>&1\n";
706 }
707 # Build the entire tree, capturing the output into $BuildLog
708 system "(time -p $NICE $MAKECMD $MAKEOPTS) >> $BuildLog 2>&1";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000709}
710
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000711##############################################################
712#
713# Get some statistics about the build...
714#
715##############################################################
716#this can de done on server
717#my @Linked = split '\n', `grep Linking $BuildLog`;
718#my $NumExecutables = scalar(grep(/executable/, @Linked));
719#my $NumLibraries = scalar(grep(!/executable/, @Linked));
720#my $NumObjects = `grep ']\: Compiling ' $BuildLog | wc -l` + 0;
721
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000722# Get the number of lines of source code. Must be here after the build is done
723# because countloc.sh uses the llvm-config script which must be built.
Patrick Jenkinsb993b0a2006-08-16 22:18:41 +0000724my $LOC = `utils/countloc.sh -topdir $BuildDir/llvm`;
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000725
726# Get the time taken by the configure script
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000727my $ConfigTimeU = GetRegexNum "^user", 0, "([0-9.]+)", "$BuildLog";
728my $ConfigTimeS = GetRegexNum "^sys", 0, "([0-9.]+)", "$BuildLog";
729my $ConfigTime = $ConfigTimeU+$ConfigTimeS; # ConfigTime = User+System
730my $ConfigWallTime = GetRegexNum "^real", 0,"([0-9.]+)","$BuildLog";
731
732$ConfigTime=-1 unless $ConfigTime;
733$ConfigWallTime=-1 unless $ConfigWallTime;
734
735my $BuildTimeU = GetRegexNum "^user", 1, "([0-9.]+)", "$BuildLog";
736my $BuildTimeS = GetRegexNum "^sys", 1, "([0-9.]+)", "$BuildLog";
737my $BuildTime = $BuildTimeU+$BuildTimeS; # BuildTime = User+System
738my $BuildWallTime = GetRegexNum "^real", 1, "([0-9.]+)","$BuildLog";
739
740$BuildTime=-1 unless $BuildTime;
741$BuildWallTime=-1 unless $BuildWallTime;
742
743my $BuildError = 0, $BuildStatus = "OK";
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000744if ($NOBUILD) {
745 $BuildStatus = "Skipped by user";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000746}
Patrick Jenkinsf58473f2006-07-27 01:03:46 +0000747elsif (`grep '^$MAKECMD\[^:]*: .*Error' $BuildLog | wc -l` + 0 ||
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000748 `grep '^$MAKECMD: \*\*\*.*Stop.' $BuildLog | wc -l`+0) {
749 $BuildStatus = "Error: compilation aborted";
750 $BuildError = 1;
751 if( $VERBOSE) { print "\n***ERROR BUILDING TREE\n\n"; }
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000752}
753if ($BuildError) { $NODEJAGNU=1; }
754
Patrick Jenkins169357e2006-07-23 21:38:07 +0000755my $a_file_sizes="";
756my $o_file_sizes="";
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000757if (!$BuildError) {
758 print "Organizing size of .o and .a files\n"
759 if ( $VERBOSE );
760 ChangeDir( "$BuildDir/llvm", "Build Directory" );
761 $afiles.= `find utils/ -iname '*.a' -ls`;
762 $afiles.= `find lib/ -iname '*.a' -ls`;
763 $afiles.= `find tools/ -iname '*.a' -ls`;
764 if($BUILDTYPE eq "release"){
Jim Laskey7a8efce2006-09-29 17:31:45 +0000765 $afiles.= `find Release/ -iname '*.a' -ls`;
Jim Laskey27b8ba02006-09-28 17:49:20 +0000766 } elsif($BUILDTYPE eq "release-asserts") {
767 $afiles.= `find Release-Asserts/ -iname '*.a' -ls`;
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000768 } else {
769 $afiles.= `find Debug/ -iname '*.a' -ls`;
770 }
771
772 $ofiles.= `find utils/ -iname '*.o' -ls`;
773 $ofiles.= `find lib/ -iname '*.o' -ls`;
774 $ofiles.= `find tools/ -iname '*.o' -ls`;
775 if($BUILDTYPE eq "release"){
Jim Laskey7a8efce2006-09-29 17:31:45 +0000776 $ofiles.= `find Release/ -iname '*.o' -ls`;
Jim Laskey27b8ba02006-09-28 17:49:20 +0000777 } elsif($BUILDTYPE eq "release-asserts") {
778 $ofiles.= `find Release-Asserts/ -iname '*.o' -ls`;
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000779 } else {
780 $ofiles.= `find Debug/ -iname '*.o' -ls`;
781 }
782
783 @AFILES = split "\n", $afiles;
784 $a_file_sizes="";
785 foreach $x (@AFILES){
786 $x =~ m/.+\s+.+\s+.+\s+.+\s+.+\s+.+\s+(.+)\s+.+\s+.+\s+.+\s+(.+)/;
787 $a_file_sizes.="$1 $2 $BUILDTYPE\n";
788 }
789 @OFILES = split "\n", $ofiles;
790 $o_file_sizes="";
791 foreach $x (@OFILES){
792 $x =~ m/.+\s+.+\s+.+\s+.+\s+.+\s+.+\s+(.+)\s+.+\s+.+\s+.+\s+(.+)/;
793 $o_file_sizes.="$1 $2 $BUILDTYPE\n";
794 }
795} else {
796 $a_file_sizes="No data due to a bad build.";
797 $o_file_sizes="No data due to a bad build.";
Patrick Jenkins169357e2006-07-23 21:38:07 +0000798}
Patrick Jenkins169357e2006-07-23 21:38:07 +0000799
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000800##############################################################
801#
802# Running dejagnu tests
803#
804##############################################################
Patrick Jenkinsb9c65eb2006-08-18 18:00:21 +0000805my $DejangnuTestResults=""; # String containing the results of the dejagnu
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000806my $dejagnu_output = "$DejagnuTestsLog";
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000807if (!$NODEJAGNU) {
808 if($VERBOSE) {
809 print "DEJAGNU FEATURE/REGRESSION TEST STAGE:\n";
810 print "(time -p $MAKECMD $MAKEOPTS check) > $dejagnu_output 2>&1\n";
811 }
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000812
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000813 #Run the feature and regression tests, results are put into testrun.sum
814 #Full log in testrun.log
815 system "(time -p $MAKECMD $MAKEOPTS check) > $dejagnu_output 2>&1";
816
817 #Copy the testrun.log and testrun.sum to our webdir
818 CopyFile("test/testrun.log", $DejagnuLog);
819 CopyFile("test/testrun.sum", $DejagnuSum);
820 #can be done on server
821 $DejagnuTestResults = GetDejagnuTestResults($DejagnuSum, $DejagnuLog);
822 $unexpfail_tests = $DejagnuTestResults;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000823}
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000824
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000825#Extract time of dejagnu tests
826my $DejagnuTimeU = GetRegexNum "^user", 0, "([0-9.]+)", "$dejagnu_output";
827my $DejagnuTimeS = GetRegexNum "^sys", 0, "([0-9.]+)", "$dejagnu_output";
828$DejagnuTime = $DejagnuTimeU+$DejagnuTimeS; # DejagnuTime = User+System
829$DejagnuWallTime = GetRegexNum "^real", 0,"([0-9.]+)","$dejagnu_output";
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000830$DejagnuTestResults =
831 "Dejagnu skipped by user choice." unless $DejagnuTestResults;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000832$DejagnuTime = "0.0" unless $DejagnuTime;
833$DejagnuWallTime = "0.0" unless $DejagnuWallTime;
834
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000835##############################################################
836#
837# Get warnings from the build
838#
839##############################################################
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000840if (!$NODEJAGNU) {
841 if ( $VERBOSE ) { print "BUILD INFORMATION COLLECTION STAGE\n"; }
842 my @Warn = split "\n", `egrep 'warning:|Entering dir' $BuildLog`;
843 my @Warnings;
844 my $CurDir = "";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000845
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000846 foreach $Warning (@Warn) {
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000847 if ($Warning =~ m/Entering directory \`([^\`]+)\'/) {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000848 $CurDir = $1; # Keep track of directory warning is in...
849 # Remove buildir prefix if included
850 if ($CurDir =~ m#$BuildDir/llvm/(.*)#) { $CurDir = $1; }
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000851 } else {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000852 push @Warnings, "$CurDir/$Warning"; # Add directory to warning...
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000853 }
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000854 }
855 my $WarningsFile = join "\n", @Warnings;
856 $WarningsFile =~ s/:[0-9]+:/::/g;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000857
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000858 # Emit the warnings file, so we can diff...
859 WriteFile "$WebDir/$DATE-Warnings.txt", $WarningsFile . "\n";
860 my ($WarningsAdded, $WarningsRemoved) = DiffFiles "-Warnings.txt";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000861
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000862 # Output something to stdout if something has changed
863 #print "ADDED WARNINGS:\n$WarningsAdded\n\n" if (length $WarningsAdded);
864 #print "REMOVED WARNINGS:\n$WarningsRemoved\n\n" if (length $WarningsRemoved);
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000865
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000866 #my @TmpWarningsAdded = split "\n", $WarningsAdded; ~PJ on upgrade
867 #my @TmpWarningsRemoved = split "\n", $WarningsRemoved; ~PJ on upgrade
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000868
869} #endif !NODEGAGNU
870
871##############################################################
872#
873# If we built the tree successfully, run the nightly programs tests...
874#
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000875# A set of tests to run is passed in (i.e. "SingleSource" "MultiSource"
876# "External")
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000877#
878##############################################################
879sub TestDirectory {
Patrick Jenkinsad6f7582006-08-22 18:11:19 +0000880 my $SubDir = shift;
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000881 ChangeDir( "$BuildDir/llvm/projects/llvm-test/$SubDir",
882 "Programs Test Subdirectory" ) || return ("", "");
883
884 my $ProgramTestLog = "$Prefix-$SubDir-ProgramTest.txt";
885
886 # Run the programs tests... creating a report.nightly.csv file
887 if (!$NOTEST) {
888 if( $VERBOSE) {
889 print "$MAKECMD -k $MAKEOPTS $PROGTESTOPTS report.nightly.csv ".
890 "TEST=nightly > $ProgramTestLog 2>&1\n";
891 }
892 system "$MAKECMD -k $MAKEOPTS $PROGTESTOPTS report.nightly.csv ".
Patrick Jenkins59d1a662006-07-27 18:28:50 +0000893 "TEST=nightly > $ProgramTestLog 2>&1";
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000894 $llcbeta_options=`$MAKECMD print-llcbeta-option`;
895 }
896
Patrick Jenkins59d1a662006-07-27 18:28:50 +0000897 my $ProgramsTable;
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000898 if (`grep '^$MAKECMD\[^:]: .*Error' $ProgramTestLog | wc -l` + 0) {
Patrick Jenkins59d1a662006-07-27 18:28:50 +0000899 $TestError = 1;
900 $ProgramsTable="Error running test $SubDir\n";
901 print "ERROR TESTING\n";
902 } elsif (`grep '^$MAKECMD\[^:]: .*No rule to make target' $ProgramTestLog | wc -l` + 0) {
903 $TestError = 1;
904 $ProgramsTable="Makefile error running tests $SubDir!\n";
905 print "ERROR TESTING\n";
906 } else {
907 $TestError = 0;
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000908 #
909 # Create a list of the tests which were run...
910 #
911 system "egrep 'TEST-(PASS|FAIL)' < $ProgramTestLog ".
Patrick Jenkins4b7f7aa2006-08-17 22:11:03 +0000912 "| sort > $Prefix-$SubDir-Tests.txt";
Patrick Jenkins59d1a662006-07-27 18:28:50 +0000913 }
914 $ProgramsTable = ReadFile "report.nightly.csv";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000915
Patrick Jenkins59d1a662006-07-27 18:28:50 +0000916 ChangeDir( "../../..", "Programs Test Parent Directory" );
917 return ($ProgramsTable, $llcbeta_options);
Patrick Jenkins9e384ab2006-08-14 16:07:14 +0000918} #end sub TestDirectory
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000919
Patrick Jenkins4b7f7aa2006-08-17 22:11:03 +0000920##############################################################
921#
922# Calling sub TestDirectory
923#
924##############################################################
Patrick Jenkinsc281b0d2006-07-27 19:00:01 +0000925if (!$BuildError) {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000926 if ( $VERBOSE ) {
Patrick Jenkinse631c4a2006-08-04 17:55:01 +0000927 print "SingleSource TEST STAGE\n";
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000928 }
929 ($SingleSourceProgramsTable, $llcbeta_options) =
930 TestDirectory("SingleSource");
Patrick Jenkins4b7f7aa2006-08-17 22:11:03 +0000931 WriteFile "$Prefix-SingleSource-Performance.txt", $SingleSourceProgramsTable;
Patrick Jenkins4257ccb2006-08-08 02:03:53 +0000932 if ( $VERBOSE ) {
Patrick Jenkins4b7f7aa2006-08-17 22:11:03 +0000933 print "MultiSource TEST STAGE\n";
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000934 }
935 ($MultiSourceProgramsTable, $llcbeta_options) = TestDirectory("MultiSource");
Patrick Jenkins4b7f7aa2006-08-17 22:11:03 +0000936 WriteFile "$Prefix-MultiSource-Performance.txt", $MultiSourceProgramsTable;
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000937 if ( ! $NOEXTERNALS ) {
938 if ( $VERBOSE ) {
939 print "External TEST STAGE\n";
940 }
941 ($ExternalProgramsTable, $llcbeta_options) = TestDirectory("External");
Patrick Jenkins4b7f7aa2006-08-17 22:11:03 +0000942 WriteFile "$Prefix-External-Performance.txt", $ExternalProgramsTable;
943 system "cat $Prefix-SingleSource-Tests.txt " .
944 "$Prefix-MultiSource-Tests.txt ".
945 "$Prefix-External-Tests.txt | sort > $Prefix-Tests.txt";
946 system "cat $Prefix-SingleSource-Performance.txt " .
947 "$Prefix-MultiSource-Performance.txt ".
948 "$Prefix-External-Performance.txt | sort > $Prefix-Performance.txt";
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000949 } else {
950 $ExternalProgramsTable = "External TEST STAGE SKIPPED\n";
951 if ( $VERBOSE ) {
952 print "External TEST STAGE SKIPPED\n";
953 }
Patrick Jenkins4b7f7aa2006-08-17 22:11:03 +0000954 system "cat $Prefix-SingleSource-Tests.txt " .
955 "$Prefix-MultiSource-Tests.txt ".
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000956 " | sort > $Prefix-Tests.txt";
Patrick Jenkins4b7f7aa2006-08-17 22:11:03 +0000957 system "cat $Prefix-SingleSource-Performance.txt " .
958 "$Prefix-MultiSource-Performance.txt ".
959 " | sort > $Prefix-Performance.txt";
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000960 }
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000961
Patrick Jenkinsad6f7582006-08-22 18:11:19 +0000962 ##############################################################
963 #
964 #
965 # gathering tests added removed broken information here
966 #
967 #
968 ##############################################################
969 my $dejagnu_test_list = ReadFile "$Prefix-Tests.txt";
970 my @DEJAGNU = split "\n", $dejagnu_test_list;
971 my ($passes, $fails, $xfails) = "";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000972
Patrick Jenkinsad6f7582006-08-22 18:11:19 +0000973 if(!$NODEJAGNU) {
974 for ($x=0; $x<@DEJAGNU; $x++) {
975 if ($DEJAGNU[$x] =~ m/^PASS:/) {
976 $passes.="$DEJAGNU[$x]\n";
977 }
978 elsif ($DEJAGNU[$x] =~ m/^FAIL:/) {
979 $fails.="$DEJAGNU[$x]\n";
980 }
981 elsif ($DEJAGNU[$x] =~ m/^XFAIL:/) {
982 $xfails.="$DEJAGNU[$x]\n";
983 }
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000984 }
985 }
Patrick Jenkinsad6f7582006-08-22 18:11:19 +0000986
987} #end if !$BuildError
988
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000989
990##############################################################
991#
992# If we built the tree successfully, runs of the Olden suite with
993# LARGE_PROBLEM_SIZE on so that we can get some "running" statistics.
994#
995##############################################################
996if (!$BuildError) {
Patrick Jenkinsd7210f92006-08-02 18:37:40 +0000997 if ( $VERBOSE ) { print "OLDEN TEST SUITE STAGE\n"; }
998 my ($NATTime, $CBETime, $LLCTime, $JITTime, $OptTime, $BytecodeSize,
999 $MachCodeSize) = ("","","","","","","");
1000 if (!$NORUNNINGTESTS) {
1001 ChangeDir( "$BuildDir/llvm/projects/llvm-test/MultiSource/Benchmarks/Olden",
Reid Spencerfa34d7b2006-08-13 09:53:02 +00001002 "Olden Test Directory");
Patrick Jenkinsfe030d72006-07-06 21:19:32 +00001003
Patrick Jenkinsd7210f92006-08-02 18:37:40 +00001004 # Clean out previous results...
1005 system "$NICE $MAKECMD $MAKEOPTS clean > /dev/null 2>&1";
Reid Spencerfa34d7b2006-08-13 09:53:02 +00001006
Patrick Jenkinsd7210f92006-08-02 18:37:40 +00001007 # Run the nightly test in this directory, with LARGE_PROBLEM_SIZE and
1008 # GET_STABLE_NUMBERS enabled!
Reid Spencerfa34d7b2006-08-13 09:53:02 +00001009 if( $VERBOSE ) {
1010 print "$MAKECMD -k $MAKEOPTS $PROGTESTOPTS report.nightly.csv.out " .
1011 "TEST=nightly LARGE_PROBLEM_SIZE=1 GET_STABLE_NUMBERS=1 " .
1012 "> /dev/null 2>&1\n";
1013 }
1014 system "$MAKECMD -k $MAKEOPTS $PROGTESTOPTS report.nightly.csv.out " .
1015 "TEST=nightly LARGE_PROBLEM_SIZE=1 GET_STABLE_NUMBERS=1 " .
1016 "> /dev/null 2>&1";
1017 system "cp report.nightly.csv $OldenTestsLog";
Patrick Jenkinsd7210f92006-08-02 18:37:40 +00001018 }
Patrick Jenkinsfe030d72006-07-06 21:19:32 +00001019}
1020
Patrick Jenkins215b48f2006-07-07 18:50:51 +00001021##############################################################
1022#
1023# Getting end timestamp
1024#
1025##############################################################
Patrick Jenkinsb67e1182006-07-21 21:43:09 +00001026$endtime = `date "+20%y-%m-%d %H:%M:%S"`;
Patrick Jenkins215b48f2006-07-07 18:50:51 +00001027
Patrick Jenkinsfe030d72006-07-06 21:19:32 +00001028
1029##############################################################
1030#
1031# Place all the logs neatly into one humungous file
1032#
1033##############################################################
Patrick Jenkinsfe030d72006-07-06 21:19:32 +00001034if ( $VERBOSE ) { print "PREPARING LOGS TO BE SENT TO SERVER\n"; }
1035
1036$machine_data = "uname: ".`uname -a`.
1037 "hardware: ".`uname -m`.
1038 "os: ".`uname -sr`.
1039 "name: ".`uname -n`.
1040 "date: ".`date \"+20%y-%m-%d\"`.
1041 "time: ".`date +\"%H:%M:%S\"`;
1042
1043my @CVS_DATA;
1044my $cvs_data;
Reid Spencer99e865a2007-04-07 04:41:16 +00001045@CVS_DATA = ReadFile "$COLog";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +00001046$cvs_data = join("\n", @CVS_DATA);
1047
1048my @BUILD_DATA;
1049my $build_data;
1050@BUILD_DATA = ReadFile "$BuildLog";
1051$build_data = join("\n", @BUILD_DATA);
1052
Patrick Jenkins03137752006-08-21 20:45:57 +00001053my (@DEJAGNU_LOG, @DEJAGNU_SUM, @DEJAGNULOG_FULL, @GCC_VERSION);
1054my ($dejagnutests_log ,$dejagnutests_sum, $dejagnulog_full) = "";
1055my ($gcc_version, $gcc_version_long) = "";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +00001056
Patrick Jenkinsad6f7582006-08-22 18:11:19 +00001057$gcc_version_long="";
1058if ($GCCPATH ne "") {
1059 $gcc_version_long = `$GCCPATH/gcc --version`;
Jeff Cohen75454222007-04-10 19:13:43 +00001060} elsif ($ENV{"CC"}) {
1061 $gcc_version_long = `$ENV{"CC"} --version`;
Patrick Jenkinsad6f7582006-08-22 18:11:19 +00001062} else {
1063 $gcc_version_long = `gcc --version`;
1064}
1065@GCC_VERSION = split '\n', $gcc_version_long;
1066$gcc_version = $GCC_VERSION[0];
1067
Tanya Lattner849c9a22007-04-13 04:36:48 +00001068$llvmgcc_version_long="";
1069if ($LLVMGCCPATH ne "") {
1070 $llvmgcc_version_long = `$LLVMGCCPATH/llvm-gcc -v 2>&1`;
1071} else {
1072 $llvmgcc_version_long = `llvm-gcc -v 2>&1`;
1073}
1074@LLVMGCC_VERSION = split '\n', $llvmgcc_version_long;
1075$llvmgcc_versionTarget = $LLVMGCC_VERSION[1];
1076$llvmgcc_versionTarget =~ /Target: (.+)/;
1077$targetTriple = $1;
1078
Patrick Jenkins03137752006-08-21 20:45:57 +00001079if(!$BuildError){
1080 @DEJAGNU_LOG = ReadFile "$DejagnuLog";
1081 @DEJAGNU_SUM = ReadFile "$DejagnuSum";
1082 $dejagnutests_log = join("\n", @DEJAGNU_LOG);
1083 $dejagnutests_sum = join("\n", @DEJAGNU_SUM);
Patrick Jenkinsfe030d72006-07-06 21:19:32 +00001084
Patrick Jenkins03137752006-08-21 20:45:57 +00001085 @DEJAGNULOG_FULL = ReadFile "$DejagnuTestsLog";
1086 $dejagnulog_full = join("\n", @DEJAGNULOG_FULL);
Patrick Jenkins79fbf7f2006-07-14 20:44:09 +00001087}
Patrick Jenkinsfe030d72006-07-06 21:19:32 +00001088
1089##############################################################
1090#
1091# Send data via a post request
1092#
1093##############################################################
1094
1095if ( $VERBOSE ) { print "SEND THE DATA VIA THE POST REQUEST\n"; }
1096
Reid Spencerfa34d7b2006-08-13 09:53:02 +00001097my %hash_of_data = (
1098 'machine_data' => $machine_data,
1099 'build_data' => $build_data,
1100 'gcc_version' => $gcc_version,
1101 'nickname' => $nickname,
1102 'dejagnutime_wall' => $DejagnuWallTime,
1103 'dejagnutime_cpu' => $DejagnuTime,
Reid Spencer99e865a2007-04-07 04:41:16 +00001104 'cvscheckouttime_wall' => $CheckoutTime_Wall,
1105 'cvscheckouttime_cpu' => $CheckoutTime_CPU,
Reid Spencerfa34d7b2006-08-13 09:53:02 +00001106 'configtime_wall' => $ConfigWallTime,
1107 'configtime_cpu'=> $ConfigTime,
1108 'buildtime_wall' => $BuildWallTime,
1109 'buildtime_cpu' => $BuildTime,
1110 'warnings' => $WarningsFile,
1111 'cvsusercommitlist' => $UserCommitList,
1112 'cvsuserupdatelist' => $UserUpdateList,
1113 'cvsaddedfiles' => $CVSAddedFiles,
1114 'cvsmodifiedfiles' => $CVSModifiedFiles,
1115 'cvsremovedfiles' => $CVSRemovedFiles,
1116 'lines_of_code' => $LOC,
1117 'cvs_file_count' => $NumFilesInCVS,
1118 'cvs_dir_count' => $NumDirsInCVS,
1119 'buildstatus' => $BuildStatus,
1120 'singlesource_programstable' => $SingleSourceProgramsTable,
1121 'multisource_programstable' => $MultiSourceProgramsTable,
1122 'externalsource_programstable' => $ExternalProgramsTable,
1123 'llcbeta_options' => $multisource_llcbeta_options,
1124 'warnings_removed' => $WarningsRemoved,
1125 'warnings_added' => $WarningsAdded,
1126 'passing_tests' => $passes,
1127 'expfail_tests' => $xfails,
1128 'unexpfail_tests' => $fails,
1129 'all_tests' => $dejagnu_test_list,
1130 'new_tests' => "",
1131 'removed_tests' => "",
Patrick Jenkinsb9c65eb2006-08-18 18:00:21 +00001132 'dejagnutests_results' => $DejagnuTestResults,
1133 'dejagnutests_log' => $dejagnulog_full,
Reid Spencerfa34d7b2006-08-13 09:53:02 +00001134 'starttime' => $starttime,
1135 'endtime' => $endtime,
1136 'o_file_sizes' => $o_file_sizes,
Tanya Lattner849c9a22007-04-13 04:36:48 +00001137 'a_file_sizes' => $a_file_sizes,
1138 'target_triple' => $targetTriple
Reid Spencerfa34d7b2006-08-13 09:53:02 +00001139);
Patrick Jenkinsfe030d72006-07-06 21:19:32 +00001140
Tanya Lattnerc1611882008-03-10 07:28:08 +00001141if ($SUBMIT) {
1142 my $response = SendData $SUBMITSERVER,$SUBMITSCRIPT,\%hash_of_data;
1143 if( $VERBOSE) { print "============================\n$response"; }
1144} else {
Reid Spencerfa34d7b2006-08-13 09:53:02 +00001145 print "============================\n";
1146 foreach $x(keys %hash_of_data){
1147 print "$x => $hash_of_data{$x}\n";
1148 }
Patrick Jenkinsfe030d72006-07-06 21:19:32 +00001149}
1150
1151##############################################################
1152#
1153# Remove the cvs tree...
1154#
1155##############################################################
Reid Spencerfa34d7b2006-08-13 09:53:02 +00001156system ( "$NICE rm -rf $BuildDir")
1157 if (!$NOCHECKOUT and !$NOREMOVE);
1158system ( "$NICE rm -rf $WebDir")
1159 if (!$NOCHECKOUT and !$NOREMOVE and !$NOREMOVERESULTS);