blob: 8ab069febece4dc7cb9308ae0c56d3538ba33e0a [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 Spencer99e865a2007-04-07 04:41:16 +000048# -usesvn Check code out from a subversion repository. With no
49# argument, use the standard repository. An argument specifies
50# the repository URL to use.
51# -svnurl Specify the SVN URL where LLVM can be found
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"};
99$SVNURL = 'svn://anon@hlvm.org:3691/llvm.svn' 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; }
185 if (/^-compileflags/) { $MAKEOPTS = "$MAKEOPTS $ARGV[0]"; shift; next; }
186 if (/^-extraflags/) { $CONFIGUREARGS .=
187 " --with-extra-options=\'$ARGV[0]\'"; shift; next;}
188 if (/^-noexternals$/) { $NOEXTERNALS = 1; next; }
189 if (/^-nodejagnu$/) { $NODEJAGNU = 1; next; }
190 if (/^-nobuild$/) { $NOBUILD = 1; next; }
191 print "Unknown option: $_ : ignoring!\n";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000192}
193
194if ($ENV{'LLVMGCCDIR'}) {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000195 $CONFIGUREARGS .= " --with-llvmgccdir=" . $ENV{'LLVMGCCDIR'};
Tanya Lattner849c9a22007-04-13 04:36:48 +0000196 $LLVMGCCPATH = $ENV{'LLVMGCCDIR'};
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000197}
Tanya Lattner849c9a22007-04-13 04:36:48 +0000198else {
199 $LLVMGCCPATH = "";
200}
201
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000202if ($CONFIGUREARGS !~ /--disable-jit/) {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000203 $CONFIGUREARGS .= " --enable-jit";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000204}
205
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000206if (@ARGV != 0 and @ARGV != 3 and $VERBOSE) {
207 foreach $x (@ARGV) {
208 print "$x\n";
209 }
210 print "Must specify 0 or 3 options!";
Patrick Jenkinsf58473f2006-07-27 01:03:46 +0000211}
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000212
213if (@ARGV == 3) {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000214 $CVSRootDir = $ARGV[0];
215 $BuildDir = $ARGV[1];
216 $WebDir = $ARGV[2];
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000217}
218
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000219if ($CVSRootDir eq "" or
220 $BuildDir eq "" or
221 $WebDir eq "") {
222 die("please specify a cvs root directory, a build directory, and a ".
Patrick Jenkinsf58473f2006-07-27 01:03:46 +0000223 "web directory");
224 }
225
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000226if ($nickname eq "") {
227 die ("Please invoke NewNightlyTest.pl with command line option " .
228 "\"-nickname <nickname>\"");
Patrick Jenkins514e2582006-07-20 22:28:43 +0000229}
Patrick Jenkins1cd46912006-07-27 01:17:17 +0000230
Jim Laskey27b8ba02006-09-28 17:49:20 +0000231if ($BUILDTYPE ne "release" && $BUILDTYPE ne "release-asserts") {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000232 $BUILDTYPE = "debug";
Patrick Jenkins26ba6092006-07-23 22:57:28 +0000233}
Patrick Jenkins514e2582006-07-20 22:28:43 +0000234
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000235##############################################################
236#
237#define the file names we'll use
238#
239##############################################################
240my $Prefix = "$WebDir/$DATE";
241my $BuildLog = "$Prefix-Build-Log.txt";
Reid Spencer99e865a2007-04-07 04:41:16 +0000242my $COLog = "$Prefix-CVS-Log.txt";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000243my $OldenTestsLog = "$Prefix-Olden-tests.txt";
244my $SingleSourceLog = "$Prefix-SingleSource-ProgramTest.txt.gz";
245my $MultiSourceLog = "$Prefix-MultiSource-ProgramTest.txt.gz";
Patrick Jenkins26ba6092006-07-23 22:57:28 +0000246my $ExternalLog = "$Prefix-External-ProgramTest.txt.gz";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000247my $DejagnuLog = "$Prefix-Dejagnu-testrun.log";
248my $DejagnuSum = "$Prefix-Dejagnu-testrun.sum";
249my $DejagnuTestsLog = "$Prefix-DejagnuTests-Log.txt";
250if (! -d $WebDir) {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000251 mkdir $WebDir, 0777;
Patrick Jenkins03137752006-08-21 20:45:57 +0000252 if($VERBOSE){
253 warn "$WebDir did not exist; creating it.\n";
254 }
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000255}
256
257if ($VERBOSE) {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000258 print "INITIALIZED\n";
Reid Spencer99e865a2007-04-07 04:41:16 +0000259 if ($USESVN) {
260 print "SVN URL = $SVNURL\n";
261 } else {
262 print "CVS Root = $CVSRootDir\n";
263 }
264 print "COLog = $COLog\n";
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000265 print "BuildDir = $BuildDir\n";
266 print "WebDir = $WebDir\n";
267 print "Prefix = $Prefix\n";
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000268 print "BuildLog = $BuildLog\n";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000269}
270
271##############################################################
272#
273# Helper functions
274#
275##############################################################
276sub GetDir {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000277 my $Suffix = shift;
278 opendir DH, $WebDir;
279 my @Result = reverse sort grep !/$DATE/, grep /[-0-9]+$Suffix/, readdir DH;
280 closedir DH;
281 return @Result;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000282}
283
284#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
285#
286# DiffFiles - Diff the current version of the file against the last version of
287# the file, reporting things added and removed. This is used to report, for
288# example, added and removed warnings. This returns a pair (added, removed)
289#
290#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
291sub DiffFiles {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000292 my $Suffix = shift;
293 my @Others = GetDir $Suffix;
294 if (@Others == 0) { # No other files? We added all entries...
295 return (`cat $WebDir/$DATE$Suffix`, "");
296 }
297# Diff the files now...
298 my @Diffs = split "\n", `diff $WebDir/$DATE$Suffix $WebDir/$Others[0]`;
299 my $Added = join "\n", grep /^</, @Diffs;
300 my $Removed = join "\n", grep /^>/, @Diffs;
301 $Added =~ s/^< //gm;
302 $Removed =~ s/^> //gm;
303 return ($Added, $Removed);
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000304}
305
306#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
307#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
308sub GetRegex { # (Regex with ()'s, value)
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000309 $_[1] =~ /$_[0]/m;
310 return $1
311 if (defined($1));
312 return "0";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000313}
314
315#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
316#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
317sub GetRegexNum {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000318 my ($Regex, $Num, $Regex2, $File) = @_;
319 my @Items = split "\n", `grep '$Regex' $File`;
320 return GetRegex $Regex2, $Items[$Num];
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000321}
322
323#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
324#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
325sub ChangeDir { # directory, logical name
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000326 my ($dir,$name) = @_;
327 chomp($dir);
328 if ( $VERBOSE ) { print "Changing To: $name ($dir)\n"; }
329 $result = chdir($dir);
330 if (!$result) {
331 print "ERROR!!! Cannot change directory to: $name ($dir) because $!";
332 return false;
333 }
334 return true;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000335}
336
337#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
338#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
339sub ReadFile {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000340 if (open (FILE, $_[0])) {
341 undef $/;
342 my $Ret = <FILE>;
343 close FILE;
344 $/ = '\n';
345 return $Ret;
346 } else {
347 print "Could not open file '$_[0]' for reading!\n";
348 return "";
349 }
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000350}
351
352#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
353#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
354sub WriteFile { # (filename, contents)
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000355 open (FILE, ">$_[0]") or die "Could not open file '$_[0]' for writing!\n";
356 print FILE $_[1];
357 close FILE;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000358}
359
360#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
361#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
362sub CopyFile { #filename, newfile
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000363 my ($file, $newfile) = @_;
364 chomp($file);
365 if ($VERBOSE) { print "Copying $file to $newfile\n"; }
366 copy($file, $newfile);
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000367}
368
369#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
370#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
371sub AddRecord {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000372 my ($Val, $Filename,$WebDir) = @_;
373 my @Records;
374 if (open FILE, "$WebDir/$Filename") {
375 @Records = grep !/$DATE/, split "\n", <FILE>;
376 close FILE;
377 }
378 push @Records, "$DATE: $Val";
379 WriteFile "$WebDir/$Filename", (join "\n", @Records) . "\n";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000380}
381
382#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
383#
384# FormatTime - Convert a time from 1m23.45 into 83.45
385#
386#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
387sub FormatTime {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000388 my $Time = shift;
389 if ($Time =~ m/([0-9]+)m([0-9.]+)/) {
390 $Time = sprintf("%7.4f", $1*60.0+$2);
391 }
392 return $Time;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000393}
394
395#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick Jenkinsb9c65eb2006-08-18 18:00:21 +0000396#
397# This function is meant to read in the dejagnu sum file and
398# return a string with only the results (i.e. PASS/FAIL/XPASS/
399# XFAIL).
400#
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000401#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
402sub GetDejagnuTestResults { # (filename, log)
Patrick Jenkinsb9c65eb2006-08-18 18:00:21 +0000403 my ($filename, $DejagnuLog) = @_;
404 my @lines;
405 $/ = "\n"; #Make sure we're going line at a time.
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000406
Patrick Jenkinsb9c65eb2006-08-18 18:00:21 +0000407 if( $VERBOSE) { print "DEJAGNU TEST RESULTS:\n"; }
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000408
Patrick Jenkinsb9c65eb2006-08-18 18:00:21 +0000409 if (open SRCHFILE, $filename) {
410 # Process test results
411 while ( <SRCHFILE> ) {
412 if ( length($_) > 1 ) {
413 chomp($_);
Jim Laskey01d7bcf2006-09-20 09:20:22 +0000414 if ( m/^(PASS|XPASS|FAIL|XFAIL): .*\/llvm\/test\/(.*)$/ ) {
415 push(@lines, "$1: test/$2");
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000416 }
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000417 }
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000418 }
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000419 }
Patrick Jenkinsb9c65eb2006-08-18 18:00:21 +0000420 close SRCHFILE;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000421
Patrick Jenkinsb9c65eb2006-08-18 18:00:21 +0000422 my $content = join("\n", @lines);
423 return $content;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000424}
425
426
Patrick Jenkinsb9c65eb2006-08-18 18:00:21 +0000427
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000428#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
429#
430# This function acts as a mini web browswer submitting data
431# to our central server via the post method
432#
433#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
434sub SendData{
435 $host = $_[0];
436 $file = $_[1];
437 $variables=$_[2];
438
439 $port=80;
440 $socketaddr= sockaddr_in $port, inet_aton $host or die "Bad hostname\n";
Patrick Jenkinsadea55e2006-07-17 16:41:19 +0000441 socket SOCK, PF_INET, SOCK_STREAM, getprotobyname('tcp') or
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000442 die "Bad socket\n";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000443 connect SOCK, $socketaddr or die "Bad connection\n";
444 select((select(SOCK), $| = 1)[0]);
445
446 #creating content here
447 my $content;
448 foreach $key (keys (%$variables)){
449 $value = $variables->{$key};
450 $value =~ s/([^A-Za-z0-9])/sprintf("%%%02X", ord($1))/seg;
451 $content .= "$key=$value&";
452 }
453
454 $length = length($content);
455
456 my $send= "POST $file HTTP/1.0\n";
Lauro Ramos Venancio46040232007-05-03 14:05:07 +0000457 $send.= "Host: $host\n";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000458 $send.= "Content-Type: application/x-www-form-urlencoded\n";
459 $send.= "Content-length: $length\n\n";
460 $send.= "$content";
461
Patrick Jenkinse8501eb2006-08-07 01:54:37 +0000462 print SOCK $send;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000463 my $result;
464 while(<SOCK>){
465 $result .= $_;
466 }
467 close(SOCK);
468
469 my $sentdata="";
Patrick Jenkins4c4e3562006-07-07 21:40:34 +0000470 foreach $x (keys (%$variables)){
Patrick Jenkins7267bd62006-07-10 18:35:41 +0000471 $value = $variables->{$x};
472 $sentdata.= "$x => $value\n";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000473 }
474 WriteFile "$Prefix-sentdata.txt", $sentdata;
Patrick Jenkins4c4e3562006-07-07 21:40:34 +0000475
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000476
477 return $result;
478}
479
Patrick Jenkins215b48f2006-07-07 18:50:51 +0000480##############################################################
481#
482# Getting Start timestamp
483#
484##############################################################
Patrick Jenkinsb67e1182006-07-21 21:43:09 +0000485$starttime = `date "+20%y-%m-%d %H:%M:%S"`;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000486
487##############################################################
488#
489# Create the CVS repository directory
490#
491##############################################################
492if (!$NOCHECKOUT) {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000493 if (-d $BuildDir) {
494 if (!$NOREMOVE) {
495 if ( $VERBOSE ) {
496 print "Build directory exists! Removing it\n";
497 }
498 system "rm -rf $BuildDir";
Reid Spencer99e865a2007-04-07 04:41:16 +0000499 mkdir $BuildDir or die "Could not create checkout directory $BuildDir!";
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000500 } else {
Jim Laskey6d8a1b72006-09-15 17:03:36 +0000501 if ( $VERBOSE ) {
502 print "Build directory exists!\n";
503 }
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000504 }
Jim Laskey6d8a1b72006-09-15 17:03:36 +0000505 } else {
Reid Spencer99e865a2007-04-07 04:41:16 +0000506 mkdir $BuildDir or die "Could not create checkout directory $BuildDir!";
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000507 }
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000508}
Reid Spencer99e865a2007-04-07 04:41:16 +0000509ChangeDir( $BuildDir, "checkout directory" );
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000510
511
512##############################################################
513#
Reid Spencer99e865a2007-04-07 04:41:16 +0000514# Check out the llvm tree, using either SVN or CVS
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000515#
516##############################################################
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000517if (!$NOCHECKOUT) {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000518 if ( $VERBOSE ) {
519 print "CHECKOUT STAGE:\n";
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000520 }
Reid Spencer99e865a2007-04-07 04:41:16 +0000521 if ($USESVN) {
522 my $SVNCMD = "$NICE svn co $SVNURL";
523 if ($VERBOSE) {
524 print "( time -p $SVNCMD/llvm/trunk llvm; cd llvm/projects ; " .
525 "$SVNCMD/llvm-test/trunk llvm-test ) > $COLog 2>&1\n";
526 system "( time -p $SVNCMD/llvm/trunk llvm; cd llvm/projects ; " .
527 "$SVNCMD/llvm-test/trunk llvm-test ) > $COLog 2>&1\n";
528 }
529 } else {
530 my $CVSOPT = "";
531 $CVSOPT = "-z3" # Use compression if going over ssh.
532 if $CVSRootDir =~ /^:ext:/;
533 my $CVSCMD = "$NICE cvs $CVSOPT -d $CVSRootDir co -P $CVSCOOPT";
534 print "( time -p $CVSCMD llvm; cd llvm/projects ; " .
Reid Spencerb5fda752007-04-07 05:20:07 +0000535 "$CVSCMD llvm-test ) > $COLog 2>&1\n";
Reid Spencer99e865a2007-04-07 04:41:16 +0000536 system "( time -p $CVSCMD llvm; cd llvm/projects ; " .
Reid Spencerb5fda752007-04-07 05:20:07 +0000537 "$CVSCMD llvm-test ) > $COLog 2>&1\n";
Reid Spencer99e865a2007-04-07 04:41:16 +0000538 }
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000539}
Reid Spencer99e865a2007-04-07 04:41:16 +0000540ChangeDir( $BuildDir , "Checkout directory") ;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000541ChangeDir( "llvm" , "llvm source directory") ;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000542
543##############################################################
544#
545# Get some static statistics about the current state of CVS
546#
547# This can probably be put on the server side
548#
549##############################################################
Reid Spencer99e865a2007-04-07 04:41:16 +0000550my $CheckoutTime_Wall = GetRegex "([0-9.]+)", `grep '^real' $COLog`;
551my $CheckoutTime_User = GetRegex "([0-9.]+)", `grep '^user' $COLog`;
552my $CheckoutTime_Sys = GetRegex "([0-9.]+)", `grep '^sys' $COLog`;
553my $CheckoutTime_CPU = $CVSCheckoutTime_User + $CVSCheckoutTime_Sys;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000554
Reid Spencer99e865a2007-04-07 04:41:16 +0000555my $NumFilesInCVS = 0;
556my $NumDirsInCVS = 0;
557if ($USESVN) {
558 $NumFilesInCVS = `egrep '^A' $COLog | wc -l` + 0;
559 $NumDirsInCVS = `sed -e 's#/[^/]*$##' $COLog | sort | uniq | wc -l` + 0;
560} else {
561 $NumFilesInCVS = `egrep '^U' $COLog | wc -l` + 0;
562 $NumDirsInCVS = `egrep '^cvs (checkout|server|update):' $COLog | wc -l` + 0;
563}
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000564
565##############################################################
566#
567# Extract some information from the CVS history... use a hash so no duplicate
568# stuff is stored. This gets the history from the previous days worth
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000569# of cvs activity and parses it.
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000570#
571##############################################################
572
Reid Spencer99e865a2007-04-07 04:41:16 +0000573# This just computes a reasonably accurate #of seconds since 2000. It doesn't
574# have to be perfect as its only used for comparing date ranges within a couple
575# of days.
576sub ConvertToSeconds {
577 my ($sec, $min, $hour, $day, $mon, $yr) = @_;
578 my $Result = ($yr - 2000) * 12;
579 $Result += $mon;
580 $Result *= 31;
581 $Result += $day;
582 $Result *= 24;
583 $Result += $hour;
584 $Result *= 60;
585 $Result += $min;
586 $Result *= 60;
587 $Result += $sec;
588 return $Result;
589}
590
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000591my (%AddedFiles, %ModifiedFiles, %RemovedFiles, %UsersCommitted, %UsersUpdated);
592
Reid Spencer99e865a2007-04-07 04:41:16 +0000593if (!$NOCVSSTATS) {
594 if ($VERBOSE) { print "CHANGE HISTORY ANALYSIS STAGE\n"; }
Reid Spencer776964a2007-04-04 06:59:36 +0000595
Reid Spencer99e865a2007-04-07 04:41:16 +0000596 if ($USESVN) {
597 @SVNHistory = split /<logentry/, `svn log --xml --verbose -r{$DATE}:HEAD`;
598 # Skip very first entry because it is the XML header cruft
599 shift @SVNHistory;
600 my $Now = time();
601 foreach $Record (@SVNHistory) {
602 my @Lines = split "\n", $Record;
603 my ($Author, $Date, $Revision);
604 # Get the date and see if its one we want to process.
605 my ($Year, $Month, $Day, $Hour, $Min, $Sec);
606 if ($Lines[3] =~ /<date>(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})/){
607 $Year = $1; $Month = $2; $Day = $3; $Hour = $4; $Min = $5; $Sec = $6;
608 }
609 my $Then = ConvertToSeconds($Sec, $Min, $Hour, $Day, $Month, $Year);
610 # Get the current date and compute when "yesterday" is.
611 my ($NSec, $NMin, $NHour, $NDay, $NMon, $NYear) = gmtime();
612 my $Now = ConvertToSeconds( $NSec, $NMin, $NHour, $NDay, $NMon, $NYear);
613 if (($Now - 24*60*60) > $Then) {
614 next;
615 }
616 if ($Lines[1] =~ / revision="([0-9]*)">/) {
617 $Revision = $1;
618 }
619 if ($Lines[2] =~ /<author>([^<]*)<\/author>/) {
620 $Author = $1;
621 }
622 $UsersCommitted{$Author} = 1;
623 $Date = $Year . "-" . $Month . "-" . $Day;
624 $Time = $Hour . ":" . $Min . ":" . $Sec;
625 print "Rev: $Revision, Author: $Author, Date: $Date, Time: $Time\n";
626 for ($i = 6; $i < $#Lines; $i += 2 ) {
627 if ($Lines[$i] =~ /^ action="(.)">([^<]*)</) {
628 if ($1 == "A") {
629 $AddedFiles{$2} = 1;
630 } elsif ($1 == 'D') {
631 $RemovedFiles{$2} = 1;
632 } elsif ($1 == 'M' || $1 == 'R' || $1 == 'C') {
633 $ModifiedFiles{$2} = 1;
634 } else {
635 print "UNMATCHABLE: $Lines[$i]\n";
636 }
637 }
638 }
639 }
640 } else {
641 @CVSHistory = split "\n", `cvs history -D '1 day ago' -a -xAMROCGUW`;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000642#print join "\n", @CVSHistory; print "\n";
643
Reid Spencer99e865a2007-04-07 04:41:16 +0000644 my $DateRE = '[-/:0-9 ]+\+[0-9]+';
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000645
646# Loop over every record from the CVS history, filling in the hashes.
Reid Spencer99e865a2007-04-07 04:41:16 +0000647 foreach $File (@CVSHistory) {
648 my ($Type, $Date, $UID, $Rev, $Filename);
649 if ($File =~ /([AMRUGC]) ($DateRE) ([^ ]+) +([^ ]+) +([^ ]+) +([^ ]+)/) {
650 ($Type, $Date, $UID, $Rev, $Filename) = ($1, $2, $3, $4, "$6/$5");
651 } elsif ($File =~ /([W]) ($DateRE) ([^ ]+)/) {
652 ($Type, $Date, $UID, $Rev, $Filename) = ($1, $2, $3, "", "");
653 } elsif ($File =~ /([O]) ($DateRE) ([^ ]+) +([^ ]+)/) {
654 ($Type, $Date, $UID, $Rev, $Filename) = ($1, $2, $3, "", "$4/");
655 } else {
656 print "UNMATCHABLE: $File\n";
657 next;
658 }
659 # print "$File\nTy = $Type Date = '$Date' UID=$UID Rev=$Rev File = '$Filename'\n";
660
661 if ($Filename =~ /^llvm/) {
662 if ($Type eq 'M') { # Modified
663 $ModifiedFiles{$Filename} = 1;
664 $UsersCommitted{$UID} = 1;
665 } elsif ($Type eq 'A') { # Added
666 $AddedFiles{$Filename} = 1;
667 $UsersCommitted{$UID} = 1;
668 } elsif ($Type eq 'R') { # Removed
669 $RemovedFiles{$Filename} = 1;
670 $UsersCommitted{$UID} = 1;
671 } else {
672 $UsersUpdated{$UID} = 1;
673 }
674 }
675 }
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000676
Reid Spencer99e865a2007-04-07 04:41:16 +0000677 my $TestError = 1;
678 } #$USESVN
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000679}#!NOCVSSTATS
680
681my $CVSAddedFiles = join "\n", sort keys %AddedFiles;
682my $CVSModifiedFiles = join "\n", sort keys %ModifiedFiles;
683my $CVSRemovedFiles = join "\n", sort keys %RemovedFiles;
684my $UserCommitList = join "\n", sort keys %UsersCommitted;
685my $UserUpdateList = join "\n", sort keys %UsersUpdated;
686
687##############################################################
688#
689# Build the entire tree, saving build messages to the build log
690#
691##############################################################
692if (!$NOCHECKOUT && !$NOBUILD) {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000693 my $EXTRAFLAGS = "--enable-spec --with-objroot=.";
694 if ( $VERBOSE ) {
695 print "CONFIGURE STAGE:\n";
696 print "(time -p $NICE ./configure $CONFIGUREARGS $EXTRAFLAGS) " .
697 "> $BuildLog 2>&1\n";
698 }
699 system "(time -p $NICE ./configure $CONFIGUREARGS $EXTRAFLAGS) " .
700 "> $BuildLog 2>&1";
701 if ( $VERBOSE ) {
702 print "BUILD STAGE:\n";
703 print "(time -p $NICE $MAKECMD $MAKEOPTS) >> $BuildLog 2>&1\n";
704 }
705 # Build the entire tree, capturing the output into $BuildLog
706 system "(time -p $NICE $MAKECMD $MAKEOPTS) >> $BuildLog 2>&1";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000707}
708
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000709##############################################################
710#
711# Get some statistics about the build...
712#
713##############################################################
714#this can de done on server
715#my @Linked = split '\n', `grep Linking $BuildLog`;
716#my $NumExecutables = scalar(grep(/executable/, @Linked));
717#my $NumLibraries = scalar(grep(!/executable/, @Linked));
718#my $NumObjects = `grep ']\: Compiling ' $BuildLog | wc -l` + 0;
719
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000720# Get the number of lines of source code. Must be here after the build is done
721# because countloc.sh uses the llvm-config script which must be built.
Patrick Jenkinsb993b0a2006-08-16 22:18:41 +0000722my $LOC = `utils/countloc.sh -topdir $BuildDir/llvm`;
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000723
724# Get the time taken by the configure script
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000725my $ConfigTimeU = GetRegexNum "^user", 0, "([0-9.]+)", "$BuildLog";
726my $ConfigTimeS = GetRegexNum "^sys", 0, "([0-9.]+)", "$BuildLog";
727my $ConfigTime = $ConfigTimeU+$ConfigTimeS; # ConfigTime = User+System
728my $ConfigWallTime = GetRegexNum "^real", 0,"([0-9.]+)","$BuildLog";
729
730$ConfigTime=-1 unless $ConfigTime;
731$ConfigWallTime=-1 unless $ConfigWallTime;
732
733my $BuildTimeU = GetRegexNum "^user", 1, "([0-9.]+)", "$BuildLog";
734my $BuildTimeS = GetRegexNum "^sys", 1, "([0-9.]+)", "$BuildLog";
735my $BuildTime = $BuildTimeU+$BuildTimeS; # BuildTime = User+System
736my $BuildWallTime = GetRegexNum "^real", 1, "([0-9.]+)","$BuildLog";
737
738$BuildTime=-1 unless $BuildTime;
739$BuildWallTime=-1 unless $BuildWallTime;
740
741my $BuildError = 0, $BuildStatus = "OK";
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000742if ($NOBUILD) {
743 $BuildStatus = "Skipped by user";
744 $BuildError = 1;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000745}
Patrick Jenkinsf58473f2006-07-27 01:03:46 +0000746elsif (`grep '^$MAKECMD\[^:]*: .*Error' $BuildLog | wc -l` + 0 ||
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000747 `grep '^$MAKECMD: \*\*\*.*Stop.' $BuildLog | wc -l`+0) {
748 $BuildStatus = "Error: compilation aborted";
749 $BuildError = 1;
750 if( $VERBOSE) { print "\n***ERROR BUILDING TREE\n\n"; }
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000751}
752if ($BuildError) { $NODEJAGNU=1; }
753
Patrick Jenkins169357e2006-07-23 21:38:07 +0000754my $a_file_sizes="";
755my $o_file_sizes="";
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000756if (!$BuildError) {
757 print "Organizing size of .o and .a files\n"
758 if ( $VERBOSE );
759 ChangeDir( "$BuildDir/llvm", "Build Directory" );
760 $afiles.= `find utils/ -iname '*.a' -ls`;
761 $afiles.= `find lib/ -iname '*.a' -ls`;
762 $afiles.= `find tools/ -iname '*.a' -ls`;
763 if($BUILDTYPE eq "release"){
Jim Laskey7a8efce2006-09-29 17:31:45 +0000764 $afiles.= `find Release/ -iname '*.a' -ls`;
Jim Laskey27b8ba02006-09-28 17:49:20 +0000765 } elsif($BUILDTYPE eq "release-asserts") {
766 $afiles.= `find Release-Asserts/ -iname '*.a' -ls`;
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000767 } else {
768 $afiles.= `find Debug/ -iname '*.a' -ls`;
769 }
770
771 $ofiles.= `find utils/ -iname '*.o' -ls`;
772 $ofiles.= `find lib/ -iname '*.o' -ls`;
773 $ofiles.= `find tools/ -iname '*.o' -ls`;
774 if($BUILDTYPE eq "release"){
Jim Laskey7a8efce2006-09-29 17:31:45 +0000775 $ofiles.= `find Release/ -iname '*.o' -ls`;
Jim Laskey27b8ba02006-09-28 17:49:20 +0000776 } elsif($BUILDTYPE eq "release-asserts") {
777 $ofiles.= `find Release-Asserts/ -iname '*.o' -ls`;
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000778 } else {
779 $ofiles.= `find Debug/ -iname '*.o' -ls`;
780 }
781
782 @AFILES = split "\n", $afiles;
783 $a_file_sizes="";
784 foreach $x (@AFILES){
785 $x =~ m/.+\s+.+\s+.+\s+.+\s+.+\s+.+\s+(.+)\s+.+\s+.+\s+.+\s+(.+)/;
786 $a_file_sizes.="$1 $2 $BUILDTYPE\n";
787 }
788 @OFILES = split "\n", $ofiles;
789 $o_file_sizes="";
790 foreach $x (@OFILES){
791 $x =~ m/.+\s+.+\s+.+\s+.+\s+.+\s+.+\s+(.+)\s+.+\s+.+\s+.+\s+(.+)/;
792 $o_file_sizes.="$1 $2 $BUILDTYPE\n";
793 }
794} else {
795 $a_file_sizes="No data due to a bad build.";
796 $o_file_sizes="No data due to a bad build.";
Patrick Jenkins169357e2006-07-23 21:38:07 +0000797}
Patrick Jenkins169357e2006-07-23 21:38:07 +0000798
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000799##############################################################
800#
801# Running dejagnu tests
802#
803##############################################################
Patrick Jenkinsb9c65eb2006-08-18 18:00:21 +0000804my $DejangnuTestResults=""; # String containing the results of the dejagnu
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000805my $dejagnu_output = "$DejagnuTestsLog";
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000806if (!$NODEJAGNU) {
807 if($VERBOSE) {
808 print "DEJAGNU FEATURE/REGRESSION TEST STAGE:\n";
809 print "(time -p $MAKECMD $MAKEOPTS check) > $dejagnu_output 2>&1\n";
810 }
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000811
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000812 #Run the feature and regression tests, results are put into testrun.sum
813 #Full log in testrun.log
814 system "(time -p $MAKECMD $MAKEOPTS check) > $dejagnu_output 2>&1";
815
816 #Copy the testrun.log and testrun.sum to our webdir
817 CopyFile("test/testrun.log", $DejagnuLog);
818 CopyFile("test/testrun.sum", $DejagnuSum);
819 #can be done on server
820 $DejagnuTestResults = GetDejagnuTestResults($DejagnuSum, $DejagnuLog);
821 $unexpfail_tests = $DejagnuTestResults;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000822}
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000823
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000824#Extract time of dejagnu tests
825my $DejagnuTimeU = GetRegexNum "^user", 0, "([0-9.]+)", "$dejagnu_output";
826my $DejagnuTimeS = GetRegexNum "^sys", 0, "([0-9.]+)", "$dejagnu_output";
827$DejagnuTime = $DejagnuTimeU+$DejagnuTimeS; # DejagnuTime = User+System
828$DejagnuWallTime = GetRegexNum "^real", 0,"([0-9.]+)","$dejagnu_output";
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000829$DejagnuTestResults =
830 "Dejagnu skipped by user choice." unless $DejagnuTestResults;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000831$DejagnuTime = "0.0" unless $DejagnuTime;
832$DejagnuWallTime = "0.0" unless $DejagnuWallTime;
833
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000834##############################################################
835#
836# Get warnings from the build
837#
838##############################################################
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000839if (!$NODEJAGNU) {
840 if ( $VERBOSE ) { print "BUILD INFORMATION COLLECTION STAGE\n"; }
841 my @Warn = split "\n", `egrep 'warning:|Entering dir' $BuildLog`;
842 my @Warnings;
843 my $CurDir = "";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000844
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000845 foreach $Warning (@Warn) {
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000846 if ($Warning =~ m/Entering directory \`([^\`]+)\'/) {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000847 $CurDir = $1; # Keep track of directory warning is in...
848 # Remove buildir prefix if included
849 if ($CurDir =~ m#$BuildDir/llvm/(.*)#) { $CurDir = $1; }
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000850 } else {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000851 push @Warnings, "$CurDir/$Warning"; # Add directory to warning...
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000852 }
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000853 }
854 my $WarningsFile = join "\n", @Warnings;
855 $WarningsFile =~ s/:[0-9]+:/::/g;
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000856
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000857 # Emit the warnings file, so we can diff...
858 WriteFile "$WebDir/$DATE-Warnings.txt", $WarningsFile . "\n";
859 my ($WarningsAdded, $WarningsRemoved) = DiffFiles "-Warnings.txt";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000860
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000861 # Output something to stdout if something has changed
862 #print "ADDED WARNINGS:\n$WarningsAdded\n\n" if (length $WarningsAdded);
863 #print "REMOVED WARNINGS:\n$WarningsRemoved\n\n" if (length $WarningsRemoved);
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000864
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000865 #my @TmpWarningsAdded = split "\n", $WarningsAdded; ~PJ on upgrade
866 #my @TmpWarningsRemoved = split "\n", $WarningsRemoved; ~PJ on upgrade
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000867
868} #endif !NODEGAGNU
869
870##############################################################
871#
872# If we built the tree successfully, run the nightly programs tests...
873#
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000874# A set of tests to run is passed in (i.e. "SingleSource" "MultiSource"
875# "External")
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000876#
877##############################################################
878sub TestDirectory {
Patrick Jenkinsad6f7582006-08-22 18:11:19 +0000879 my $SubDir = shift;
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000880 ChangeDir( "$BuildDir/llvm/projects/llvm-test/$SubDir",
881 "Programs Test Subdirectory" ) || return ("", "");
882
883 my $ProgramTestLog = "$Prefix-$SubDir-ProgramTest.txt";
884
885 # Run the programs tests... creating a report.nightly.csv file
886 if (!$NOTEST) {
887 if( $VERBOSE) {
888 print "$MAKECMD -k $MAKEOPTS $PROGTESTOPTS report.nightly.csv ".
889 "TEST=nightly > $ProgramTestLog 2>&1\n";
890 }
891 system "$MAKECMD -k $MAKEOPTS $PROGTESTOPTS report.nightly.csv ".
Patrick Jenkins59d1a662006-07-27 18:28:50 +0000892 "TEST=nightly > $ProgramTestLog 2>&1";
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000893 $llcbeta_options=`$MAKECMD print-llcbeta-option`;
894 }
895
Patrick Jenkins59d1a662006-07-27 18:28:50 +0000896 my $ProgramsTable;
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000897 if (`grep '^$MAKECMD\[^:]: .*Error' $ProgramTestLog | wc -l` + 0) {
Patrick Jenkins59d1a662006-07-27 18:28:50 +0000898 $TestError = 1;
899 $ProgramsTable="Error running test $SubDir\n";
900 print "ERROR TESTING\n";
901 } elsif (`grep '^$MAKECMD\[^:]: .*No rule to make target' $ProgramTestLog | wc -l` + 0) {
902 $TestError = 1;
903 $ProgramsTable="Makefile error running tests $SubDir!\n";
904 print "ERROR TESTING\n";
905 } else {
906 $TestError = 0;
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000907 #
908 # Create a list of the tests which were run...
909 #
910 system "egrep 'TEST-(PASS|FAIL)' < $ProgramTestLog ".
Patrick Jenkins4b7f7aa2006-08-17 22:11:03 +0000911 "| sort > $Prefix-$SubDir-Tests.txt";
Patrick Jenkins59d1a662006-07-27 18:28:50 +0000912 }
913 $ProgramsTable = ReadFile "report.nightly.csv";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000914
Patrick Jenkins59d1a662006-07-27 18:28:50 +0000915 ChangeDir( "../../..", "Programs Test Parent Directory" );
916 return ($ProgramsTable, $llcbeta_options);
Patrick Jenkins9e384ab2006-08-14 16:07:14 +0000917} #end sub TestDirectory
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000918
Patrick Jenkins4b7f7aa2006-08-17 22:11:03 +0000919##############################################################
920#
921# Calling sub TestDirectory
922#
923##############################################################
Patrick Jenkinsc281b0d2006-07-27 19:00:01 +0000924if (!$BuildError) {
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000925 if ( $VERBOSE ) {
Patrick Jenkinse631c4a2006-08-04 17:55:01 +0000926 print "SingleSource TEST STAGE\n";
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000927 }
928 ($SingleSourceProgramsTable, $llcbeta_options) =
929 TestDirectory("SingleSource");
Patrick Jenkins4b7f7aa2006-08-17 22:11:03 +0000930 WriteFile "$Prefix-SingleSource-Performance.txt", $SingleSourceProgramsTable;
Patrick Jenkins4257ccb2006-08-08 02:03:53 +0000931 if ( $VERBOSE ) {
Patrick Jenkins4b7f7aa2006-08-17 22:11:03 +0000932 print "MultiSource TEST STAGE\n";
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000933 }
934 ($MultiSourceProgramsTable, $llcbeta_options) = TestDirectory("MultiSource");
Patrick Jenkins4b7f7aa2006-08-17 22:11:03 +0000935 WriteFile "$Prefix-MultiSource-Performance.txt", $MultiSourceProgramsTable;
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000936 if ( ! $NOEXTERNALS ) {
937 if ( $VERBOSE ) {
938 print "External TEST STAGE\n";
939 }
940 ($ExternalProgramsTable, $llcbeta_options) = TestDirectory("External");
Patrick Jenkins4b7f7aa2006-08-17 22:11:03 +0000941 WriteFile "$Prefix-External-Performance.txt", $ExternalProgramsTable;
942 system "cat $Prefix-SingleSource-Tests.txt " .
943 "$Prefix-MultiSource-Tests.txt ".
944 "$Prefix-External-Tests.txt | sort > $Prefix-Tests.txt";
945 system "cat $Prefix-SingleSource-Performance.txt " .
946 "$Prefix-MultiSource-Performance.txt ".
947 "$Prefix-External-Performance.txt | sort > $Prefix-Performance.txt";
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000948 } else {
949 $ExternalProgramsTable = "External TEST STAGE SKIPPED\n";
950 if ( $VERBOSE ) {
951 print "External TEST STAGE SKIPPED\n";
952 }
Patrick Jenkins4b7f7aa2006-08-17 22:11:03 +0000953 system "cat $Prefix-SingleSource-Tests.txt " .
954 "$Prefix-MultiSource-Tests.txt ".
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000955 " | sort > $Prefix-Tests.txt";
Patrick Jenkins4b7f7aa2006-08-17 22:11:03 +0000956 system "cat $Prefix-SingleSource-Performance.txt " .
957 "$Prefix-MultiSource-Performance.txt ".
958 " | sort > $Prefix-Performance.txt";
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000959 }
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000960
Patrick Jenkinsad6f7582006-08-22 18:11:19 +0000961 ##############################################################
962 #
963 #
964 # gathering tests added removed broken information here
965 #
966 #
967 ##############################################################
968 my $dejagnu_test_list = ReadFile "$Prefix-Tests.txt";
969 my @DEJAGNU = split "\n", $dejagnu_test_list;
970 my ($passes, $fails, $xfails) = "";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000971
Patrick Jenkinsad6f7582006-08-22 18:11:19 +0000972 if(!$NODEJAGNU) {
973 for ($x=0; $x<@DEJAGNU; $x++) {
974 if ($DEJAGNU[$x] =~ m/^PASS:/) {
975 $passes.="$DEJAGNU[$x]\n";
976 }
977 elsif ($DEJAGNU[$x] =~ m/^FAIL:/) {
978 $fails.="$DEJAGNU[$x]\n";
979 }
980 elsif ($DEJAGNU[$x] =~ m/^XFAIL:/) {
981 $xfails.="$DEJAGNU[$x]\n";
982 }
Reid Spencerfa34d7b2006-08-13 09:53:02 +0000983 }
984 }
Patrick Jenkinsad6f7582006-08-22 18:11:19 +0000985
986} #end if !$BuildError
987
Patrick Jenkinsfe030d72006-07-06 21:19:32 +0000988
989##############################################################
990#
991# If we built the tree successfully, runs of the Olden suite with
992# LARGE_PROBLEM_SIZE on so that we can get some "running" statistics.
993#
994##############################################################
995if (!$BuildError) {
Patrick Jenkinsd7210f92006-08-02 18:37:40 +0000996 if ( $VERBOSE ) { print "OLDEN TEST SUITE STAGE\n"; }
997 my ($NATTime, $CBETime, $LLCTime, $JITTime, $OptTime, $BytecodeSize,
998 $MachCodeSize) = ("","","","","","","");
999 if (!$NORUNNINGTESTS) {
1000 ChangeDir( "$BuildDir/llvm/projects/llvm-test/MultiSource/Benchmarks/Olden",
Reid Spencerfa34d7b2006-08-13 09:53:02 +00001001 "Olden Test Directory");
Patrick Jenkinsfe030d72006-07-06 21:19:32 +00001002
Patrick Jenkinsd7210f92006-08-02 18:37:40 +00001003 # Clean out previous results...
1004 system "$NICE $MAKECMD $MAKEOPTS clean > /dev/null 2>&1";
Reid Spencerfa34d7b2006-08-13 09:53:02 +00001005
Patrick Jenkinsd7210f92006-08-02 18:37:40 +00001006 # Run the nightly test in this directory, with LARGE_PROBLEM_SIZE and
1007 # GET_STABLE_NUMBERS enabled!
Reid Spencerfa34d7b2006-08-13 09:53:02 +00001008 if( $VERBOSE ) {
1009 print "$MAKECMD -k $MAKEOPTS $PROGTESTOPTS report.nightly.csv.out " .
1010 "TEST=nightly LARGE_PROBLEM_SIZE=1 GET_STABLE_NUMBERS=1 " .
1011 "> /dev/null 2>&1\n";
1012 }
1013 system "$MAKECMD -k $MAKEOPTS $PROGTESTOPTS report.nightly.csv.out " .
1014 "TEST=nightly LARGE_PROBLEM_SIZE=1 GET_STABLE_NUMBERS=1 " .
1015 "> /dev/null 2>&1";
1016 system "cp report.nightly.csv $OldenTestsLog";
Patrick Jenkinsd7210f92006-08-02 18:37:40 +00001017 }
Patrick Jenkinsfe030d72006-07-06 21:19:32 +00001018}
1019
Patrick Jenkins215b48f2006-07-07 18:50:51 +00001020##############################################################
1021#
1022# Getting end timestamp
1023#
1024##############################################################
Patrick Jenkinsb67e1182006-07-21 21:43:09 +00001025$endtime = `date "+20%y-%m-%d %H:%M:%S"`;
Patrick Jenkins215b48f2006-07-07 18:50:51 +00001026
Patrick Jenkinsfe030d72006-07-06 21:19:32 +00001027
1028##############################################################
1029#
1030# Place all the logs neatly into one humungous file
1031#
1032##############################################################
Patrick Jenkinsfe030d72006-07-06 21:19:32 +00001033if ( $VERBOSE ) { print "PREPARING LOGS TO BE SENT TO SERVER\n"; }
1034
1035$machine_data = "uname: ".`uname -a`.
1036 "hardware: ".`uname -m`.
1037 "os: ".`uname -sr`.
1038 "name: ".`uname -n`.
1039 "date: ".`date \"+20%y-%m-%d\"`.
1040 "time: ".`date +\"%H:%M:%S\"`;
1041
1042my @CVS_DATA;
1043my $cvs_data;
Reid Spencer99e865a2007-04-07 04:41:16 +00001044@CVS_DATA = ReadFile "$COLog";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +00001045$cvs_data = join("\n", @CVS_DATA);
1046
1047my @BUILD_DATA;
1048my $build_data;
1049@BUILD_DATA = ReadFile "$BuildLog";
1050$build_data = join("\n", @BUILD_DATA);
1051
Patrick Jenkins03137752006-08-21 20:45:57 +00001052my (@DEJAGNU_LOG, @DEJAGNU_SUM, @DEJAGNULOG_FULL, @GCC_VERSION);
1053my ($dejagnutests_log ,$dejagnutests_sum, $dejagnulog_full) = "";
1054my ($gcc_version, $gcc_version_long) = "";
Patrick Jenkinsfe030d72006-07-06 21:19:32 +00001055
Patrick Jenkinsad6f7582006-08-22 18:11:19 +00001056$gcc_version_long="";
1057if ($GCCPATH ne "") {
1058 $gcc_version_long = `$GCCPATH/gcc --version`;
Jeff Cohen75454222007-04-10 19:13:43 +00001059} elsif ($ENV{"CC"}) {
1060 $gcc_version_long = `$ENV{"CC"} --version`;
Patrick Jenkinsad6f7582006-08-22 18:11:19 +00001061} else {
1062 $gcc_version_long = `gcc --version`;
1063}
1064@GCC_VERSION = split '\n', $gcc_version_long;
1065$gcc_version = $GCC_VERSION[0];
1066
Tanya Lattner849c9a22007-04-13 04:36:48 +00001067$llvmgcc_version_long="";
1068if ($LLVMGCCPATH ne "") {
1069 $llvmgcc_version_long = `$LLVMGCCPATH/llvm-gcc -v 2>&1`;
1070} else {
1071 $llvmgcc_version_long = `llvm-gcc -v 2>&1`;
1072}
1073@LLVMGCC_VERSION = split '\n', $llvmgcc_version_long;
1074$llvmgcc_versionTarget = $LLVMGCC_VERSION[1];
1075$llvmgcc_versionTarget =~ /Target: (.+)/;
1076$targetTriple = $1;
1077
Patrick Jenkins03137752006-08-21 20:45:57 +00001078if(!$BuildError){
1079 @DEJAGNU_LOG = ReadFile "$DejagnuLog";
1080 @DEJAGNU_SUM = ReadFile "$DejagnuSum";
1081 $dejagnutests_log = join("\n", @DEJAGNU_LOG);
1082 $dejagnutests_sum = join("\n", @DEJAGNU_SUM);
Patrick Jenkinsfe030d72006-07-06 21:19:32 +00001083
Patrick Jenkins03137752006-08-21 20:45:57 +00001084 @DEJAGNULOG_FULL = ReadFile "$DejagnuTestsLog";
1085 $dejagnulog_full = join("\n", @DEJAGNULOG_FULL);
Patrick Jenkins79fbf7f2006-07-14 20:44:09 +00001086}
Patrick Jenkinsfe030d72006-07-06 21:19:32 +00001087
1088##############################################################
1089#
1090# Send data via a post request
1091#
1092##############################################################
1093
1094if ( $VERBOSE ) { print "SEND THE DATA VIA THE POST REQUEST\n"; }
1095
Reid Spencerfa34d7b2006-08-13 09:53:02 +00001096my %hash_of_data = (
1097 'machine_data' => $machine_data,
1098 'build_data' => $build_data,
1099 'gcc_version' => $gcc_version,
1100 'nickname' => $nickname,
1101 'dejagnutime_wall' => $DejagnuWallTime,
1102 'dejagnutime_cpu' => $DejagnuTime,
Reid Spencer99e865a2007-04-07 04:41:16 +00001103 'cvscheckouttime_wall' => $CheckoutTime_Wall,
1104 'cvscheckouttime_cpu' => $CheckoutTime_CPU,
Reid Spencerfa34d7b2006-08-13 09:53:02 +00001105 'configtime_wall' => $ConfigWallTime,
1106 'configtime_cpu'=> $ConfigTime,
1107 'buildtime_wall' => $BuildWallTime,
1108 'buildtime_cpu' => $BuildTime,
1109 'warnings' => $WarningsFile,
1110 'cvsusercommitlist' => $UserCommitList,
1111 'cvsuserupdatelist' => $UserUpdateList,
1112 'cvsaddedfiles' => $CVSAddedFiles,
1113 'cvsmodifiedfiles' => $CVSModifiedFiles,
1114 'cvsremovedfiles' => $CVSRemovedFiles,
1115 'lines_of_code' => $LOC,
1116 'cvs_file_count' => $NumFilesInCVS,
1117 'cvs_dir_count' => $NumDirsInCVS,
1118 'buildstatus' => $BuildStatus,
1119 'singlesource_programstable' => $SingleSourceProgramsTable,
1120 'multisource_programstable' => $MultiSourceProgramsTable,
1121 'externalsource_programstable' => $ExternalProgramsTable,
1122 'llcbeta_options' => $multisource_llcbeta_options,
1123 'warnings_removed' => $WarningsRemoved,
1124 'warnings_added' => $WarningsAdded,
1125 'passing_tests' => $passes,
1126 'expfail_tests' => $xfails,
1127 'unexpfail_tests' => $fails,
1128 'all_tests' => $dejagnu_test_list,
1129 'new_tests' => "",
1130 'removed_tests' => "",
Patrick Jenkinsb9c65eb2006-08-18 18:00:21 +00001131 'dejagnutests_results' => $DejagnuTestResults,
1132 'dejagnutests_log' => $dejagnulog_full,
Reid Spencerfa34d7b2006-08-13 09:53:02 +00001133 'starttime' => $starttime,
1134 'endtime' => $endtime,
1135 'o_file_sizes' => $o_file_sizes,
Tanya Lattner849c9a22007-04-13 04:36:48 +00001136 'a_file_sizes' => $a_file_sizes,
1137 'target_triple' => $targetTriple
Reid Spencerfa34d7b2006-08-13 09:53:02 +00001138);
Patrick Jenkinsfe030d72006-07-06 21:19:32 +00001139
1140$TESTING = 0;
1141
Reid Spencerfa34d7b2006-08-13 09:53:02 +00001142if ($TESTING) {
1143 print "============================\n";
1144 foreach $x(keys %hash_of_data){
1145 print "$x => $hash_of_data{$x}\n";
1146 }
1147} else {
1148 my $response = SendData $SUBMITSERVER,$SUBMITSCRIPT,\%hash_of_data;
1149 if( $VERBOSE) { print "============================\n$response"; }
Patrick Jenkinsfe030d72006-07-06 21:19:32 +00001150}
1151
1152##############################################################
1153#
1154# Remove the cvs tree...
1155#
1156##############################################################
Reid Spencerfa34d7b2006-08-13 09:53:02 +00001157system ( "$NICE rm -rf $BuildDir")
1158 if (!$NOCHECKOUT and !$NOREMOVE);
1159system ( "$NICE rm -rf $WebDir")
1160 if (!$NOCHECKOUT and !$NOREMOVE and !$NOREMOVERESULTS);