blob: e433ac05fcac0167a149509597c3363f7a687a2d [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.
38# -verbose Turn on some debug output
39# -debug Print information useful only to maintainers of this script.
40# -nice Checkout/Configure/Build with "nice" to reduce impact
41# on busy servers.
42# -f2c Next argument specifies path to F2C utility
43# -nickname The next argument specifieds the nickname this script
44# will submit to the nightlytest results repository.
45# -gccpath Path to gcc/g++ used to build LLVM
46# -cvstag Check out a specific CVS tag to build LLVM (useful for
47# testing release branches)
Reid Spencerece1f682007-07-02 06:19:57 +000048# -usecvs Check code out from the (old) CVS Repository instead of from
49# the standard Subversion repository.
Patrick Jenkinsfe030d72006-07-06 21:19:32 +000050# -target Specify the target triplet
51# -cflags Next argument specifies that C compilation options that
52# override the default.
53# -cxxflags Next argument specifies that C++ compilation options that
54# override the default.
55# -ldflags Next argument specifies that linker options that override
56# the default.
Patrick Jenkins215b48f2006-07-07 18:50:51 +000057# -compileflags Next argument specifies extra options passed to make when
58# building LLVM.
Patrick Jenkins0e9402f2006-08-11 23:02:09 +000059# -use-gmake Use gmake instead of the default make command to build
Patrick Jenkins1cd46912006-07-27 01:17:17 +000060# llvm and run tests.
Patrick Jenkinsfe030d72006-07-06 21:19:32 +000061#
62# ---------------- Options to configure llvm-test ----------------------------
Patrick Jenkins215b48f2006-07-07 18:50:51 +000063# -extraflags Next argument specifies extra options that are passed to
64# compile the tests.
65# -noexternals Do not run the external tests (for cases where povray
66# or SPEC are not installed)
67# -with-externals Specify a directory where the external tests are located.
Patrick Jenkins0e9402f2006-08-11 23:02:09 +000068# -submit-server Specifies a server to submit the test results too. If this
69# option is not specified it defaults to
70# llvm.org. This is basically just the address of the
71# webserver
72# -submit-script Specifies which script to call on the submit server. If
73# this option is not specified it defaults to
Jim Laskey6d8a1b72006-09-15 17:03:36 +000074# /nightlytest/NightlyTestAccept.php. This is basically
Patrick Jenkins0e9402f2006-08-11 23:02:09 +000075# everything after the www.yourserver.org.
Patrick Jenkinsfe030d72006-07-06 21:19:32 +000076#
77# CVSROOT is the CVS repository from which the tree will be checked out,
78# specified either in the full :method:user@host:/dir syntax, or
79# just /dir if using a local repo.
80# BUILDDIR is the directory where sources for this test run will be checked out
81# AND objects for this test run will be built. This directory MUST NOT
82# exist before the script is run; it will be created by the cvs checkout
83# process and erased (unless -noremove is specified; see above.)
84# WEBDIR is the directory into which the test results web page will be written,
85# AND in which the "index.html" is assumed to be a symlink to the most recent
86# copy of the results. This directory will be created if it does not exist.
87# LLVMGCCDIR is the directory in which the LLVM GCC Front End is installed
88# to. This is the same as you would have for a normal LLVM build.
89#
90##############################################################
91#
92# Getting environment variables
93#
94##############################################################
Reid Spencerfa34d7b2006-08-13 09:53:02 +000095my $HOME = $ENV{'HOME'};
Reid Spencer99e865a2007-04-07 04:41:16 +000096my $SVNURL = $ENV{"SVNURL"};
Reid Spencerc9a15d52007-06-26 17:08:16 +000097$SVNURL = 'https://llvm.org/svn/llvm-project' unless $SVNURL;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +000098my $CVSRootDir = $ENV{'CVSROOT'};
Reid Spencerfa34d7b2006-08-13 09:53:02 +000099$CVSRootDir = "/home/vadve/shared/PublicCVS" unless $CVSRootDir;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000100my $BuildDir = $ENV{'BUILDDIR'};
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000101$BuildDir = "$HOME/buildtest" unless $BuildDir;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000102my $WebDir = $ENV{'WEBDIR'};
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000103$WebDir = "$HOME/cvs/testresults-X86" unless $WebDir;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000104
105##############################################################
106#
107# Calculate the date prefix...
108#
109##############################################################
110@TIME = localtime;
111my $DATE = sprintf "%4d-%02d-%02d", $TIME[5]+1900, $TIME[4]+1, $TIME[3];
112my $DateString = strftime "%B %d, %Y", localtime;
113my $TestStartTime = gmtime() . "GMT<br>" . localtime() . " (local)";
114
115##############################################################
116#
117# Parse arguments...
118#
119##############################################################
120$CONFIGUREARGS="";
Patrick Jenkins49717a42006-07-21 01:39:42 +0000121$nickname="";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000122$NOTEST=0;
John Criswelleecd7112007-06-29 19:12:50 +0000123$USESVN=1;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000124$NORUNNINGTESTS=0;
Patrick Jenkins1cd46912006-07-27 01:17:17 +0000125$MAKECMD="make";
Patrick Jenkins0e9402f2006-08-11 23:02:09 +0000126$SUBMITSERVER = "llvm.org";
Jim Laskey6d8a1b72006-09-15 17:03:36 +0000127$SUBMITSCRIPT = "/nightlytest/NightlyTestAccept.php";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000128
129while (scalar(@ARGV) and ($_ = $ARGV[0], /^[-+]/)) {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000130 shift;
131 last if /^--$/; # Stop processing arguments on --
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000132
133 # List command line options here...
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000134 if (/^-nocheckout$/) { $NOCHECKOUT = 1; next; }
135 if (/^-nocvsstats$/) { $NOCVSSTATS = 1; next; }
136 if (/^-noremove$/) { $NOREMOVE = 1; next; }
137 if (/^-noremoveresults$/){ $NOREMOVERESULTS = 1; next; }
138 if (/^-notest$/) { $NOTEST = 1; $NORUNNINGTESTS = 1; next; }
139 if (/^-norunningtests$/) { $NORUNNINGTESTS = 1; next; }
140 if (/^-parallel$/) { $MAKEOPTS = "$MAKEOPTS -j2 -l3.0"; next; }
141 if (/^-release$/) { $MAKEOPTS = "$MAKEOPTS ENABLE_OPTIMIZED=1 ".
142 "OPTIMIZE_OPTION=-O2"; $BUILDTYPE="release"; next;}
Jim Laskey27b8ba02006-09-28 17:49:20 +0000143 if (/^-release-asserts$/){ $MAKEOPTS = "$MAKEOPTS ENABLE_OPTIMIZED=1 ".
144 "DISABLE-ASSERTIONS=1 ".
Reid Spencer93c456c2006-10-19 15:24:04 +0000145 "OPTIMIZE_OPTION=-O2";
146 $BUILDTYPE="release-asserts"; next;}
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000147 if (/^-enable-llcbeta$/) { $PROGTESTOPTS .= " ENABLE_LLCBETA=1"; next; }
Reid Spencer2bae1f52006-11-24 20:34:16 +0000148 if (/^-enable-lli$/) { $PROGTESTOPTS .= " ENABLE_LLI=1";
149 $CONFIGUREARGS .= " --enable-lli"; next; }
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000150 if (/^-disable-llc$/) { $PROGTESTOPTS .= " DISABLE_LLC=1";
151 $CONFIGUREARGS .= " --disable-llc_diffs"; next; }
152 if (/^-disable-jit$/) { $PROGTESTOPTS .= " DISABLE_JIT=1";
153 $CONFIGUREARGS .= " --disable-jit"; next; }
154 if (/^-disable-cbe$/) { $PROGTESTOPTS .= " DISABLE_CBE=1"; next; }
Evan Cheng2ba49a92007-11-10 01:33:27 +0000155 if (/^-test-opts$/) { $PROGTESTOPTS .= "$ARGV[0]"; shift; next; }
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000156 if (/^-verbose$/) { $VERBOSE = 1; next; }
157 if (/^-debug$/) { $DEBUG = 1; next; }
158 if (/^-nice$/) { $NICE = "nice "; next; }
159 if (/^-f2c$/) { $CONFIGUREARGS .= " --with-f2c=$ARGV[0]";
160 shift; next; }
161 if (/^-with-externals$/) { $CONFIGUREARGS .= " --with-externals=$ARGV[0]";
162 shift; next; }
163 if (/^-submit-server/) { $SUBMITSERVER = "$ARGV[0]"; shift; next; }
164 if (/^-submit-script/) { $SUBMITSCRIPT = "$ARGV[0]"; shift; next; }
165 if (/^-nickname$/) { $nickname = "$ARGV[0]"; shift; next; }
166 if (/^-gccpath/) { $CONFIGUREARGS .=
167 " CC=$ARGV[0]/gcc CXX=$ARGV[0]/g++";
168 $GCCPATH=$ARGV[0]; shift; next; }
169 else { $GCCPATH=""; }
170 if (/^-cvstag/) { $CVSCOOPT .= " -r $ARGV[0]"; shift; next; }
171 else { $CVSCOOPT="";}
Reid Spencerece1f682007-07-02 06:19:57 +0000172 if (/^-usecvs/) { $USESVN = 0; }
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000173 if (/^-target/) { $CONFIGUREARGS .= " --target=$ARGV[0]";
174 shift; next; }
175 if (/^-cflags/) { $MAKEOPTS = "$MAKEOPTS C.Flags=\'$ARGV[0]\'";
176 shift; next; }
177 if (/^-cxxflags/) { $MAKEOPTS = "$MAKEOPTS CXX.Flags=\'$ARGV[0]\'";
178 shift; next; }
179 if (/^-ldflags/) { $MAKEOPTS = "$MAKEOPTS LD.Flags=\'$ARGV[0]\'";
180 shift; next; }
181 if (/^-compileflags/) { $MAKEOPTS = "$MAKEOPTS $ARGV[0]"; shift; next; }
182 if (/^-use-gmake/) { $MAKECMD = "gmake"; shift; next; }
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000183 if (/^-extraflags/) { $CONFIGUREARGS .=
184 " --with-extra-options=\'$ARGV[0]\'"; shift; next;}
185 if (/^-noexternals$/) { $NOEXTERNALS = 1; next; }
186 if (/^-nodejagnu$/) { $NODEJAGNU = 1; next; }
187 if (/^-nobuild$/) { $NOBUILD = 1; next; }
188 print "Unknown option: $_ : ignoring!\n";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000189}
190
191if ($ENV{'LLVMGCCDIR'}) {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000192 $CONFIGUREARGS .= " --with-llvmgccdir=" . $ENV{'LLVMGCCDIR'};
Tanya Lattner849c9a22007-04-13 04:36:48 +0000193 $LLVMGCCPATH = $ENV{'LLVMGCCDIR'};
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000194}
Tanya Lattner849c9a22007-04-13 04:36:48 +0000195else {
196 $LLVMGCCPATH = "";
197}
198
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000199if ($CONFIGUREARGS !~ /--disable-jit/) {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000200 $CONFIGUREARGS .= " --enable-jit";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000201}
202
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000203if (@ARGV != 0 and @ARGV != 3 and $VERBOSE) {
204 foreach $x (@ARGV) {
205 print "$x\n";
206 }
207 print "Must specify 0 or 3 options!";
Patrick Jenkinsf58473f2006-07-27 01:03:46 +0000208}
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000209
210if (@ARGV == 3) {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000211 $CVSRootDir = $ARGV[0];
212 $BuildDir = $ARGV[1];
213 $WebDir = $ARGV[2];
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000214}
215
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000216if ($CVSRootDir eq "" or
217 $BuildDir eq "" or
218 $WebDir eq "") {
219 die("please specify a cvs root directory, a build directory, and a ".
Patrick Jenkinsf58473f2006-07-27 01:03:46 +0000220 "web directory");
221 }
222
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000223if ($nickname eq "") {
224 die ("Please invoke NewNightlyTest.pl with command line option " .
225 "\"-nickname <nickname>\"");
Patrick Jenkins514e2582006-07-20 22:28:43 +0000226}
Patrick Jenkins1cd46912006-07-27 01:17:17 +0000227
Jim Laskey27b8ba02006-09-28 17:49:20 +0000228if ($BUILDTYPE ne "release" && $BUILDTYPE ne "release-asserts") {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000229 $BUILDTYPE = "debug";
Patrick Jenkins26ba6092006-07-23 22:57:28 +0000230}
Patrick Jenkins514e2582006-07-20 22:28:43 +0000231
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000232##############################################################
233#
234#define the file names we'll use
235#
236##############################################################
237my $Prefix = "$WebDir/$DATE";
238my $BuildLog = "$Prefix-Build-Log.txt";
Reid Spencer99e865a2007-04-07 04:41:16 +0000239my $COLog = "$Prefix-CVS-Log.txt";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000240my $OldenTestsLog = "$Prefix-Olden-tests.txt";
241my $SingleSourceLog = "$Prefix-SingleSource-ProgramTest.txt.gz";
242my $MultiSourceLog = "$Prefix-MultiSource-ProgramTest.txt.gz";
Patrick Jenkins26ba6092006-07-23 22:57:28 +0000243my $ExternalLog = "$Prefix-External-ProgramTest.txt.gz";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000244my $DejagnuLog = "$Prefix-Dejagnu-testrun.log";
245my $DejagnuSum = "$Prefix-Dejagnu-testrun.sum";
246my $DejagnuTestsLog = "$Prefix-DejagnuTests-Log.txt";
247if (! -d $WebDir) {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000248 mkdir $WebDir, 0777;
Patrick Jenkins03137752006-08-21 20:45:57 +0000249 if($VERBOSE){
250 warn "$WebDir did not exist; creating it.\n";
251 }
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000252}
253
254if ($VERBOSE) {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000255 print "INITIALIZED\n";
Reid Spencer99e865a2007-04-07 04:41:16 +0000256 if ($USESVN) {
257 print "SVN URL = $SVNURL\n";
258 } else {
259 print "CVS Root = $CVSRootDir\n";
260 }
261 print "COLog = $COLog\n";
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000262 print "BuildDir = $BuildDir\n";
263 print "WebDir = $WebDir\n";
264 print "Prefix = $Prefix\n";
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000265 print "BuildLog = $BuildLog\n";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000266}
267
268##############################################################
269#
270# Helper functions
271#
272##############################################################
273sub GetDir {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000274 my $Suffix = shift;
275 opendir DH, $WebDir;
276 my @Result = reverse sort grep !/$DATE/, grep /[-0-9]+$Suffix/, readdir DH;
277 closedir DH;
278 return @Result;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000279}
280
281#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
282#
283# DiffFiles - Diff the current version of the file against the last version of
284# the file, reporting things added and removed. This is used to report, for
285# example, added and removed warnings. This returns a pair (added, removed)
286#
287#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
288sub DiffFiles {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000289 my $Suffix = shift;
290 my @Others = GetDir $Suffix;
291 if (@Others == 0) { # No other files? We added all entries...
292 return (`cat $WebDir/$DATE$Suffix`, "");
293 }
294# Diff the files now...
295 my @Diffs = split "\n", `diff $WebDir/$DATE$Suffix $WebDir/$Others[0]`;
296 my $Added = join "\n", grep /^</, @Diffs;
297 my $Removed = join "\n", grep /^>/, @Diffs;
298 $Added =~ s/^< //gm;
299 $Removed =~ s/^> //gm;
300 return ($Added, $Removed);
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000301}
302
303#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
304#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
305sub GetRegex { # (Regex with ()'s, value)
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000306 $_[1] =~ /$_[0]/m;
307 return $1
308 if (defined($1));
309 return "0";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000310}
311
312#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
313#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
314sub GetRegexNum {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000315 my ($Regex, $Num, $Regex2, $File) = @_;
316 my @Items = split "\n", `grep '$Regex' $File`;
317 return GetRegex $Regex2, $Items[$Num];
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000318}
319
320#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
321#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
322sub ChangeDir { # directory, logical name
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000323 my ($dir,$name) = @_;
324 chomp($dir);
325 if ( $VERBOSE ) { print "Changing To: $name ($dir)\n"; }
326 $result = chdir($dir);
327 if (!$result) {
328 print "ERROR!!! Cannot change directory to: $name ($dir) because $!";
329 return false;
330 }
331 return true;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000332}
333
334#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
335#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
336sub ReadFile {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000337 if (open (FILE, $_[0])) {
338 undef $/;
339 my $Ret = <FILE>;
340 close FILE;
341 $/ = '\n';
342 return $Ret;
343 } else {
344 print "Could not open file '$_[0]' for reading!\n";
345 return "";
346 }
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000347}
348
349#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
350#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
351sub WriteFile { # (filename, contents)
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000352 open (FILE, ">$_[0]") or die "Could not open file '$_[0]' for writing!\n";
353 print FILE $_[1];
354 close FILE;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000355}
356
357#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
358#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
359sub CopyFile { #filename, newfile
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000360 my ($file, $newfile) = @_;
361 chomp($file);
362 if ($VERBOSE) { print "Copying $file to $newfile\n"; }
363 copy($file, $newfile);
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000364}
365
366#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
367#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
368sub AddRecord {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000369 my ($Val, $Filename,$WebDir) = @_;
370 my @Records;
371 if (open FILE, "$WebDir/$Filename") {
372 @Records = grep !/$DATE/, split "\n", <FILE>;
373 close FILE;
374 }
375 push @Records, "$DATE: $Val";
376 WriteFile "$WebDir/$Filename", (join "\n", @Records) . "\n";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000377}
378
379#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
380#
381# FormatTime - Convert a time from 1m23.45 into 83.45
382#
383#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
384sub FormatTime {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000385 my $Time = shift;
386 if ($Time =~ m/([0-9]+)m([0-9.]+)/) {
387 $Time = sprintf("%7.4f", $1*60.0+$2);
388 }
389 return $Time;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000390}
391
392#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick Jenkinsb9c65eb2006-08-18 18:00:21 +0000393#
394# This function is meant to read in the dejagnu sum file and
395# return a string with only the results (i.e. PASS/FAIL/XPASS/
396# XFAIL).
397#
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000398#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
399sub GetDejagnuTestResults { # (filename, log)
Patrick Jenkinsb9c65eb2006-08-18 18:00:21 +0000400 my ($filename, $DejagnuLog) = @_;
401 my @lines;
402 $/ = "\n"; #Make sure we're going line at a time.
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000403
Patrick Jenkinsb9c65eb2006-08-18 18:00:21 +0000404 if( $VERBOSE) { print "DEJAGNU TEST RESULTS:\n"; }
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000405
Patrick Jenkinsb9c65eb2006-08-18 18:00:21 +0000406 if (open SRCHFILE, $filename) {
407 # Process test results
408 while ( <SRCHFILE> ) {
409 if ( length($_) > 1 ) {
410 chomp($_);
Jim Laskey01d7bcf2006-09-20 09:20:22 +0000411 if ( m/^(PASS|XPASS|FAIL|XFAIL): .*\/llvm\/test\/(.*)$/ ) {
412 push(@lines, "$1: test/$2");
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000413 }
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000414 }
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000415 }
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000416 }
Patrick Jenkinsb9c65eb2006-08-18 18:00:21 +0000417 close SRCHFILE;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000418
Patrick Jenkinsb9c65eb2006-08-18 18:00:21 +0000419 my $content = join("\n", @lines);
420 return $content;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000421}
422
423
Patrick Jenkinsb9c65eb2006-08-18 18:00:21 +0000424
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000425#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
426#
427# This function acts as a mini web browswer submitting data
428# to our central server via the post method
429#
430#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
431sub SendData{
432 $host = $_[0];
433 $file = $_[1];
434 $variables=$_[2];
435
436 $port=80;
437 $socketaddr= sockaddr_in $port, inet_aton $host or die "Bad hostname\n";
Patrick Jenkinsadea55e2006-07-17 16:41:19 +0000438 socket SOCK, PF_INET, SOCK_STREAM, getprotobyname('tcp') or
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000439 die "Bad socket\n";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000440 connect SOCK, $socketaddr or die "Bad connection\n";
441 select((select(SOCK), $| = 1)[0]);
442
443 #creating content here
444 my $content;
445 foreach $key (keys (%$variables)){
446 $value = $variables->{$key};
447 $value =~ s/([^A-Za-z0-9])/sprintf("%%%02X", ord($1))/seg;
448 $content .= "$key=$value&";
449 }
450
451 $length = length($content);
452
453 my $send= "POST $file HTTP/1.0\n";
Lauro Ramos Venancio46040232007-05-03 14:05:07 +0000454 $send.= "Host: $host\n";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000455 $send.= "Content-Type: application/x-www-form-urlencoded\n";
456 $send.= "Content-length: $length\n\n";
457 $send.= "$content";
458
Patrick Jenkinse8501eb2006-08-07 01:54:37 +0000459 print SOCK $send;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000460 my $result;
461 while(<SOCK>){
462 $result .= $_;
463 }
464 close(SOCK);
465
466 my $sentdata="";
Patrick Jenkins4c4e3562006-07-07 21:40:34 +0000467 foreach $x (keys (%$variables)){
Patrick Jenkins7267bd62006-07-10 18:35:41 +0000468 $value = $variables->{$x};
469 $sentdata.= "$x => $value\n";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000470 }
471 WriteFile "$Prefix-sentdata.txt", $sentdata;
Patrick Jenkins4c4e3562006-07-07 21:40:34 +0000472
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000473
474 return $result;
475}
476
Patrick Jenkins215b48f2006-07-07 18:50:51 +0000477##############################################################
478#
479# Getting Start timestamp
480#
481##############################################################
Patrick Jenkinsb67e1182006-07-21 21:43:09 +0000482$starttime = `date "+20%y-%m-%d %H:%M:%S"`;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000483
484##############################################################
485#
486# Create the CVS repository directory
487#
488##############################################################
489if (!$NOCHECKOUT) {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000490 if (-d $BuildDir) {
491 if (!$NOREMOVE) {
492 if ( $VERBOSE ) {
493 print "Build directory exists! Removing it\n";
494 }
495 system "rm -rf $BuildDir";
Reid Spencer99e865a2007-04-07 04:41:16 +0000496 mkdir $BuildDir or die "Could not create checkout directory $BuildDir!";
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000497 } else {
Jim Laskey6d8a1b72006-09-15 17:03:36 +0000498 if ( $VERBOSE ) {
499 print "Build directory exists!\n";
500 }
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000501 }
Jim Laskey6d8a1b72006-09-15 17:03:36 +0000502 } else {
Reid Spencer99e865a2007-04-07 04:41:16 +0000503 mkdir $BuildDir or die "Could not create checkout directory $BuildDir!";
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000504 }
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000505}
Reid Spencer99e865a2007-04-07 04:41:16 +0000506ChangeDir( $BuildDir, "checkout directory" );
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000507
508
509##############################################################
510#
Reid Spencer99e865a2007-04-07 04:41:16 +0000511# Check out the llvm tree, using either SVN or CVS
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000512#
513##############################################################
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000514if (!$NOCHECKOUT) {
Reid Spencerceb9d782007-07-02 06:16:32 +0000515 if ( $VERBOSE ) { print "CHECKOUT STAGE:\n"; }
Reid Spencer99e865a2007-04-07 04:41:16 +0000516 if ($USESVN) {
517 my $SVNCMD = "$NICE svn co $SVNURL";
518 if ($VERBOSE) {
Reid Spencer1c01cf92007-06-29 03:12:42 +0000519 print "( time -p $SVNCMD/llvm/trunk llvm; cd llvm/projects ; " .
520 "$SVNCMD/test-suite/trunk llvm-test ) > $COLog 2>&1\n";
Reid Spencer99e865a2007-04-07 04:41:16 +0000521 }
Reid Spencerceb9d782007-07-02 06:16:32 +0000522 system "( time -p $SVNCMD/llvm/trunk llvm; cd llvm/projects ; " .
523 "$SVNCMD/test-suite/trunk llvm-test ) > $COLog 2>&1\n";
Reid Spencer99e865a2007-04-07 04:41:16 +0000524 } else {
525 my $CVSOPT = "";
526 $CVSOPT = "-z3" # Use compression if going over ssh.
527 if $CVSRootDir =~ /^:ext:/;
528 my $CVSCMD = "$NICE cvs $CVSOPT -d $CVSRootDir co -P $CVSCOOPT";
Reid Spencerceb9d782007-07-02 06:16:32 +0000529 if ($VERBOSE) {
530 print "( time -p $CVSCMD llvm; cd llvm/projects ; " .
531 "$CVSCMD llvm-test ) > $COLog 2>&1\n";
532 }
Reid Spencer99e865a2007-04-07 04:41:16 +0000533 system "( time -p $CVSCMD llvm; cd llvm/projects ; " .
Reid Spencerb5fda752007-04-07 05:20:07 +0000534 "$CVSCMD llvm-test ) > $COLog 2>&1\n";
Reid Spencer99e865a2007-04-07 04:41:16 +0000535 }
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000536}
Reid Spencer99e865a2007-04-07 04:41:16 +0000537ChangeDir( $BuildDir , "Checkout directory") ;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000538ChangeDir( "llvm" , "llvm source directory") ;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000539
540##############################################################
541#
542# Get some static statistics about the current state of CVS
543#
544# This can probably be put on the server side
545#
546##############################################################
Reid Spencer99e865a2007-04-07 04:41:16 +0000547my $CheckoutTime_Wall = GetRegex "([0-9.]+)", `grep '^real' $COLog`;
548my $CheckoutTime_User = GetRegex "([0-9.]+)", `grep '^user' $COLog`;
549my $CheckoutTime_Sys = GetRegex "([0-9.]+)", `grep '^sys' $COLog`;
550my $CheckoutTime_CPU = $CVSCheckoutTime_User + $CVSCheckoutTime_Sys;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000551
Reid Spencer99e865a2007-04-07 04:41:16 +0000552my $NumFilesInCVS = 0;
553my $NumDirsInCVS = 0;
554if ($USESVN) {
555 $NumFilesInCVS = `egrep '^A' $COLog | wc -l` + 0;
556 $NumDirsInCVS = `sed -e 's#/[^/]*$##' $COLog | sort | uniq | wc -l` + 0;
557} else {
558 $NumFilesInCVS = `egrep '^U' $COLog | wc -l` + 0;
559 $NumDirsInCVS = `egrep '^cvs (checkout|server|update):' $COLog | wc -l` + 0;
560}
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000561
562##############################################################
563#
564# Extract some information from the CVS history... use a hash so no duplicate
565# stuff is stored. This gets the history from the previous days worth
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000566# of cvs activity and parses it.
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000567#
568##############################################################
569
Reid Spencer99e865a2007-04-07 04:41:16 +0000570# This just computes a reasonably accurate #of seconds since 2000. It doesn't
571# have to be perfect as its only used for comparing date ranges within a couple
572# of days.
573sub ConvertToSeconds {
574 my ($sec, $min, $hour, $day, $mon, $yr) = @_;
575 my $Result = ($yr - 2000) * 12;
576 $Result += $mon;
577 $Result *= 31;
578 $Result += $day;
579 $Result *= 24;
580 $Result += $hour;
581 $Result *= 60;
582 $Result += $min;
583 $Result *= 60;
584 $Result += $sec;
585 return $Result;
586}
587
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000588my (%AddedFiles, %ModifiedFiles, %RemovedFiles, %UsersCommitted, %UsersUpdated);
589
Reid Spencer99e865a2007-04-07 04:41:16 +0000590if (!$NOCVSSTATS) {
591 if ($VERBOSE) { print "CHANGE HISTORY ANALYSIS STAGE\n"; }
Reid Spencer776964a2007-04-04 06:59:36 +0000592
Reid Spencer99e865a2007-04-07 04:41:16 +0000593 if ($USESVN) {
594 @SVNHistory = split /<logentry/, `svn log --xml --verbose -r{$DATE}:HEAD`;
595 # Skip very first entry because it is the XML header cruft
596 shift @SVNHistory;
597 my $Now = time();
598 foreach $Record (@SVNHistory) {
599 my @Lines = split "\n", $Record;
600 my ($Author, $Date, $Revision);
601 # Get the date and see if its one we want to process.
602 my ($Year, $Month, $Day, $Hour, $Min, $Sec);
603 if ($Lines[3] =~ /<date>(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})/){
604 $Year = $1; $Month = $2; $Day = $3; $Hour = $4; $Min = $5; $Sec = $6;
605 }
606 my $Then = ConvertToSeconds($Sec, $Min, $Hour, $Day, $Month, $Year);
607 # Get the current date and compute when "yesterday" is.
608 my ($NSec, $NMin, $NHour, $NDay, $NMon, $NYear) = gmtime();
609 my $Now = ConvertToSeconds( $NSec, $NMin, $NHour, $NDay, $NMon, $NYear);
610 if (($Now - 24*60*60) > $Then) {
611 next;
612 }
613 if ($Lines[1] =~ / revision="([0-9]*)">/) {
614 $Revision = $1;
615 }
616 if ($Lines[2] =~ /<author>([^<]*)<\/author>/) {
617 $Author = $1;
618 }
619 $UsersCommitted{$Author} = 1;
620 $Date = $Year . "-" . $Month . "-" . $Day;
621 $Time = $Hour . ":" . $Min . ":" . $Sec;
622 print "Rev: $Revision, Author: $Author, Date: $Date, Time: $Time\n";
623 for ($i = 6; $i < $#Lines; $i += 2 ) {
624 if ($Lines[$i] =~ /^ action="(.)">([^<]*)</) {
625 if ($1 == "A") {
626 $AddedFiles{$2} = 1;
627 } elsif ($1 == 'D') {
628 $RemovedFiles{$2} = 1;
629 } elsif ($1 == 'M' || $1 == 'R' || $1 == 'C') {
630 $ModifiedFiles{$2} = 1;
631 } else {
632 print "UNMATCHABLE: $Lines[$i]\n";
633 }
634 }
635 }
636 }
637 } else {
638 @CVSHistory = split "\n", `cvs history -D '1 day ago' -a -xAMROCGUW`;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000639#print join "\n", @CVSHistory; print "\n";
640
Reid Spencer99e865a2007-04-07 04:41:16 +0000641 my $DateRE = '[-/:0-9 ]+\+[0-9]+';
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000642
643# Loop over every record from the CVS history, filling in the hashes.
Reid Spencer99e865a2007-04-07 04:41:16 +0000644 foreach $File (@CVSHistory) {
645 my ($Type, $Date, $UID, $Rev, $Filename);
646 if ($File =~ /([AMRUGC]) ($DateRE) ([^ ]+) +([^ ]+) +([^ ]+) +([^ ]+)/) {
647 ($Type, $Date, $UID, $Rev, $Filename) = ($1, $2, $3, $4, "$6/$5");
648 } elsif ($File =~ /([W]) ($DateRE) ([^ ]+)/) {
649 ($Type, $Date, $UID, $Rev, $Filename) = ($1, $2, $3, "", "");
650 } elsif ($File =~ /([O]) ($DateRE) ([^ ]+) +([^ ]+)/) {
651 ($Type, $Date, $UID, $Rev, $Filename) = ($1, $2, $3, "", "$4/");
652 } else {
653 print "UNMATCHABLE: $File\n";
654 next;
655 }
656 # print "$File\nTy = $Type Date = '$Date' UID=$UID Rev=$Rev File = '$Filename'\n";
657
658 if ($Filename =~ /^llvm/) {
659 if ($Type eq 'M') { # Modified
660 $ModifiedFiles{$Filename} = 1;
661 $UsersCommitted{$UID} = 1;
662 } elsif ($Type eq 'A') { # Added
663 $AddedFiles{$Filename} = 1;
664 $UsersCommitted{$UID} = 1;
665 } elsif ($Type eq 'R') { # Removed
666 $RemovedFiles{$Filename} = 1;
667 $UsersCommitted{$UID} = 1;
668 } else {
669 $UsersUpdated{$UID} = 1;
670 }
671 }
672 }
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000673
Reid Spencer99e865a2007-04-07 04:41:16 +0000674 my $TestError = 1;
675 } #$USESVN
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000676}#!NOCVSSTATS
677
678my $CVSAddedFiles = join "\n", sort keys %AddedFiles;
679my $CVSModifiedFiles = join "\n", sort keys %ModifiedFiles;
680my $CVSRemovedFiles = join "\n", sort keys %RemovedFiles;
681my $UserCommitList = join "\n", sort keys %UsersCommitted;
682my $UserUpdateList = join "\n", sort keys %UsersUpdated;
683
684##############################################################
685#
686# Build the entire tree, saving build messages to the build log
687#
688##############################################################
689if (!$NOCHECKOUT && !$NOBUILD) {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000690 my $EXTRAFLAGS = "--enable-spec --with-objroot=.";
691 if ( $VERBOSE ) {
692 print "CONFIGURE STAGE:\n";
693 print "(time -p $NICE ./configure $CONFIGUREARGS $EXTRAFLAGS) " .
694 "> $BuildLog 2>&1\n";
695 }
696 system "(time -p $NICE ./configure $CONFIGUREARGS $EXTRAFLAGS) " .
697 "> $BuildLog 2>&1";
698 if ( $VERBOSE ) {
699 print "BUILD STAGE:\n";
700 print "(time -p $NICE $MAKECMD $MAKEOPTS) >> $BuildLog 2>&1\n";
701 }
702 # Build the entire tree, capturing the output into $BuildLog
703 system "(time -p $NICE $MAKECMD $MAKEOPTS) >> $BuildLog 2>&1";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000704}
705
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000706##############################################################
707#
708# Get some statistics about the build...
709#
710##############################################################
711#this can de done on server
712#my @Linked = split '\n', `grep Linking $BuildLog`;
713#my $NumExecutables = scalar(grep(/executable/, @Linked));
714#my $NumLibraries = scalar(grep(!/executable/, @Linked));
715#my $NumObjects = `grep ']\: Compiling ' $BuildLog | wc -l` + 0;
716
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000717# Get the number of lines of source code. Must be here after the build is done
718# because countloc.sh uses the llvm-config script which must be built.
Patrick Jenkinsb993b0a2006-08-16 22:18:41 +0000719my $LOC = `utils/countloc.sh -topdir $BuildDir/llvm`;
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000720
721# Get the time taken by the configure script
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000722my $ConfigTimeU = GetRegexNum "^user", 0, "([0-9.]+)", "$BuildLog";
723my $ConfigTimeS = GetRegexNum "^sys", 0, "([0-9.]+)", "$BuildLog";
724my $ConfigTime = $ConfigTimeU+$ConfigTimeS; # ConfigTime = User+System
725my $ConfigWallTime = GetRegexNum "^real", 0,"([0-9.]+)","$BuildLog";
726
727$ConfigTime=-1 unless $ConfigTime;
728$ConfigWallTime=-1 unless $ConfigWallTime;
729
730my $BuildTimeU = GetRegexNum "^user", 1, "([0-9.]+)", "$BuildLog";
731my $BuildTimeS = GetRegexNum "^sys", 1, "([0-9.]+)", "$BuildLog";
732my $BuildTime = $BuildTimeU+$BuildTimeS; # BuildTime = User+System
733my $BuildWallTime = GetRegexNum "^real", 1, "([0-9.]+)","$BuildLog";
734
735$BuildTime=-1 unless $BuildTime;
736$BuildWallTime=-1 unless $BuildWallTime;
737
738my $BuildError = 0, $BuildStatus = "OK";
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000739if ($NOBUILD) {
740 $BuildStatus = "Skipped by user";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000741}
Patrick Jenkinsf58473f2006-07-27 01:03:46 +0000742elsif (`grep '^$MAKECMD\[^:]*: .*Error' $BuildLog | wc -l` + 0 ||
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000743 `grep '^$MAKECMD: \*\*\*.*Stop.' $BuildLog | wc -l`+0) {
744 $BuildStatus = "Error: compilation aborted";
745 $BuildError = 1;
746 if( $VERBOSE) { print "\n***ERROR BUILDING TREE\n\n"; }
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000747}
748if ($BuildError) { $NODEJAGNU=1; }
749
Patrick Jenkins169357e2006-07-23 21:38:07 +0000750my $a_file_sizes="";
751my $o_file_sizes="";
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000752if (!$BuildError) {
753 print "Organizing size of .o and .a files\n"
754 if ( $VERBOSE );
755 ChangeDir( "$BuildDir/llvm", "Build Directory" );
756 $afiles.= `find utils/ -iname '*.a' -ls`;
757 $afiles.= `find lib/ -iname '*.a' -ls`;
758 $afiles.= `find tools/ -iname '*.a' -ls`;
759 if($BUILDTYPE eq "release"){
Jim Laskey7a8efce2006-09-29 17:31:45 +0000760 $afiles.= `find Release/ -iname '*.a' -ls`;
Jim Laskey27b8ba02006-09-28 17:49:20 +0000761 } elsif($BUILDTYPE eq "release-asserts") {
762 $afiles.= `find Release-Asserts/ -iname '*.a' -ls`;
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000763 } else {
764 $afiles.= `find Debug/ -iname '*.a' -ls`;
765 }
766
767 $ofiles.= `find utils/ -iname '*.o' -ls`;
768 $ofiles.= `find lib/ -iname '*.o' -ls`;
769 $ofiles.= `find tools/ -iname '*.o' -ls`;
770 if($BUILDTYPE eq "release"){
Jim Laskey7a8efce2006-09-29 17:31:45 +0000771 $ofiles.= `find Release/ -iname '*.o' -ls`;
Jim Laskey27b8ba02006-09-28 17:49:20 +0000772 } elsif($BUILDTYPE eq "release-asserts") {
773 $ofiles.= `find Release-Asserts/ -iname '*.o' -ls`;
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000774 } else {
775 $ofiles.= `find Debug/ -iname '*.o' -ls`;
776 }
777
778 @AFILES = split "\n", $afiles;
779 $a_file_sizes="";
780 foreach $x (@AFILES){
781 $x =~ m/.+\s+.+\s+.+\s+.+\s+.+\s+.+\s+(.+)\s+.+\s+.+\s+.+\s+(.+)/;
782 $a_file_sizes.="$1 $2 $BUILDTYPE\n";
783 }
784 @OFILES = split "\n", $ofiles;
785 $o_file_sizes="";
786 foreach $x (@OFILES){
787 $x =~ m/.+\s+.+\s+.+\s+.+\s+.+\s+.+\s+(.+)\s+.+\s+.+\s+.+\s+(.+)/;
788 $o_file_sizes.="$1 $2 $BUILDTYPE\n";
789 }
790} else {
791 $a_file_sizes="No data due to a bad build.";
792 $o_file_sizes="No data due to a bad build.";
Patrick Jenkins169357e2006-07-23 21:38:07 +0000793}
Patrick Jenkins169357e2006-07-23 21:38:07 +0000794
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000795##############################################################
796#
797# Running dejagnu tests
798#
799##############################################################
Patrick Jenkinsb9c65eb2006-08-18 18:00:21 +0000800my $DejangnuTestResults=""; # String containing the results of the dejagnu
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000801my $dejagnu_output = "$DejagnuTestsLog";
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000802if (!$NODEJAGNU) {
803 if($VERBOSE) {
804 print "DEJAGNU FEATURE/REGRESSION TEST STAGE:\n";
805 print "(time -p $MAKECMD $MAKEOPTS check) > $dejagnu_output 2>&1\n";
806 }
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000807
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000808 #Run the feature and regression tests, results are put into testrun.sum
809 #Full log in testrun.log
810 system "(time -p $MAKECMD $MAKEOPTS check) > $dejagnu_output 2>&1";
811
812 #Copy the testrun.log and testrun.sum to our webdir
813 CopyFile("test/testrun.log", $DejagnuLog);
814 CopyFile("test/testrun.sum", $DejagnuSum);
815 #can be done on server
816 $DejagnuTestResults = GetDejagnuTestResults($DejagnuSum, $DejagnuLog);
817 $unexpfail_tests = $DejagnuTestResults;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000818}
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000819
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000820#Extract time of dejagnu tests
821my $DejagnuTimeU = GetRegexNum "^user", 0, "([0-9.]+)", "$dejagnu_output";
822my $DejagnuTimeS = GetRegexNum "^sys", 0, "([0-9.]+)", "$dejagnu_output";
823$DejagnuTime = $DejagnuTimeU+$DejagnuTimeS; # DejagnuTime = User+System
824$DejagnuWallTime = GetRegexNum "^real", 0,"([0-9.]+)","$dejagnu_output";
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000825$DejagnuTestResults =
826 "Dejagnu skipped by user choice." unless $DejagnuTestResults;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000827$DejagnuTime = "0.0" unless $DejagnuTime;
828$DejagnuWallTime = "0.0" unless $DejagnuWallTime;
829
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000830##############################################################
831#
832# Get warnings from the build
833#
834##############################################################
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000835if (!$NODEJAGNU) {
836 if ( $VERBOSE ) { print "BUILD INFORMATION COLLECTION STAGE\n"; }
837 my @Warn = split "\n", `egrep 'warning:|Entering dir' $BuildLog`;
838 my @Warnings;
839 my $CurDir = "";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000840
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000841 foreach $Warning (@Warn) {
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000842 if ($Warning =~ m/Entering directory \`([^\`]+)\'/) {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000843 $CurDir = $1; # Keep track of directory warning is in...
844 # Remove buildir prefix if included
845 if ($CurDir =~ m#$BuildDir/llvm/(.*)#) { $CurDir = $1; }
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000846 } else {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000847 push @Warnings, "$CurDir/$Warning"; # Add directory to warning...
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000848 }
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000849 }
850 my $WarningsFile = join "\n", @Warnings;
851 $WarningsFile =~ s/:[0-9]+:/::/g;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000852
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000853 # Emit the warnings file, so we can diff...
854 WriteFile "$WebDir/$DATE-Warnings.txt", $WarningsFile . "\n";
855 my ($WarningsAdded, $WarningsRemoved) = DiffFiles "-Warnings.txt";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000856
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000857 # Output something to stdout if something has changed
858 #print "ADDED WARNINGS:\n$WarningsAdded\n\n" if (length $WarningsAdded);
859 #print "REMOVED WARNINGS:\n$WarningsRemoved\n\n" if (length $WarningsRemoved);
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000860
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000861 #my @TmpWarningsAdded = split "\n", $WarningsAdded; ~PJ on upgrade
862 #my @TmpWarningsRemoved = split "\n", $WarningsRemoved; ~PJ on upgrade
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000863
864} #endif !NODEGAGNU
865
866##############################################################
867#
868# If we built the tree successfully, run the nightly programs tests...
869#
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000870# A set of tests to run is passed in (i.e. "SingleSource" "MultiSource"
871# "External")
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000872#
873##############################################################
874sub TestDirectory {
Patrick Jenkinsad6f7582006-08-22 18:11:19 +0000875 my $SubDir = shift;
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000876 ChangeDir( "$BuildDir/llvm/projects/llvm-test/$SubDir",
877 "Programs Test Subdirectory" ) || return ("", "");
878
879 my $ProgramTestLog = "$Prefix-$SubDir-ProgramTest.txt";
880
881 # Run the programs tests... creating a report.nightly.csv file
882 if (!$NOTEST) {
883 if( $VERBOSE) {
884 print "$MAKECMD -k $MAKEOPTS $PROGTESTOPTS report.nightly.csv ".
885 "TEST=nightly > $ProgramTestLog 2>&1\n";
886 }
887 system "$MAKECMD -k $MAKEOPTS $PROGTESTOPTS report.nightly.csv ".
Patrick Jenkins59d1a662006-07-27 18:28:50 +0000888 "TEST=nightly > $ProgramTestLog 2>&1";
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000889 $llcbeta_options=`$MAKECMD print-llcbeta-option`;
890 }
891
Patrick Jenkins59d1a662006-07-27 18:28:50 +0000892 my $ProgramsTable;
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000893 if (`grep '^$MAKECMD\[^:]: .*Error' $ProgramTestLog | wc -l` + 0) {
Patrick Jenkins59d1a662006-07-27 18:28:50 +0000894 $TestError = 1;
895 $ProgramsTable="Error running test $SubDir\n";
896 print "ERROR TESTING\n";
897 } elsif (`grep '^$MAKECMD\[^:]: .*No rule to make target' $ProgramTestLog | wc -l` + 0) {
898 $TestError = 1;
899 $ProgramsTable="Makefile error running tests $SubDir!\n";
900 print "ERROR TESTING\n";
901 } else {
902 $TestError = 0;
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000903 #
904 # Create a list of the tests which were run...
905 #
906 system "egrep 'TEST-(PASS|FAIL)' < $ProgramTestLog ".
Patrick Jenkins4b7f7aa2006-08-17 22:11:03 +0000907 "| sort > $Prefix-$SubDir-Tests.txt";
Patrick Jenkins59d1a662006-07-27 18:28:50 +0000908 }
909 $ProgramsTable = ReadFile "report.nightly.csv";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000910
Patrick Jenkins59d1a662006-07-27 18:28:50 +0000911 ChangeDir( "../../..", "Programs Test Parent Directory" );
912 return ($ProgramsTable, $llcbeta_options);
Patrick Jenkins9e384ab2006-08-14 16:07:14 +0000913} #end sub TestDirectory
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000914
Patrick Jenkins4b7f7aa2006-08-17 22:11:03 +0000915##############################################################
916#
917# Calling sub TestDirectory
918#
919##############################################################
Patrick Jenkinsc281b0d2006-07-27 19:00:01 +0000920if (!$BuildError) {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000921 if ( $VERBOSE ) {
Patrick Jenkinse631c4a2006-08-04 17:55:01 +0000922 print "SingleSource TEST STAGE\n";
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000923 }
924 ($SingleSourceProgramsTable, $llcbeta_options) =
925 TestDirectory("SingleSource");
Patrick Jenkins4b7f7aa2006-08-17 22:11:03 +0000926 WriteFile "$Prefix-SingleSource-Performance.txt", $SingleSourceProgramsTable;
Patrick Jenkins4257ccb2006-08-08 02:03:53 +0000927 if ( $VERBOSE ) {
Patrick Jenkins4b7f7aa2006-08-17 22:11:03 +0000928 print "MultiSource TEST STAGE\n";
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000929 }
930 ($MultiSourceProgramsTable, $llcbeta_options) = TestDirectory("MultiSource");
Patrick Jenkins4b7f7aa2006-08-17 22:11:03 +0000931 WriteFile "$Prefix-MultiSource-Performance.txt", $MultiSourceProgramsTable;
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000932 if ( ! $NOEXTERNALS ) {
933 if ( $VERBOSE ) {
934 print "External TEST STAGE\n";
935 }
936 ($ExternalProgramsTable, $llcbeta_options) = TestDirectory("External");
Patrick Jenkins4b7f7aa2006-08-17 22:11:03 +0000937 WriteFile "$Prefix-External-Performance.txt", $ExternalProgramsTable;
938 system "cat $Prefix-SingleSource-Tests.txt " .
939 "$Prefix-MultiSource-Tests.txt ".
940 "$Prefix-External-Tests.txt | sort > $Prefix-Tests.txt";
941 system "cat $Prefix-SingleSource-Performance.txt " .
942 "$Prefix-MultiSource-Performance.txt ".
943 "$Prefix-External-Performance.txt | sort > $Prefix-Performance.txt";
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000944 } else {
945 $ExternalProgramsTable = "External TEST STAGE SKIPPED\n";
946 if ( $VERBOSE ) {
947 print "External TEST STAGE SKIPPED\n";
948 }
Patrick Jenkins4b7f7aa2006-08-17 22:11:03 +0000949 system "cat $Prefix-SingleSource-Tests.txt " .
950 "$Prefix-MultiSource-Tests.txt ".
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000951 " | sort > $Prefix-Tests.txt";
Patrick Jenkins4b7f7aa2006-08-17 22:11:03 +0000952 system "cat $Prefix-SingleSource-Performance.txt " .
953 "$Prefix-MultiSource-Performance.txt ".
954 " | sort > $Prefix-Performance.txt";
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000955 }
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000956
Patrick Jenkinsad6f7582006-08-22 18:11:19 +0000957 ##############################################################
958 #
959 #
960 # gathering tests added removed broken information here
961 #
962 #
963 ##############################################################
964 my $dejagnu_test_list = ReadFile "$Prefix-Tests.txt";
965 my @DEJAGNU = split "\n", $dejagnu_test_list;
966 my ($passes, $fails, $xfails) = "";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000967
Patrick Jenkinsad6f7582006-08-22 18:11:19 +0000968 if(!$NODEJAGNU) {
969 for ($x=0; $x<@DEJAGNU; $x++) {
970 if ($DEJAGNU[$x] =~ m/^PASS:/) {
971 $passes.="$DEJAGNU[$x]\n";
972 }
973 elsif ($DEJAGNU[$x] =~ m/^FAIL:/) {
974 $fails.="$DEJAGNU[$x]\n";
975 }
976 elsif ($DEJAGNU[$x] =~ m/^XFAIL:/) {
977 $xfails.="$DEJAGNU[$x]\n";
978 }
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000979 }
980 }
Patrick Jenkinsad6f7582006-08-22 18:11:19 +0000981
982} #end if !$BuildError
983
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000984
985##############################################################
986#
987# If we built the tree successfully, runs of the Olden suite with
988# LARGE_PROBLEM_SIZE on so that we can get some "running" statistics.
989#
990##############################################################
991if (!$BuildError) {
Patrick Jenkinsd7210f92006-08-02 18:37:40 +0000992 if ( $VERBOSE ) { print "OLDEN TEST SUITE STAGE\n"; }
993 my ($NATTime, $CBETime, $LLCTime, $JITTime, $OptTime, $BytecodeSize,
994 $MachCodeSize) = ("","","","","","","");
995 if (!$NORUNNINGTESTS) {
996 ChangeDir( "$BuildDir/llvm/projects/llvm-test/MultiSource/Benchmarks/Olden",
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000997 "Olden Test Directory");
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000998
Patrick Jenkinsd7210f92006-08-02 18:37:40 +0000999 # Clean out previous results...
1000 system "$NICE $MAKECMD $MAKEOPTS clean > /dev/null 2>&1";
Reid Spencerfa34d7b2006-08-13 09:53:02 +00001001
Patrick Jenkinsd7210f92006-08-02 18:37:40 +00001002 # Run the nightly test in this directory, with LARGE_PROBLEM_SIZE and
1003 # GET_STABLE_NUMBERS enabled!
Reid Spencerfa34d7b2006-08-13 09:53:02 +00001004 if( $VERBOSE ) {
1005 print "$MAKECMD -k $MAKEOPTS $PROGTESTOPTS report.nightly.csv.out " .
1006 "TEST=nightly LARGE_PROBLEM_SIZE=1 GET_STABLE_NUMBERS=1 " .
1007 "> /dev/null 2>&1\n";
1008 }
1009 system "$MAKECMD -k $MAKEOPTS $PROGTESTOPTS report.nightly.csv.out " .
1010 "TEST=nightly LARGE_PROBLEM_SIZE=1 GET_STABLE_NUMBERS=1 " .
1011 "> /dev/null 2>&1";
1012 system "cp report.nightly.csv $OldenTestsLog";
Patrick Jenkinsd7210f92006-08-02 18:37:40 +00001013 }
Patrick Jenkinsfe030d72006-07-06 21:19:32 +00001014}
1015
Patrick Jenkins215b48f2006-07-07 18:50:51 +00001016##############################################################
1017#
1018# Getting end timestamp
1019#
1020##############################################################
Patrick Jenkinsb67e1182006-07-21 21:43:09 +00001021$endtime = `date "+20%y-%m-%d %H:%M:%S"`;
Patrick Jenkins215b48f2006-07-07 18:50:51 +00001022
Patrick Jenkinsfe030d72006-07-06 21:19:32 +00001023
1024##############################################################
1025#
1026# Place all the logs neatly into one humungous file
1027#
1028##############################################################
Patrick Jenkinsfe030d72006-07-06 21:19:32 +00001029if ( $VERBOSE ) { print "PREPARING LOGS TO BE SENT TO SERVER\n"; }
1030
1031$machine_data = "uname: ".`uname -a`.
1032 "hardware: ".`uname -m`.
1033 "os: ".`uname -sr`.
1034 "name: ".`uname -n`.
1035 "date: ".`date \"+20%y-%m-%d\"`.
1036 "time: ".`date +\"%H:%M:%S\"`;
1037
1038my @CVS_DATA;
1039my $cvs_data;
Reid Spencer99e865a2007-04-07 04:41:16 +00001040@CVS_DATA = ReadFile "$COLog";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +00001041$cvs_data = join("\n", @CVS_DATA);
1042
1043my @BUILD_DATA;
1044my $build_data;
1045@BUILD_DATA = ReadFile "$BuildLog";
1046$build_data = join("\n", @BUILD_DATA);
1047
Patrick Jenkins03137752006-08-21 20:45:57 +00001048my (@DEJAGNU_LOG, @DEJAGNU_SUM, @DEJAGNULOG_FULL, @GCC_VERSION);
1049my ($dejagnutests_log ,$dejagnutests_sum, $dejagnulog_full) = "";
1050my ($gcc_version, $gcc_version_long) = "";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +00001051
Patrick Jenkinsad6f7582006-08-22 18:11:19 +00001052$gcc_version_long="";
1053if ($GCCPATH ne "") {
1054 $gcc_version_long = `$GCCPATH/gcc --version`;
Jeff Cohen75454222007-04-10 19:13:43 +00001055} elsif ($ENV{"CC"}) {
1056 $gcc_version_long = `$ENV{"CC"} --version`;
Patrick Jenkinsad6f7582006-08-22 18:11:19 +00001057} else {
1058 $gcc_version_long = `gcc --version`;
1059}
1060@GCC_VERSION = split '\n', $gcc_version_long;
1061$gcc_version = $GCC_VERSION[0];
1062
Tanya Lattner849c9a22007-04-13 04:36:48 +00001063$llvmgcc_version_long="";
1064if ($LLVMGCCPATH ne "") {
1065 $llvmgcc_version_long = `$LLVMGCCPATH/llvm-gcc -v 2>&1`;
1066} else {
1067 $llvmgcc_version_long = `llvm-gcc -v 2>&1`;
1068}
1069@LLVMGCC_VERSION = split '\n', $llvmgcc_version_long;
1070$llvmgcc_versionTarget = $LLVMGCC_VERSION[1];
1071$llvmgcc_versionTarget =~ /Target: (.+)/;
1072$targetTriple = $1;
1073
Patrick Jenkins03137752006-08-21 20:45:57 +00001074if(!$BuildError){
1075 @DEJAGNU_LOG = ReadFile "$DejagnuLog";
1076 @DEJAGNU_SUM = ReadFile "$DejagnuSum";
1077 $dejagnutests_log = join("\n", @DEJAGNU_LOG);
1078 $dejagnutests_sum = join("\n", @DEJAGNU_SUM);
Patrick Jenkinsfe030d72006-07-06 21:19:32 +00001079
Patrick Jenkins03137752006-08-21 20:45:57 +00001080 @DEJAGNULOG_FULL = ReadFile "$DejagnuTestsLog";
1081 $dejagnulog_full = join("\n", @DEJAGNULOG_FULL);
Patrick Jenkins79fbf7f2006-07-14 20:44:09 +00001082}
Patrick Jenkinsfe030d72006-07-06 21:19:32 +00001083
1084##############################################################
1085#
1086# Send data via a post request
1087#
1088##############################################################
1089
1090if ( $VERBOSE ) { print "SEND THE DATA VIA THE POST REQUEST\n"; }
1091
Reid Spencerfa34d7b2006-08-13 09:53:02 +00001092my %hash_of_data = (
1093 'machine_data' => $machine_data,
1094 'build_data' => $build_data,
1095 'gcc_version' => $gcc_version,
1096 'nickname' => $nickname,
1097 'dejagnutime_wall' => $DejagnuWallTime,
1098 'dejagnutime_cpu' => $DejagnuTime,
Reid Spencer99e865a2007-04-07 04:41:16 +00001099 'cvscheckouttime_wall' => $CheckoutTime_Wall,
1100 'cvscheckouttime_cpu' => $CheckoutTime_CPU,
Reid Spencerfa34d7b2006-08-13 09:53:02 +00001101 'configtime_wall' => $ConfigWallTime,
1102 'configtime_cpu'=> $ConfigTime,
1103 'buildtime_wall' => $BuildWallTime,
1104 'buildtime_cpu' => $BuildTime,
1105 'warnings' => $WarningsFile,
1106 'cvsusercommitlist' => $UserCommitList,
1107 'cvsuserupdatelist' => $UserUpdateList,
1108 'cvsaddedfiles' => $CVSAddedFiles,
1109 'cvsmodifiedfiles' => $CVSModifiedFiles,
1110 'cvsremovedfiles' => $CVSRemovedFiles,
1111 'lines_of_code' => $LOC,
1112 'cvs_file_count' => $NumFilesInCVS,
1113 'cvs_dir_count' => $NumDirsInCVS,
1114 'buildstatus' => $BuildStatus,
1115 'singlesource_programstable' => $SingleSourceProgramsTable,
1116 'multisource_programstable' => $MultiSourceProgramsTable,
1117 'externalsource_programstable' => $ExternalProgramsTable,
1118 'llcbeta_options' => $multisource_llcbeta_options,
1119 'warnings_removed' => $WarningsRemoved,
1120 'warnings_added' => $WarningsAdded,
1121 'passing_tests' => $passes,
1122 'expfail_tests' => $xfails,
1123 'unexpfail_tests' => $fails,
1124 'all_tests' => $dejagnu_test_list,
1125 'new_tests' => "",
1126 'removed_tests' => "",
Patrick Jenkinsb9c65eb2006-08-18 18:00:21 +00001127 'dejagnutests_results' => $DejagnuTestResults,
1128 'dejagnutests_log' => $dejagnulog_full,
Reid Spencerfa34d7b2006-08-13 09:53:02 +00001129 'starttime' => $starttime,
1130 'endtime' => $endtime,
1131 'o_file_sizes' => $o_file_sizes,
Tanya Lattner849c9a22007-04-13 04:36:48 +00001132 'a_file_sizes' => $a_file_sizes,
1133 'target_triple' => $targetTriple
Reid Spencerfa34d7b2006-08-13 09:53:02 +00001134);
Patrick Jenkinsfe030d72006-07-06 21:19:32 +00001135
1136$TESTING = 0;
1137
Reid Spencerfa34d7b2006-08-13 09:53:02 +00001138if ($TESTING) {
1139 print "============================\n";
1140 foreach $x(keys %hash_of_data){
1141 print "$x => $hash_of_data{$x}\n";
1142 }
1143} else {
1144 my $response = SendData $SUBMITSERVER,$SUBMITSCRIPT,\%hash_of_data;
1145 if( $VERBOSE) { print "============================\n$response"; }
Patrick Jenkinsfe030d72006-07-06 21:19:32 +00001146}
1147
1148##############################################################
1149#
1150# Remove the cvs tree...
1151#
1152##############################################################
Reid Spencerfa34d7b2006-08-13 09:53:02 +00001153system ( "$NICE rm -rf $BuildDir")
1154 if (!$NOCHECKOUT and !$NOREMOVE);
1155system ( "$NICE rm -rf $WebDir")
1156 if (!$NOCHECKOUT and !$NOREMOVE and !$NOREMOVERESULTS);