blob: 2fa6d5edb4b5a43916e884db592e6ca646329f81 [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 Spencerc9a15d52007-06-26 17:08:16 +000048# -usesvn Check code out from a subversion repository.
49# -svnurl Specify the SVN URL where LLVM can be found. Needs -usesvn
50# to be useful. If -svnurl is not used but -usesvn is then
51# the standard (UIUC) repository will be used.
Patrick Jenkinsfe030d72006-07-06 21:19:32 +000052# -target Specify the target triplet
53# -cflags Next argument specifies that C compilation options that
54# override the default.
55# -cxxflags Next argument specifies that C++ compilation options that
56# override the default.
57# -ldflags Next argument specifies that linker options that override
58# the default.
Patrick Jenkins215b48f2006-07-07 18:50:51 +000059# -compileflags Next argument specifies extra options passed to make when
60# building LLVM.
Patrick Jenkins0e9402f2006-08-11 23:02:09 +000061# -use-gmake Use gmake instead of the default make command to build
Patrick Jenkins1cd46912006-07-27 01:17:17 +000062# llvm and run tests.
Patrick Jenkinsfe030d72006-07-06 21:19:32 +000063#
64# ---------------- Options to configure llvm-test ----------------------------
Patrick Jenkins215b48f2006-07-07 18:50:51 +000065# -extraflags Next argument specifies extra options that are passed to
66# compile the tests.
67# -noexternals Do not run the external tests (for cases where povray
68# or SPEC are not installed)
69# -with-externals Specify a directory where the external tests are located.
Patrick Jenkins0e9402f2006-08-11 23:02:09 +000070# -submit-server Specifies a server to submit the test results too. If this
71# option is not specified it defaults to
72# llvm.org. This is basically just the address of the
73# webserver
74# -submit-script Specifies which script to call on the submit server. If
75# this option is not specified it defaults to
Jim Laskey6d8a1b72006-09-15 17:03:36 +000076# /nightlytest/NightlyTestAccept.php. This is basically
Patrick Jenkins0e9402f2006-08-11 23:02:09 +000077# everything after the www.yourserver.org.
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;
Reid Spencer99e865a2007-04-07 04:41:16 +0000125$USESVN=0;
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";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000130
131while (scalar(@ARGV) and ($_ = $ARGV[0], /^[-+]/)) {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000132 shift;
133 last if /^--$/; # Stop processing arguments on --
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000134
135 # List command line options here...
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000136 if (/^-nocheckout$/) { $NOCHECKOUT = 1; next; }
137 if (/^-nocvsstats$/) { $NOCVSSTATS = 1; next; }
138 if (/^-noremove$/) { $NOREMOVE = 1; next; }
139 if (/^-noremoveresults$/){ $NOREMOVERESULTS = 1; next; }
140 if (/^-notest$/) { $NOTEST = 1; $NORUNNINGTESTS = 1; next; }
141 if (/^-norunningtests$/) { $NORUNNINGTESTS = 1; next; }
142 if (/^-parallel$/) { $MAKEOPTS = "$MAKEOPTS -j2 -l3.0"; next; }
143 if (/^-release$/) { $MAKEOPTS = "$MAKEOPTS ENABLE_OPTIMIZED=1 ".
144 "OPTIMIZE_OPTION=-O2"; $BUILDTYPE="release"; next;}
Jim Laskey27b8ba02006-09-28 17:49:20 +0000145 if (/^-release-asserts$/){ $MAKEOPTS = "$MAKEOPTS ENABLE_OPTIMIZED=1 ".
146 "DISABLE-ASSERTIONS=1 ".
Reid Spencer93c456c2006-10-19 15:24:04 +0000147 "OPTIMIZE_OPTION=-O2";
148 $BUILDTYPE="release-asserts"; next;}
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000149 if (/^-enable-llcbeta$/) { $PROGTESTOPTS .= " ENABLE_LLCBETA=1"; next; }
Reid Spencer2bae1f52006-11-24 20:34:16 +0000150 if (/^-enable-lli$/) { $PROGTESTOPTS .= " ENABLE_LLI=1";
151 $CONFIGUREARGS .= " --enable-lli"; next; }
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000152 if (/^-disable-llc$/) { $PROGTESTOPTS .= " DISABLE_LLC=1";
153 $CONFIGUREARGS .= " --disable-llc_diffs"; next; }
154 if (/^-disable-jit$/) { $PROGTESTOPTS .= " DISABLE_JIT=1";
155 $CONFIGUREARGS .= " --disable-jit"; next; }
156 if (/^-disable-cbe$/) { $PROGTESTOPTS .= " DISABLE_CBE=1"; next; }
157 if (/^-verbose$/) { $VERBOSE = 1; next; }
158 if (/^-debug$/) { $DEBUG = 1; next; }
159 if (/^-nice$/) { $NICE = "nice "; next; }
160 if (/^-f2c$/) { $CONFIGUREARGS .= " --with-f2c=$ARGV[0]";
161 shift; next; }
162 if (/^-with-externals$/) { $CONFIGUREARGS .= " --with-externals=$ARGV[0]";
163 shift; next; }
164 if (/^-submit-server/) { $SUBMITSERVER = "$ARGV[0]"; shift; next; }
165 if (/^-submit-script/) { $SUBMITSCRIPT = "$ARGV[0]"; shift; next; }
166 if (/^-nickname$/) { $nickname = "$ARGV[0]"; shift; next; }
167 if (/^-gccpath/) { $CONFIGUREARGS .=
168 " CC=$ARGV[0]/gcc CXX=$ARGV[0]/g++";
169 $GCCPATH=$ARGV[0]; shift; next; }
170 else { $GCCPATH=""; }
171 if (/^-cvstag/) { $CVSCOOPT .= " -r $ARGV[0]"; shift; next; }
172 else { $CVSCOOPT="";}
Reid Spencer99e865a2007-04-07 04:41:16 +0000173 if (/^-usesvn/) { $USESVN = 1; }
174 if (/^-svnurl/) { $SVNURL = $ARGV[0]; shift; next; }
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000175 if (/^-target/) { $CONFIGUREARGS .= " --target=$ARGV[0]";
176 shift; next; }
177 if (/^-cflags/) { $MAKEOPTS = "$MAKEOPTS C.Flags=\'$ARGV[0]\'";
178 shift; next; }
179 if (/^-cxxflags/) { $MAKEOPTS = "$MAKEOPTS CXX.Flags=\'$ARGV[0]\'";
180 shift; next; }
181 if (/^-ldflags/) { $MAKEOPTS = "$MAKEOPTS LD.Flags=\'$ARGV[0]\'";
182 shift; next; }
183 if (/^-compileflags/) { $MAKEOPTS = "$MAKEOPTS $ARGV[0]"; shift; next; }
184 if (/^-use-gmake/) { $MAKECMD = "gmake"; shift; next; }
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000185 if (/^-extraflags/) { $CONFIGUREARGS .=
186 " --with-extra-options=\'$ARGV[0]\'"; shift; next;}
187 if (/^-noexternals$/) { $NOEXTERNALS = 1; next; }
188 if (/^-nodejagnu$/) { $NODEJAGNU = 1; next; }
189 if (/^-nobuild$/) { $NOBUILD = 1; next; }
190 print "Unknown option: $_ : ignoring!\n";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000191}
192
193if ($ENV{'LLVMGCCDIR'}) {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000194 $CONFIGUREARGS .= " --with-llvmgccdir=" . $ENV{'LLVMGCCDIR'};
Tanya Lattner849c9a22007-04-13 04:36:48 +0000195 $LLVMGCCPATH = $ENV{'LLVMGCCDIR'};
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000196}
Tanya Lattner849c9a22007-04-13 04:36:48 +0000197else {
198 $LLVMGCCPATH = "";
199}
200
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000201if ($CONFIGUREARGS !~ /--disable-jit/) {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000202 $CONFIGUREARGS .= " --enable-jit";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000203}
204
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000205if (@ARGV != 0 and @ARGV != 3 and $VERBOSE) {
206 foreach $x (@ARGV) {
207 print "$x\n";
208 }
209 print "Must specify 0 or 3 options!";
Patrick Jenkinsf58473f2006-07-27 01:03:46 +0000210}
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000211
212if (@ARGV == 3) {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000213 $CVSRootDir = $ARGV[0];
214 $BuildDir = $ARGV[1];
215 $WebDir = $ARGV[2];
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000216}
217
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000218if ($CVSRootDir eq "" or
219 $BuildDir eq "" or
220 $WebDir eq "") {
221 die("please specify a cvs root directory, a build directory, and a ".
Patrick Jenkinsf58473f2006-07-27 01:03:46 +0000222 "web directory");
223 }
224
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000225if ($nickname eq "") {
226 die ("Please invoke NewNightlyTest.pl with command line option " .
227 "\"-nickname <nickname>\"");
Patrick Jenkins514e2582006-07-20 22:28:43 +0000228}
Patrick Jenkins1cd46912006-07-27 01:17:17 +0000229
Jim Laskey27b8ba02006-09-28 17:49:20 +0000230if ($BUILDTYPE ne "release" && $BUILDTYPE ne "release-asserts") {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000231 $BUILDTYPE = "debug";
Patrick Jenkins26ba6092006-07-23 22:57:28 +0000232}
Patrick Jenkins514e2582006-07-20 22:28:43 +0000233
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000234##############################################################
235#
236#define the file names we'll use
237#
238##############################################################
239my $Prefix = "$WebDir/$DATE";
240my $BuildLog = "$Prefix-Build-Log.txt";
Reid Spencer99e865a2007-04-07 04:41:16 +0000241my $COLog = "$Prefix-CVS-Log.txt";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000242my $OldenTestsLog = "$Prefix-Olden-tests.txt";
243my $SingleSourceLog = "$Prefix-SingleSource-ProgramTest.txt.gz";
244my $MultiSourceLog = "$Prefix-MultiSource-ProgramTest.txt.gz";
Patrick Jenkins26ba6092006-07-23 22:57:28 +0000245my $ExternalLog = "$Prefix-External-ProgramTest.txt.gz";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000246my $DejagnuLog = "$Prefix-Dejagnu-testrun.log";
247my $DejagnuSum = "$Prefix-Dejagnu-testrun.sum";
248my $DejagnuTestsLog = "$Prefix-DejagnuTests-Log.txt";
249if (! -d $WebDir) {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000250 mkdir $WebDir, 0777;
Patrick Jenkins03137752006-08-21 20:45:57 +0000251 if($VERBOSE){
252 warn "$WebDir did not exist; creating it.\n";
253 }
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000254}
255
256if ($VERBOSE) {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000257 print "INITIALIZED\n";
Reid Spencer99e865a2007-04-07 04:41:16 +0000258 if ($USESVN) {
259 print "SVN URL = $SVNURL\n";
260 } else {
261 print "CVS Root = $CVSRootDir\n";
262 }
263 print "COLog = $COLog\n";
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000264 print "BuildDir = $BuildDir\n";
265 print "WebDir = $WebDir\n";
266 print "Prefix = $Prefix\n";
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000267 print "BuildLog = $BuildLog\n";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000268}
269
270##############################################################
271#
272# Helper functions
273#
274##############################################################
275sub GetDir {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000276 my $Suffix = shift;
277 opendir DH, $WebDir;
278 my @Result = reverse sort grep !/$DATE/, grep /[-0-9]+$Suffix/, readdir DH;
279 closedir DH;
280 return @Result;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000281}
282
283#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
284#
285# DiffFiles - Diff the current version of the file against the last version of
286# the file, reporting things added and removed. This is used to report, for
287# example, added and removed warnings. This returns a pair (added, removed)
288#
289#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
290sub DiffFiles {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000291 my $Suffix = shift;
292 my @Others = GetDir $Suffix;
293 if (@Others == 0) { # No other files? We added all entries...
294 return (`cat $WebDir/$DATE$Suffix`, "");
295 }
296# Diff the files now...
297 my @Diffs = split "\n", `diff $WebDir/$DATE$Suffix $WebDir/$Others[0]`;
298 my $Added = join "\n", grep /^</, @Diffs;
299 my $Removed = join "\n", grep /^>/, @Diffs;
300 $Added =~ s/^< //gm;
301 $Removed =~ s/^> //gm;
302 return ($Added, $Removed);
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000303}
304
305#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
306#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
307sub GetRegex { # (Regex with ()'s, value)
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000308 $_[1] =~ /$_[0]/m;
309 return $1
310 if (defined($1));
311 return "0";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000312}
313
314#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
315#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
316sub GetRegexNum {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000317 my ($Regex, $Num, $Regex2, $File) = @_;
318 my @Items = split "\n", `grep '$Regex' $File`;
319 return GetRegex $Regex2, $Items[$Num];
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000320}
321
322#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
323#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
324sub ChangeDir { # directory, logical name
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000325 my ($dir,$name) = @_;
326 chomp($dir);
327 if ( $VERBOSE ) { print "Changing To: $name ($dir)\n"; }
328 $result = chdir($dir);
329 if (!$result) {
330 print "ERROR!!! Cannot change directory to: $name ($dir) because $!";
331 return false;
332 }
333 return true;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000334}
335
336#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
337#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
338sub ReadFile {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000339 if (open (FILE, $_[0])) {
340 undef $/;
341 my $Ret = <FILE>;
342 close FILE;
343 $/ = '\n';
344 return $Ret;
345 } else {
346 print "Could not open file '$_[0]' for reading!\n";
347 return "";
348 }
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000349}
350
351#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
352#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
353sub WriteFile { # (filename, contents)
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000354 open (FILE, ">$_[0]") or die "Could not open file '$_[0]' for writing!\n";
355 print FILE $_[1];
356 close FILE;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000357}
358
359#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
360#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
361sub CopyFile { #filename, newfile
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000362 my ($file, $newfile) = @_;
363 chomp($file);
364 if ($VERBOSE) { print "Copying $file to $newfile\n"; }
365 copy($file, $newfile);
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000366}
367
368#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
369#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
370sub AddRecord {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000371 my ($Val, $Filename,$WebDir) = @_;
372 my @Records;
373 if (open FILE, "$WebDir/$Filename") {
374 @Records = grep !/$DATE/, split "\n", <FILE>;
375 close FILE;
376 }
377 push @Records, "$DATE: $Val";
378 WriteFile "$WebDir/$Filename", (join "\n", @Records) . "\n";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000379}
380
381#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
382#
383# FormatTime - Convert a time from 1m23.45 into 83.45
384#
385#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
386sub FormatTime {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000387 my $Time = shift;
388 if ($Time =~ m/([0-9]+)m([0-9.]+)/) {
389 $Time = sprintf("%7.4f", $1*60.0+$2);
390 }
391 return $Time;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000392}
393
394#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick Jenkinsb9c65eb2006-08-18 18:00:21 +0000395#
396# This function is meant to read in the dejagnu sum file and
397# return a string with only the results (i.e. PASS/FAIL/XPASS/
398# XFAIL).
399#
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000400#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
401sub GetDejagnuTestResults { # (filename, log)
Patrick Jenkinsb9c65eb2006-08-18 18:00:21 +0000402 my ($filename, $DejagnuLog) = @_;
403 my @lines;
404 $/ = "\n"; #Make sure we're going line at a time.
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000405
Patrick Jenkinsb9c65eb2006-08-18 18:00:21 +0000406 if( $VERBOSE) { print "DEJAGNU TEST RESULTS:\n"; }
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000407
Patrick Jenkinsb9c65eb2006-08-18 18:00:21 +0000408 if (open SRCHFILE, $filename) {
409 # Process test results
410 while ( <SRCHFILE> ) {
411 if ( length($_) > 1 ) {
412 chomp($_);
Jim Laskey01d7bcf2006-09-20 09:20:22 +0000413 if ( m/^(PASS|XPASS|FAIL|XFAIL): .*\/llvm\/test\/(.*)$/ ) {
414 push(@lines, "$1: test/$2");
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000415 }
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000416 }
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000417 }
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000418 }
Patrick Jenkinsb9c65eb2006-08-18 18:00:21 +0000419 close SRCHFILE;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000420
Patrick Jenkinsb9c65eb2006-08-18 18:00:21 +0000421 my $content = join("\n", @lines);
422 return $content;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000423}
424
425
Patrick Jenkinsb9c65eb2006-08-18 18:00:21 +0000426
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000427#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
428#
429# This function acts as a mini web browswer submitting data
430# to our central server via the post method
431#
432#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
433sub SendData{
434 $host = $_[0];
435 $file = $_[1];
436 $variables=$_[2];
437
438 $port=80;
439 $socketaddr= sockaddr_in $port, inet_aton $host or die "Bad hostname\n";
Patrick Jenkinsadea55e2006-07-17 16:41:19 +0000440 socket SOCK, PF_INET, SOCK_STREAM, getprotobyname('tcp') or
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000441 die "Bad socket\n";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000442 connect SOCK, $socketaddr or die "Bad connection\n";
443 select((select(SOCK), $| = 1)[0]);
444
445 #creating content here
446 my $content;
447 foreach $key (keys (%$variables)){
448 $value = $variables->{$key};
449 $value =~ s/([^A-Za-z0-9])/sprintf("%%%02X", ord($1))/seg;
450 $content .= "$key=$value&";
451 }
452
453 $length = length($content);
454
455 my $send= "POST $file HTTP/1.0\n";
Lauro Ramos Venancio46040232007-05-03 14:05:07 +0000456 $send.= "Host: $host\n";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000457 $send.= "Content-Type: application/x-www-form-urlencoded\n";
458 $send.= "Content-length: $length\n\n";
459 $send.= "$content";
460
Patrick Jenkinse8501eb2006-08-07 01:54:37 +0000461 print SOCK $send;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000462 my $result;
463 while(<SOCK>){
464 $result .= $_;
465 }
466 close(SOCK);
467
468 my $sentdata="";
Patrick Jenkins4c4e3562006-07-07 21:40:34 +0000469 foreach $x (keys (%$variables)){
Patrick Jenkins7267bd62006-07-10 18:35:41 +0000470 $value = $variables->{$x};
471 $sentdata.= "$x => $value\n";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000472 }
473 WriteFile "$Prefix-sentdata.txt", $sentdata;
Patrick Jenkins4c4e3562006-07-07 21:40:34 +0000474
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000475
476 return $result;
477}
478
Patrick Jenkins215b48f2006-07-07 18:50:51 +0000479##############################################################
480#
481# Getting Start timestamp
482#
483##############################################################
Patrick Jenkinsb67e1182006-07-21 21:43:09 +0000484$starttime = `date "+20%y-%m-%d %H:%M:%S"`;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000485
486##############################################################
487#
488# Create the CVS repository directory
489#
490##############################################################
491if (!$NOCHECKOUT) {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000492 if (-d $BuildDir) {
493 if (!$NOREMOVE) {
494 if ( $VERBOSE ) {
495 print "Build directory exists! Removing it\n";
496 }
497 system "rm -rf $BuildDir";
Reid Spencer99e865a2007-04-07 04:41:16 +0000498 mkdir $BuildDir or die "Could not create checkout directory $BuildDir!";
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000499 } else {
Jim Laskey6d8a1b72006-09-15 17:03:36 +0000500 if ( $VERBOSE ) {
501 print "Build directory exists!\n";
502 }
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000503 }
Jim Laskey6d8a1b72006-09-15 17:03:36 +0000504 } else {
Reid Spencer99e865a2007-04-07 04:41:16 +0000505 mkdir $BuildDir or die "Could not create checkout directory $BuildDir!";
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000506 }
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000507}
Reid Spencer99e865a2007-04-07 04:41:16 +0000508ChangeDir( $BuildDir, "checkout directory" );
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000509
510
511##############################################################
512#
Reid Spencer99e865a2007-04-07 04:41:16 +0000513# Check out the llvm tree, using either SVN or CVS
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000514#
515##############################################################
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000516if (!$NOCHECKOUT) {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000517 if ( $VERBOSE ) {
518 print "CHECKOUT STAGE:\n";
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000519 }
Reid Spencer99e865a2007-04-07 04:41:16 +0000520 if ($USESVN) {
521 my $SVNCMD = "$NICE svn co $SVNURL";
522 if ($VERBOSE) {
Reid Spencer1c01cf92007-06-29 03:12:42 +0000523 print "( time -p $SVNCMD/llvm/trunk llvm; cd llvm/projects ; " .
524 "$SVNCMD/test-suite/trunk llvm-test ) > $COLog 2>&1\n";
525 system "( time -p $SVNCMD/llvm/trunk llvm; cd llvm/projects ; " .
526 "$SVNCMD/test-suite/trunk llvm-test ) > $COLog 2>&1\n";
Reid Spencer99e865a2007-04-07 04:41:16 +0000527 }
528 } else {
529 my $CVSOPT = "";
530 $CVSOPT = "-z3" # Use compression if going over ssh.
531 if $CVSRootDir =~ /^:ext:/;
532 my $CVSCMD = "$NICE cvs $CVSOPT -d $CVSRootDir co -P $CVSCOOPT";
533 print "( 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 system "( time -p $CVSCMD llvm; cd llvm/projects ; " .
Reid Spencerb5fda752007-04-07 05:20:07 +0000536 "$CVSCMD llvm-test ) > $COLog 2>&1\n";
Reid Spencer99e865a2007-04-07 04:41:16 +0000537 }
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000538}
Reid Spencer99e865a2007-04-07 04:41:16 +0000539ChangeDir( $BuildDir , "Checkout directory") ;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000540ChangeDir( "llvm" , "llvm source directory") ;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000541
542##############################################################
543#
544# Get some static statistics about the current state of CVS
545#
546# This can probably be put on the server side
547#
548##############################################################
Reid Spencer99e865a2007-04-07 04:41:16 +0000549my $CheckoutTime_Wall = GetRegex "([0-9.]+)", `grep '^real' $COLog`;
550my $CheckoutTime_User = GetRegex "([0-9.]+)", `grep '^user' $COLog`;
551my $CheckoutTime_Sys = GetRegex "([0-9.]+)", `grep '^sys' $COLog`;
552my $CheckoutTime_CPU = $CVSCheckoutTime_User + $CVSCheckoutTime_Sys;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000553
Reid Spencer99e865a2007-04-07 04:41:16 +0000554my $NumFilesInCVS = 0;
555my $NumDirsInCVS = 0;
556if ($USESVN) {
557 $NumFilesInCVS = `egrep '^A' $COLog | wc -l` + 0;
558 $NumDirsInCVS = `sed -e 's#/[^/]*$##' $COLog | sort | uniq | wc -l` + 0;
559} else {
560 $NumFilesInCVS = `egrep '^U' $COLog | wc -l` + 0;
561 $NumDirsInCVS = `egrep '^cvs (checkout|server|update):' $COLog | wc -l` + 0;
562}
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000563
564##############################################################
565#
566# Extract some information from the CVS history... use a hash so no duplicate
567# stuff is stored. This gets the history from the previous days worth
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000568# of cvs activity and parses it.
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000569#
570##############################################################
571
Reid Spencer99e865a2007-04-07 04:41:16 +0000572# This just computes a reasonably accurate #of seconds since 2000. It doesn't
573# have to be perfect as its only used for comparing date ranges within a couple
574# of days.
575sub ConvertToSeconds {
576 my ($sec, $min, $hour, $day, $mon, $yr) = @_;
577 my $Result = ($yr - 2000) * 12;
578 $Result += $mon;
579 $Result *= 31;
580 $Result += $day;
581 $Result *= 24;
582 $Result += $hour;
583 $Result *= 60;
584 $Result += $min;
585 $Result *= 60;
586 $Result += $sec;
587 return $Result;
588}
589
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000590my (%AddedFiles, %ModifiedFiles, %RemovedFiles, %UsersCommitted, %UsersUpdated);
591
Reid Spencer99e865a2007-04-07 04:41:16 +0000592if (!$NOCVSSTATS) {
593 if ($VERBOSE) { print "CHANGE HISTORY ANALYSIS STAGE\n"; }
Reid Spencer776964a2007-04-04 06:59:36 +0000594
Reid Spencer99e865a2007-04-07 04:41:16 +0000595 if ($USESVN) {
596 @SVNHistory = split /<logentry/, `svn log --xml --verbose -r{$DATE}:HEAD`;
597 # Skip very first entry because it is the XML header cruft
598 shift @SVNHistory;
599 my $Now = time();
600 foreach $Record (@SVNHistory) {
601 my @Lines = split "\n", $Record;
602 my ($Author, $Date, $Revision);
603 # Get the date and see if its one we want to process.
604 my ($Year, $Month, $Day, $Hour, $Min, $Sec);
605 if ($Lines[3] =~ /<date>(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})/){
606 $Year = $1; $Month = $2; $Day = $3; $Hour = $4; $Min = $5; $Sec = $6;
607 }
608 my $Then = ConvertToSeconds($Sec, $Min, $Hour, $Day, $Month, $Year);
609 # Get the current date and compute when "yesterday" is.
610 my ($NSec, $NMin, $NHour, $NDay, $NMon, $NYear) = gmtime();
611 my $Now = ConvertToSeconds( $NSec, $NMin, $NHour, $NDay, $NMon, $NYear);
612 if (($Now - 24*60*60) > $Then) {
613 next;
614 }
615 if ($Lines[1] =~ / revision="([0-9]*)">/) {
616 $Revision = $1;
617 }
618 if ($Lines[2] =~ /<author>([^<]*)<\/author>/) {
619 $Author = $1;
620 }
621 $UsersCommitted{$Author} = 1;
622 $Date = $Year . "-" . $Month . "-" . $Day;
623 $Time = $Hour . ":" . $Min . ":" . $Sec;
624 print "Rev: $Revision, Author: $Author, Date: $Date, Time: $Time\n";
625 for ($i = 6; $i < $#Lines; $i += 2 ) {
626 if ($Lines[$i] =~ /^ action="(.)">([^<]*)</) {
627 if ($1 == "A") {
628 $AddedFiles{$2} = 1;
629 } elsif ($1 == 'D') {
630 $RemovedFiles{$2} = 1;
631 } elsif ($1 == 'M' || $1 == 'R' || $1 == 'C') {
632 $ModifiedFiles{$2} = 1;
633 } else {
634 print "UNMATCHABLE: $Lines[$i]\n";
635 }
636 }
637 }
638 }
639 } else {
640 @CVSHistory = split "\n", `cvs history -D '1 day ago' -a -xAMROCGUW`;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000641#print join "\n", @CVSHistory; print "\n";
642
Reid Spencer99e865a2007-04-07 04:41:16 +0000643 my $DateRE = '[-/:0-9 ]+\+[0-9]+';
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000644
645# Loop over every record from the CVS history, filling in the hashes.
Reid Spencer99e865a2007-04-07 04:41:16 +0000646 foreach $File (@CVSHistory) {
647 my ($Type, $Date, $UID, $Rev, $Filename);
648 if ($File =~ /([AMRUGC]) ($DateRE) ([^ ]+) +([^ ]+) +([^ ]+) +([^ ]+)/) {
649 ($Type, $Date, $UID, $Rev, $Filename) = ($1, $2, $3, $4, "$6/$5");
650 } elsif ($File =~ /([W]) ($DateRE) ([^ ]+)/) {
651 ($Type, $Date, $UID, $Rev, $Filename) = ($1, $2, $3, "", "");
652 } elsif ($File =~ /([O]) ($DateRE) ([^ ]+) +([^ ]+)/) {
653 ($Type, $Date, $UID, $Rev, $Filename) = ($1, $2, $3, "", "$4/");
654 } else {
655 print "UNMATCHABLE: $File\n";
656 next;
657 }
658 # print "$File\nTy = $Type Date = '$Date' UID=$UID Rev=$Rev File = '$Filename'\n";
659
660 if ($Filename =~ /^llvm/) {
661 if ($Type eq 'M') { # Modified
662 $ModifiedFiles{$Filename} = 1;
663 $UsersCommitted{$UID} = 1;
664 } elsif ($Type eq 'A') { # Added
665 $AddedFiles{$Filename} = 1;
666 $UsersCommitted{$UID} = 1;
667 } elsif ($Type eq 'R') { # Removed
668 $RemovedFiles{$Filename} = 1;
669 $UsersCommitted{$UID} = 1;
670 } else {
671 $UsersUpdated{$UID} = 1;
672 }
673 }
674 }
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000675
Reid Spencer99e865a2007-04-07 04:41:16 +0000676 my $TestError = 1;
677 } #$USESVN
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000678}#!NOCVSSTATS
679
680my $CVSAddedFiles = join "\n", sort keys %AddedFiles;
681my $CVSModifiedFiles = join "\n", sort keys %ModifiedFiles;
682my $CVSRemovedFiles = join "\n", sort keys %RemovedFiles;
683my $UserCommitList = join "\n", sort keys %UsersCommitted;
684my $UserUpdateList = join "\n", sort keys %UsersUpdated;
685
686##############################################################
687#
688# Build the entire tree, saving build messages to the build log
689#
690##############################################################
691if (!$NOCHECKOUT && !$NOBUILD) {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000692 my $EXTRAFLAGS = "--enable-spec --with-objroot=.";
693 if ( $VERBOSE ) {
694 print "CONFIGURE STAGE:\n";
695 print "(time -p $NICE ./configure $CONFIGUREARGS $EXTRAFLAGS) " .
696 "> $BuildLog 2>&1\n";
697 }
698 system "(time -p $NICE ./configure $CONFIGUREARGS $EXTRAFLAGS) " .
699 "> $BuildLog 2>&1";
700 if ( $VERBOSE ) {
701 print "BUILD STAGE:\n";
702 print "(time -p $NICE $MAKECMD $MAKEOPTS) >> $BuildLog 2>&1\n";
703 }
704 # Build the entire tree, capturing the output into $BuildLog
705 system "(time -p $NICE $MAKECMD $MAKEOPTS) >> $BuildLog 2>&1";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000706}
707
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000708##############################################################
709#
710# Get some statistics about the build...
711#
712##############################################################
713#this can de done on server
714#my @Linked = split '\n', `grep Linking $BuildLog`;
715#my $NumExecutables = scalar(grep(/executable/, @Linked));
716#my $NumLibraries = scalar(grep(!/executable/, @Linked));
717#my $NumObjects = `grep ']\: Compiling ' $BuildLog | wc -l` + 0;
718
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000719# Get the number of lines of source code. Must be here after the build is done
720# because countloc.sh uses the llvm-config script which must be built.
Patrick Jenkinsb993b0a2006-08-16 22:18:41 +0000721my $LOC = `utils/countloc.sh -topdir $BuildDir/llvm`;
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000722
723# Get the time taken by the configure script
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000724my $ConfigTimeU = GetRegexNum "^user", 0, "([0-9.]+)", "$BuildLog";
725my $ConfigTimeS = GetRegexNum "^sys", 0, "([0-9.]+)", "$BuildLog";
726my $ConfigTime = $ConfigTimeU+$ConfigTimeS; # ConfigTime = User+System
727my $ConfigWallTime = GetRegexNum "^real", 0,"([0-9.]+)","$BuildLog";
728
729$ConfigTime=-1 unless $ConfigTime;
730$ConfigWallTime=-1 unless $ConfigWallTime;
731
732my $BuildTimeU = GetRegexNum "^user", 1, "([0-9.]+)", "$BuildLog";
733my $BuildTimeS = GetRegexNum "^sys", 1, "([0-9.]+)", "$BuildLog";
734my $BuildTime = $BuildTimeU+$BuildTimeS; # BuildTime = User+System
735my $BuildWallTime = GetRegexNum "^real", 1, "([0-9.]+)","$BuildLog";
736
737$BuildTime=-1 unless $BuildTime;
738$BuildWallTime=-1 unless $BuildWallTime;
739
740my $BuildError = 0, $BuildStatus = "OK";
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000741if ($NOBUILD) {
742 $BuildStatus = "Skipped by user";
743 $BuildError = 1;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000744}
Patrick Jenkinsf58473f2006-07-27 01:03:46 +0000745elsif (`grep '^$MAKECMD\[^:]*: .*Error' $BuildLog | wc -l` + 0 ||
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000746 `grep '^$MAKECMD: \*\*\*.*Stop.' $BuildLog | wc -l`+0) {
747 $BuildStatus = "Error: compilation aborted";
748 $BuildError = 1;
749 if( $VERBOSE) { print "\n***ERROR BUILDING TREE\n\n"; }
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000750}
751if ($BuildError) { $NODEJAGNU=1; }
752
Patrick Jenkins169357e2006-07-23 21:38:07 +0000753my $a_file_sizes="";
754my $o_file_sizes="";
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000755if (!$BuildError) {
756 print "Organizing size of .o and .a files\n"
757 if ( $VERBOSE );
758 ChangeDir( "$BuildDir/llvm", "Build Directory" );
759 $afiles.= `find utils/ -iname '*.a' -ls`;
760 $afiles.= `find lib/ -iname '*.a' -ls`;
761 $afiles.= `find tools/ -iname '*.a' -ls`;
762 if($BUILDTYPE eq "release"){
Jim Laskey7a8efce2006-09-29 17:31:45 +0000763 $afiles.= `find Release/ -iname '*.a' -ls`;
Jim Laskey27b8ba02006-09-28 17:49:20 +0000764 } elsif($BUILDTYPE eq "release-asserts") {
765 $afiles.= `find Release-Asserts/ -iname '*.a' -ls`;
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000766 } else {
767 $afiles.= `find Debug/ -iname '*.a' -ls`;
768 }
769
770 $ofiles.= `find utils/ -iname '*.o' -ls`;
771 $ofiles.= `find lib/ -iname '*.o' -ls`;
772 $ofiles.= `find tools/ -iname '*.o' -ls`;
773 if($BUILDTYPE eq "release"){
Jim Laskey7a8efce2006-09-29 17:31:45 +0000774 $ofiles.= `find Release/ -iname '*.o' -ls`;
Jim Laskey27b8ba02006-09-28 17:49:20 +0000775 } elsif($BUILDTYPE eq "release-asserts") {
776 $ofiles.= `find Release-Asserts/ -iname '*.o' -ls`;
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000777 } else {
778 $ofiles.= `find Debug/ -iname '*.o' -ls`;
779 }
780
781 @AFILES = split "\n", $afiles;
782 $a_file_sizes="";
783 foreach $x (@AFILES){
784 $x =~ m/.+\s+.+\s+.+\s+.+\s+.+\s+.+\s+(.+)\s+.+\s+.+\s+.+\s+(.+)/;
785 $a_file_sizes.="$1 $2 $BUILDTYPE\n";
786 }
787 @OFILES = split "\n", $ofiles;
788 $o_file_sizes="";
789 foreach $x (@OFILES){
790 $x =~ m/.+\s+.+\s+.+\s+.+\s+.+\s+.+\s+(.+)\s+.+\s+.+\s+.+\s+(.+)/;
791 $o_file_sizes.="$1 $2 $BUILDTYPE\n";
792 }
793} else {
794 $a_file_sizes="No data due to a bad build.";
795 $o_file_sizes="No data due to a bad build.";
Patrick Jenkins169357e2006-07-23 21:38:07 +0000796}
Patrick Jenkins169357e2006-07-23 21:38:07 +0000797
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000798##############################################################
799#
800# Running dejagnu tests
801#
802##############################################################
Patrick Jenkinsb9c65eb2006-08-18 18:00:21 +0000803my $DejangnuTestResults=""; # String containing the results of the dejagnu
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000804my $dejagnu_output = "$DejagnuTestsLog";
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000805if (!$NODEJAGNU) {
806 if($VERBOSE) {
807 print "DEJAGNU FEATURE/REGRESSION TEST STAGE:\n";
808 print "(time -p $MAKECMD $MAKEOPTS check) > $dejagnu_output 2>&1\n";
809 }
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000810
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000811 #Run the feature and regression tests, results are put into testrun.sum
812 #Full log in testrun.log
813 system "(time -p $MAKECMD $MAKEOPTS check) > $dejagnu_output 2>&1";
814
815 #Copy the testrun.log and testrun.sum to our webdir
816 CopyFile("test/testrun.log", $DejagnuLog);
817 CopyFile("test/testrun.sum", $DejagnuSum);
818 #can be done on server
819 $DejagnuTestResults = GetDejagnuTestResults($DejagnuSum, $DejagnuLog);
820 $unexpfail_tests = $DejagnuTestResults;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000821}
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000822
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000823#Extract time of dejagnu tests
824my $DejagnuTimeU = GetRegexNum "^user", 0, "([0-9.]+)", "$dejagnu_output";
825my $DejagnuTimeS = GetRegexNum "^sys", 0, "([0-9.]+)", "$dejagnu_output";
826$DejagnuTime = $DejagnuTimeU+$DejagnuTimeS; # DejagnuTime = User+System
827$DejagnuWallTime = GetRegexNum "^real", 0,"([0-9.]+)","$dejagnu_output";
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000828$DejagnuTestResults =
829 "Dejagnu skipped by user choice." unless $DejagnuTestResults;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000830$DejagnuTime = "0.0" unless $DejagnuTime;
831$DejagnuWallTime = "0.0" unless $DejagnuWallTime;
832
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000833##############################################################
834#
835# Get warnings from the build
836#
837##############################################################
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000838if (!$NODEJAGNU) {
839 if ( $VERBOSE ) { print "BUILD INFORMATION COLLECTION STAGE\n"; }
840 my @Warn = split "\n", `egrep 'warning:|Entering dir' $BuildLog`;
841 my @Warnings;
842 my $CurDir = "";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000843
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000844 foreach $Warning (@Warn) {
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000845 if ($Warning =~ m/Entering directory \`([^\`]+)\'/) {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000846 $CurDir = $1; # Keep track of directory warning is in...
847 # Remove buildir prefix if included
848 if ($CurDir =~ m#$BuildDir/llvm/(.*)#) { $CurDir = $1; }
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000849 } else {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000850 push @Warnings, "$CurDir/$Warning"; # Add directory to warning...
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000851 }
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000852 }
853 my $WarningsFile = join "\n", @Warnings;
854 $WarningsFile =~ s/:[0-9]+:/::/g;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000855
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000856 # Emit the warnings file, so we can diff...
857 WriteFile "$WebDir/$DATE-Warnings.txt", $WarningsFile . "\n";
858 my ($WarningsAdded, $WarningsRemoved) = DiffFiles "-Warnings.txt";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000859
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000860 # Output something to stdout if something has changed
861 #print "ADDED WARNINGS:\n$WarningsAdded\n\n" if (length $WarningsAdded);
862 #print "REMOVED WARNINGS:\n$WarningsRemoved\n\n" if (length $WarningsRemoved);
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000863
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000864 #my @TmpWarningsAdded = split "\n", $WarningsAdded; ~PJ on upgrade
865 #my @TmpWarningsRemoved = split "\n", $WarningsRemoved; ~PJ on upgrade
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000866
867} #endif !NODEGAGNU
868
869##############################################################
870#
871# If we built the tree successfully, run the nightly programs tests...
872#
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000873# A set of tests to run is passed in (i.e. "SingleSource" "MultiSource"
874# "External")
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000875#
876##############################################################
877sub TestDirectory {
Patrick Jenkinsad6f7582006-08-22 18:11:19 +0000878 my $SubDir = shift;
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000879 ChangeDir( "$BuildDir/llvm/projects/llvm-test/$SubDir",
880 "Programs Test Subdirectory" ) || return ("", "");
881
882 my $ProgramTestLog = "$Prefix-$SubDir-ProgramTest.txt";
883
884 # Run the programs tests... creating a report.nightly.csv file
885 if (!$NOTEST) {
886 if( $VERBOSE) {
887 print "$MAKECMD -k $MAKEOPTS $PROGTESTOPTS report.nightly.csv ".
888 "TEST=nightly > $ProgramTestLog 2>&1\n";
889 }
890 system "$MAKECMD -k $MAKEOPTS $PROGTESTOPTS report.nightly.csv ".
Patrick Jenkins59d1a662006-07-27 18:28:50 +0000891 "TEST=nightly > $ProgramTestLog 2>&1";
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000892 $llcbeta_options=`$MAKECMD print-llcbeta-option`;
893 }
894
Patrick Jenkins59d1a662006-07-27 18:28:50 +0000895 my $ProgramsTable;
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000896 if (`grep '^$MAKECMD\[^:]: .*Error' $ProgramTestLog | wc -l` + 0) {
Patrick Jenkins59d1a662006-07-27 18:28:50 +0000897 $TestError = 1;
898 $ProgramsTable="Error running test $SubDir\n";
899 print "ERROR TESTING\n";
900 } elsif (`grep '^$MAKECMD\[^:]: .*No rule to make target' $ProgramTestLog | wc -l` + 0) {
901 $TestError = 1;
902 $ProgramsTable="Makefile error running tests $SubDir!\n";
903 print "ERROR TESTING\n";
904 } else {
905 $TestError = 0;
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000906 #
907 # Create a list of the tests which were run...
908 #
909 system "egrep 'TEST-(PASS|FAIL)' < $ProgramTestLog ".
Patrick Jenkins4b7f7aa2006-08-17 22:11:03 +0000910 "| sort > $Prefix-$SubDir-Tests.txt";
Patrick Jenkins59d1a662006-07-27 18:28:50 +0000911 }
912 $ProgramsTable = ReadFile "report.nightly.csv";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000913
Patrick Jenkins59d1a662006-07-27 18:28:50 +0000914 ChangeDir( "../../..", "Programs Test Parent Directory" );
915 return ($ProgramsTable, $llcbeta_options);
Patrick Jenkins9e384ab2006-08-14 16:07:14 +0000916} #end sub TestDirectory
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000917
Patrick Jenkins4b7f7aa2006-08-17 22:11:03 +0000918##############################################################
919#
920# Calling sub TestDirectory
921#
922##############################################################
Patrick Jenkinsc281b0d2006-07-27 19:00:01 +0000923if (!$BuildError) {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000924 if ( $VERBOSE ) {
Patrick Jenkinse631c4a2006-08-04 17:55:01 +0000925 print "SingleSource TEST STAGE\n";
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000926 }
927 ($SingleSourceProgramsTable, $llcbeta_options) =
928 TestDirectory("SingleSource");
Patrick Jenkins4b7f7aa2006-08-17 22:11:03 +0000929 WriteFile "$Prefix-SingleSource-Performance.txt", $SingleSourceProgramsTable;
Patrick Jenkins4257ccb2006-08-08 02:03:53 +0000930 if ( $VERBOSE ) {
Patrick Jenkins4b7f7aa2006-08-17 22:11:03 +0000931 print "MultiSource TEST STAGE\n";
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000932 }
933 ($MultiSourceProgramsTable, $llcbeta_options) = TestDirectory("MultiSource");
Patrick Jenkins4b7f7aa2006-08-17 22:11:03 +0000934 WriteFile "$Prefix-MultiSource-Performance.txt", $MultiSourceProgramsTable;
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000935 if ( ! $NOEXTERNALS ) {
936 if ( $VERBOSE ) {
937 print "External TEST STAGE\n";
938 }
939 ($ExternalProgramsTable, $llcbeta_options) = TestDirectory("External");
Patrick Jenkins4b7f7aa2006-08-17 22:11:03 +0000940 WriteFile "$Prefix-External-Performance.txt", $ExternalProgramsTable;
941 system "cat $Prefix-SingleSource-Tests.txt " .
942 "$Prefix-MultiSource-Tests.txt ".
943 "$Prefix-External-Tests.txt | sort > $Prefix-Tests.txt";
944 system "cat $Prefix-SingleSource-Performance.txt " .
945 "$Prefix-MultiSource-Performance.txt ".
946 "$Prefix-External-Performance.txt | sort > $Prefix-Performance.txt";
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000947 } else {
948 $ExternalProgramsTable = "External TEST STAGE SKIPPED\n";
949 if ( $VERBOSE ) {
950 print "External TEST STAGE SKIPPED\n";
951 }
Patrick Jenkins4b7f7aa2006-08-17 22:11:03 +0000952 system "cat $Prefix-SingleSource-Tests.txt " .
953 "$Prefix-MultiSource-Tests.txt ".
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000954 " | sort > $Prefix-Tests.txt";
Patrick Jenkins4b7f7aa2006-08-17 22:11:03 +0000955 system "cat $Prefix-SingleSource-Performance.txt " .
956 "$Prefix-MultiSource-Performance.txt ".
957 " | sort > $Prefix-Performance.txt";
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000958 }
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000959
Patrick Jenkinsad6f7582006-08-22 18:11:19 +0000960 ##############################################################
961 #
962 #
963 # gathering tests added removed broken information here
964 #
965 #
966 ##############################################################
967 my $dejagnu_test_list = ReadFile "$Prefix-Tests.txt";
968 my @DEJAGNU = split "\n", $dejagnu_test_list;
969 my ($passes, $fails, $xfails) = "";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000970
Patrick Jenkinsad6f7582006-08-22 18:11:19 +0000971 if(!$NODEJAGNU) {
972 for ($x=0; $x<@DEJAGNU; $x++) {
973 if ($DEJAGNU[$x] =~ m/^PASS:/) {
974 $passes.="$DEJAGNU[$x]\n";
975 }
976 elsif ($DEJAGNU[$x] =~ m/^FAIL:/) {
977 $fails.="$DEJAGNU[$x]\n";
978 }
979 elsif ($DEJAGNU[$x] =~ m/^XFAIL:/) {
980 $xfails.="$DEJAGNU[$x]\n";
981 }
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000982 }
983 }
Patrick Jenkinsad6f7582006-08-22 18:11:19 +0000984
985} #end if !$BuildError
986
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000987
988##############################################################
989#
990# If we built the tree successfully, runs of the Olden suite with
991# LARGE_PROBLEM_SIZE on so that we can get some "running" statistics.
992#
993##############################################################
994if (!$BuildError) {
Patrick Jenkinsd7210f92006-08-02 18:37:40 +0000995 if ( $VERBOSE ) { print "OLDEN TEST SUITE STAGE\n"; }
996 my ($NATTime, $CBETime, $LLCTime, $JITTime, $OptTime, $BytecodeSize,
997 $MachCodeSize) = ("","","","","","","");
998 if (!$NORUNNINGTESTS) {
999 ChangeDir( "$BuildDir/llvm/projects/llvm-test/MultiSource/Benchmarks/Olden",
Reid Spencerfa34d7b2006-08-13 09:53:02 +00001000 "Olden Test Directory");
Patrick Jenkinsfe030d72006-07-06 21:19:32 +00001001
Patrick Jenkinsd7210f92006-08-02 18:37:40 +00001002 # Clean out previous results...
1003 system "$NICE $MAKECMD $MAKEOPTS clean > /dev/null 2>&1";
Reid Spencerfa34d7b2006-08-13 09:53:02 +00001004
Patrick Jenkinsd7210f92006-08-02 18:37:40 +00001005 # Run the nightly test in this directory, with LARGE_PROBLEM_SIZE and
1006 # GET_STABLE_NUMBERS enabled!
Reid Spencerfa34d7b2006-08-13 09:53:02 +00001007 if( $VERBOSE ) {
1008 print "$MAKECMD -k $MAKEOPTS $PROGTESTOPTS report.nightly.csv.out " .
1009 "TEST=nightly LARGE_PROBLEM_SIZE=1 GET_STABLE_NUMBERS=1 " .
1010 "> /dev/null 2>&1\n";
1011 }
1012 system "$MAKECMD -k $MAKEOPTS $PROGTESTOPTS report.nightly.csv.out " .
1013 "TEST=nightly LARGE_PROBLEM_SIZE=1 GET_STABLE_NUMBERS=1 " .
1014 "> /dev/null 2>&1";
1015 system "cp report.nightly.csv $OldenTestsLog";
Patrick Jenkinsd7210f92006-08-02 18:37:40 +00001016 }
Patrick Jenkinsfe030d72006-07-06 21:19:32 +00001017}
1018
Patrick Jenkins215b48f2006-07-07 18:50:51 +00001019##############################################################
1020#
1021# Getting end timestamp
1022#
1023##############################################################
Patrick Jenkinsb67e1182006-07-21 21:43:09 +00001024$endtime = `date "+20%y-%m-%d %H:%M:%S"`;
Patrick Jenkins215b48f2006-07-07 18:50:51 +00001025
Patrick Jenkinsfe030d72006-07-06 21:19:32 +00001026
1027##############################################################
1028#
1029# Place all the logs neatly into one humungous file
1030#
1031##############################################################
Patrick Jenkinsfe030d72006-07-06 21:19:32 +00001032if ( $VERBOSE ) { print "PREPARING LOGS TO BE SENT TO SERVER\n"; }
1033
1034$machine_data = "uname: ".`uname -a`.
1035 "hardware: ".`uname -m`.
1036 "os: ".`uname -sr`.
1037 "name: ".`uname -n`.
1038 "date: ".`date \"+20%y-%m-%d\"`.
1039 "time: ".`date +\"%H:%M:%S\"`;
1040
1041my @CVS_DATA;
1042my $cvs_data;
Reid Spencer99e865a2007-04-07 04:41:16 +00001043@CVS_DATA = ReadFile "$COLog";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +00001044$cvs_data = join("\n", @CVS_DATA);
1045
1046my @BUILD_DATA;
1047my $build_data;
1048@BUILD_DATA = ReadFile "$BuildLog";
1049$build_data = join("\n", @BUILD_DATA);
1050
Patrick Jenkins03137752006-08-21 20:45:57 +00001051my (@DEJAGNU_LOG, @DEJAGNU_SUM, @DEJAGNULOG_FULL, @GCC_VERSION);
1052my ($dejagnutests_log ,$dejagnutests_sum, $dejagnulog_full) = "";
1053my ($gcc_version, $gcc_version_long) = "";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +00001054
Patrick Jenkinsad6f7582006-08-22 18:11:19 +00001055$gcc_version_long="";
1056if ($GCCPATH ne "") {
1057 $gcc_version_long = `$GCCPATH/gcc --version`;
Jeff Cohen75454222007-04-10 19:13:43 +00001058} elsif ($ENV{"CC"}) {
1059 $gcc_version_long = `$ENV{"CC"} --version`;
Patrick Jenkinsad6f7582006-08-22 18:11:19 +00001060} else {
1061 $gcc_version_long = `gcc --version`;
1062}
1063@GCC_VERSION = split '\n', $gcc_version_long;
1064$gcc_version = $GCC_VERSION[0];
1065
Tanya Lattner849c9a22007-04-13 04:36:48 +00001066$llvmgcc_version_long="";
1067if ($LLVMGCCPATH ne "") {
1068 $llvmgcc_version_long = `$LLVMGCCPATH/llvm-gcc -v 2>&1`;
1069} else {
1070 $llvmgcc_version_long = `llvm-gcc -v 2>&1`;
1071}
1072@LLVMGCC_VERSION = split '\n', $llvmgcc_version_long;
1073$llvmgcc_versionTarget = $LLVMGCC_VERSION[1];
1074$llvmgcc_versionTarget =~ /Target: (.+)/;
1075$targetTriple = $1;
1076
Patrick Jenkins03137752006-08-21 20:45:57 +00001077if(!$BuildError){
1078 @DEJAGNU_LOG = ReadFile "$DejagnuLog";
1079 @DEJAGNU_SUM = ReadFile "$DejagnuSum";
1080 $dejagnutests_log = join("\n", @DEJAGNU_LOG);
1081 $dejagnutests_sum = join("\n", @DEJAGNU_SUM);
Patrick Jenkinsfe030d72006-07-06 21:19:32 +00001082
Patrick Jenkins03137752006-08-21 20:45:57 +00001083 @DEJAGNULOG_FULL = ReadFile "$DejagnuTestsLog";
1084 $dejagnulog_full = join("\n", @DEJAGNULOG_FULL);
Patrick Jenkins79fbf7f2006-07-14 20:44:09 +00001085}
Patrick Jenkinsfe030d72006-07-06 21:19:32 +00001086
1087##############################################################
1088#
1089# Send data via a post request
1090#
1091##############################################################
1092
1093if ( $VERBOSE ) { print "SEND THE DATA VIA THE POST REQUEST\n"; }
1094
Reid Spencerfa34d7b2006-08-13 09:53:02 +00001095my %hash_of_data = (
1096 'machine_data' => $machine_data,
1097 'build_data' => $build_data,
1098 'gcc_version' => $gcc_version,
1099 'nickname' => $nickname,
1100 'dejagnutime_wall' => $DejagnuWallTime,
1101 'dejagnutime_cpu' => $DejagnuTime,
Reid Spencer99e865a2007-04-07 04:41:16 +00001102 'cvscheckouttime_wall' => $CheckoutTime_Wall,
1103 'cvscheckouttime_cpu' => $CheckoutTime_CPU,
Reid Spencerfa34d7b2006-08-13 09:53:02 +00001104 'configtime_wall' => $ConfigWallTime,
1105 'configtime_cpu'=> $ConfigTime,
1106 'buildtime_wall' => $BuildWallTime,
1107 'buildtime_cpu' => $BuildTime,
1108 'warnings' => $WarningsFile,
1109 'cvsusercommitlist' => $UserCommitList,
1110 'cvsuserupdatelist' => $UserUpdateList,
1111 'cvsaddedfiles' => $CVSAddedFiles,
1112 'cvsmodifiedfiles' => $CVSModifiedFiles,
1113 'cvsremovedfiles' => $CVSRemovedFiles,
1114 'lines_of_code' => $LOC,
1115 'cvs_file_count' => $NumFilesInCVS,
1116 'cvs_dir_count' => $NumDirsInCVS,
1117 'buildstatus' => $BuildStatus,
1118 'singlesource_programstable' => $SingleSourceProgramsTable,
1119 'multisource_programstable' => $MultiSourceProgramsTable,
1120 'externalsource_programstable' => $ExternalProgramsTable,
1121 'llcbeta_options' => $multisource_llcbeta_options,
1122 'warnings_removed' => $WarningsRemoved,
1123 'warnings_added' => $WarningsAdded,
1124 'passing_tests' => $passes,
1125 'expfail_tests' => $xfails,
1126 'unexpfail_tests' => $fails,
1127 'all_tests' => $dejagnu_test_list,
1128 'new_tests' => "",
1129 'removed_tests' => "",
Patrick Jenkinsb9c65eb2006-08-18 18:00:21 +00001130 'dejagnutests_results' => $DejagnuTestResults,
1131 'dejagnutests_log' => $dejagnulog_full,
Reid Spencerfa34d7b2006-08-13 09:53:02 +00001132 'starttime' => $starttime,
1133 'endtime' => $endtime,
1134 'o_file_sizes' => $o_file_sizes,
Tanya Lattner849c9a22007-04-13 04:36:48 +00001135 'a_file_sizes' => $a_file_sizes,
1136 'target_triple' => $targetTriple
Reid Spencerfa34d7b2006-08-13 09:53:02 +00001137);
Patrick Jenkinsfe030d72006-07-06 21:19:32 +00001138
1139$TESTING = 0;
1140
Reid Spencerfa34d7b2006-08-13 09:53:02 +00001141if ($TESTING) {
1142 print "============================\n";
1143 foreach $x(keys %hash_of_data){
1144 print "$x => $hash_of_data{$x}\n";
1145 }
1146} else {
1147 my $response = SendData $SUBMITSERVER,$SUBMITSCRIPT,\%hash_of_data;
1148 if( $VERBOSE) { print "============================\n$response"; }
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);