Regenerate.
[oota-llvm.git] / utils / NewNightlyTest.pl
1 #!/usr/bin/perl
2 use POSIX qw(strftime);
3 use File::Copy;
4 use 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 
12 #           to llvm.org where it is placed into the nightlytestresults database.
13 #
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.
22 #  -noremoveresults Do not remove the WEBDIR after it has been built.
23 #  -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.
29 #  -nodejagnu       Do not run feature or regression tests
30 #  -parallel        Run two parallel jobs with GNU Make.
31 #  -release         Build an LLVM Release version
32 #  -release-asserts Build an LLVM ReleaseAsserts version
33 #  -enable-llcbeta  Enable testing of beta features in llc.
34 #  -enable-lli      Enable testing of lli (interpreter) features, default is off
35 #  -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)
48 #  -target          Specify the target triplet
49 #  -cflags          Next argument specifies that C compilation options that
50 #                   override the default.
51 #  -cxxflags        Next argument specifies that C++ compilation options that
52 #                   override the default.
53 #  -ldflags         Next argument specifies that linker options that override
54 #                   the default.
55 #  -compileflags    Next argument specifies extra options passed to make when
56 #                   building LLVM.
57 #  -use-gmake       Use gmake instead of the default make command to build
58 #                   llvm and run tests.
59 #
60 #  ---------------- Options to configure llvm-test ----------------------------
61 #  -extraflags      Next argument specifies extra options that are passed to
62 #                   compile the tests.
63 #  -noexternals     Do not run the external tests (for cases where povray
64 #                   or SPEC are not installed)
65 #  -with-externals  Specify a directory where the external tests are located.
66 #  -submit-server   Specifies a server to submit the test results too. If this
67 #                   option is not specified it defaults to 
68 #                   llvm.org. This is basically just the address of the 
69 #                   webserver
70 #  -submit-script   Specifies which script to call on the submit server. If
71 #                   this option is not specified it defaults to
72 #                   /nightlytest/NightlyTestAccept.php. This is basically 
73 #                   everything after the www.yourserver.org.
74 #
75 # CVSROOT is the CVS repository from which the tree will be checked out,
76 #  specified either in the full :method:user@host:/dir syntax, or
77 #  just /dir if using a local repo.
78 # BUILDDIR is the directory where sources for this test run will be checked out
79 #  AND objects for this test run will be built. This directory MUST NOT
80 #  exist before the script is run; it will be created by the cvs checkout
81 #  process and erased (unless -noremove is specified; see above.)
82 # WEBDIR is the directory into which the test results web page will be written,
83 #  AND in which the "index.html" is assumed to be a symlink to the most recent
84 #  copy of the results. This directory will be created if it does not exist.
85 # LLVMGCCDIR is the directory in which the LLVM GCC Front End is installed
86 #  to. This is the same as you would have for a normal LLVM build.
87 #
88 ##############################################################
89 #
90 # Getting environment variables
91 #
92 ##############################################################
93 my $HOME       = $ENV{'HOME'};
94 my $CVSRootDir = $ENV{'CVSROOT'};
95 $CVSRootDir    = "/home/vadve/shared/PublicCVS" unless $CVSRootDir;
96 my $BuildDir   = $ENV{'BUILDDIR'};
97 $BuildDir      = "$HOME/buildtest" unless $BuildDir;
98 my $WebDir     = $ENV{'WEBDIR'};
99 $WebDir        = "$HOME/cvs/testresults-X86" unless $WebDir;
100
101 ##############################################################
102 #
103 # Calculate the date prefix...
104 #
105 ##############################################################
106 @TIME = localtime;
107 my $DATE = sprintf "%4d-%02d-%02d", $TIME[5]+1900, $TIME[4]+1, $TIME[3];
108 my $DateString = strftime "%B %d, %Y", localtime;
109 my $TestStartTime = gmtime() . "GMT<br>" . localtime() . " (local)";
110
111 ##############################################################
112 #
113 # Parse arguments...
114 #
115 ##############################################################
116 $CONFIGUREARGS="";
117 $nickname="";
118 $NOTEST=0;
119 $NORUNNINGTESTS=0;
120 $MAKECMD="make";
121 $SUBMITSERVER = "llvm.org";
122 $SUBMITSCRIPT = "/nightlytest/NightlyTestAccept.php";
123
124 while (scalar(@ARGV) and ($_ = $ARGV[0], /^[-+]/)) {
125   shift;
126   last if /^--$/;  # Stop processing arguments on --
127
128   # List command line options here...
129   if (/^-nocheckout$/)     { $NOCHECKOUT = 1; next; }
130   if (/^-nocvsstats$/)     { $NOCVSSTATS = 1; next; }
131   if (/^-noremove$/)       { $NOREMOVE = 1; next; }
132   if (/^-noremoveresults$/){ $NOREMOVERESULTS = 1; next; }
133   if (/^-notest$/)         { $NOTEST = 1; $NORUNNINGTESTS = 1; next; }
134   if (/^-norunningtests$/) { $NORUNNINGTESTS = 1; next; }
135   if (/^-parallel$/)       { $MAKEOPTS = "$MAKEOPTS -j2 -l3.0"; next; }
136   if (/^-release$/)        { $MAKEOPTS = "$MAKEOPTS ENABLE_OPTIMIZED=1 ".
137                              "OPTIMIZE_OPTION=-O2"; $BUILDTYPE="release"; next;}
138   if (/^-release-asserts$/){ $MAKEOPTS = "$MAKEOPTS ENABLE_OPTIMIZED=1 ".
139                              "DISABLE-ASSERTIONS=1 ".
140                              "OPTIMIZE_OPTION=-O2"; 
141                              $BUILDTYPE="release-asserts"; next;}
142   if (/^-enable-llcbeta$/) { $PROGTESTOPTS .= " ENABLE_LLCBETA=1"; next; }
143   if (/^-enable-lli$/)     { $PROGTESTOPTS .= " ENABLE_LLI=1";
144                              $CONFIGUREARGS .= " --enable-lli"; next; } 
145   if (/^-disable-llc$/)    { $PROGTESTOPTS .= " DISABLE_LLC=1";
146                              $CONFIGUREARGS .= " --disable-llc_diffs"; next; } 
147   if (/^-disable-jit$/)    { $PROGTESTOPTS .= " DISABLE_JIT=1";
148                              $CONFIGUREARGS .= " --disable-jit"; next; }
149   if (/^-disable-cbe$/)    { $PROGTESTOPTS .= " DISABLE_CBE=1"; next; }
150   if (/^-verbose$/)        { $VERBOSE = 1; next; }
151   if (/^-debug$/)          { $DEBUG = 1; next; }
152   if (/^-nice$/)           { $NICE = "nice "; next; }
153   if (/^-f2c$/)            { $CONFIGUREARGS .= " --with-f2c=$ARGV[0]"; 
154                              shift; next; }
155   if (/^-with-externals$/) { $CONFIGUREARGS .= " --with-externals=$ARGV[0]"; 
156                              shift; next; }
157   if (/^-submit-server/)   { $SUBMITSERVER = "$ARGV[0]"; shift; next; }
158   if (/^-submit-script/)   { $SUBMITSCRIPT = "$ARGV[0]"; shift; next; }
159   if (/^-nickname$/)       { $nickname = "$ARGV[0]"; shift; next; } 
160   if (/^-gccpath/)         { $CONFIGUREARGS .= 
161                              " CC=$ARGV[0]/gcc CXX=$ARGV[0]/g++"; 
162                              $GCCPATH=$ARGV[0]; shift;  next; }
163   else                     { $GCCPATH=""; }
164   if (/^-cvstag/)          { $CVSCOOPT .= " -r $ARGV[0]"; shift; next; } 
165   else                     { $CVSCOOPT="";}
166   if (/^-target/)          { $CONFIGUREARGS .= " --target=$ARGV[0]"; 
167                              shift; next; }
168   if (/^-cflags/)          { $MAKEOPTS = "$MAKEOPTS C.Flags=\'$ARGV[0]\'"; 
169                              shift; next; }
170   if (/^-cxxflags/)        { $MAKEOPTS = "$MAKEOPTS CXX.Flags=\'$ARGV[0]\'"; 
171                              shift; next; }
172   if (/^-ldflags/)         { $MAKEOPTS = "$MAKEOPTS LD.Flags=\'$ARGV[0]\'"; 
173                              shift; next; }
174   if (/^-compileflags/)    { $MAKEOPTS = "$MAKEOPTS $ARGV[0]"; shift; next; }
175   if (/^-use-gmake/)       { $MAKECMD = "gmake"; shift; next; }
176   if (/^-compileflags/)    { $MAKEOPTS = "$MAKEOPTS $ARGV[0]"; shift; next; }
177   if (/^-extraflags/)      { $CONFIGUREARGS .= 
178                              " --with-extra-options=\'$ARGV[0]\'"; shift; next;}
179   if (/^-noexternals$/)    { $NOEXTERNALS = 1; next; }
180   if (/^-nodejagnu$/)      { $NODEJAGNU = 1; next; }
181   if (/^-nobuild$/)        { $NOBUILD = 1; next; }
182   print "Unknown option: $_ : ignoring!\n";
183 }
184
185 if ($ENV{'LLVMGCCDIR'}) {
186   $CONFIGUREARGS .= " --with-llvmgccdir=" . $ENV{'LLVMGCCDIR'};
187 }
188 if ($CONFIGUREARGS !~ /--disable-jit/) {
189   $CONFIGUREARGS .= " --enable-jit";
190 }
191
192 if (@ARGV != 0 and @ARGV != 3 and $VERBOSE) {
193   foreach $x (@ARGV) {
194     print "$x\n";
195   }
196   print "Must specify 0 or 3 options!";
197 }
198
199 if (@ARGV == 3) {
200   $CVSRootDir = $ARGV[0];
201   $BuildDir   = $ARGV[1];
202   $WebDir     = $ARGV[2];
203 }
204
205 if ($CVSRootDir eq "" or
206     $BuildDir   eq "" or
207     $WebDir     eq "") {
208   die("please specify a cvs root directory, a build directory, and a ".
209        "web directory");
210  }
211  
212 if ($nickname eq "") {
213   die ("Please invoke NewNightlyTest.pl with command line option " . 
214        "\"-nickname <nickname>\"");
215 }
216
217 if ($BUILDTYPE ne "release" && $BUILDTYPE ne "release-asserts") {
218   $BUILDTYPE = "debug";
219 }
220
221 ##############################################################
222 #
223 #define the file names we'll use
224 #
225 ##############################################################
226 my $Prefix = "$WebDir/$DATE";
227 my $BuildLog = "$Prefix-Build-Log.txt";
228 my $CVSLog = "$Prefix-CVS-Log.txt";
229 my $OldenTestsLog = "$Prefix-Olden-tests.txt";
230 my $SingleSourceLog = "$Prefix-SingleSource-ProgramTest.txt.gz";
231 my $MultiSourceLog = "$Prefix-MultiSource-ProgramTest.txt.gz";
232 my $ExternalLog = "$Prefix-External-ProgramTest.txt.gz";
233 my $DejagnuLog = "$Prefix-Dejagnu-testrun.log";
234 my $DejagnuSum = "$Prefix-Dejagnu-testrun.sum";
235 my $DejagnuTestsLog = "$Prefix-DejagnuTests-Log.txt";
236 if (! -d $WebDir) {
237   mkdir $WebDir, 0777;
238   if($VERBOSE){
239     warn "$WebDir did not exist; creating it.\n";
240   }
241 }
242
243 if ($VERBOSE) {
244   print "INITIALIZED\n";
245   print "CVS Root = $CVSRootDir\n";
246   print "BuildDir = $BuildDir\n";
247   print "WebDir   = $WebDir\n";
248   print "Prefix   = $Prefix\n";
249   print "CVSLog   = $CVSLog\n";
250   print "BuildLog = $BuildLog\n";
251 }
252
253 ##############################################################
254 #
255 # Helper functions
256 #
257 ##############################################################
258 sub GetDir {
259   my $Suffix = shift;
260   opendir DH, $WebDir;
261   my @Result = reverse sort grep !/$DATE/, grep /[-0-9]+$Suffix/, readdir DH;
262   closedir DH;
263   return @Result;
264 }
265
266 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
267 #
268 # DiffFiles - Diff the current version of the file against the last version of
269 # the file, reporting things added and removed.  This is used to report, for
270 # example, added and removed warnings.  This returns a pair (added, removed)
271 #
272 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
273 sub DiffFiles {
274   my $Suffix = shift;
275   my @Others = GetDir $Suffix;
276   if (@Others == 0) {  # No other files?  We added all entries...
277     return (`cat $WebDir/$DATE$Suffix`, "");
278   }
279 # Diff the files now...
280   my @Diffs = split "\n", `diff $WebDir/$DATE$Suffix $WebDir/$Others[0]`;
281   my $Added   = join "\n", grep /^</, @Diffs;
282   my $Removed = join "\n", grep /^>/, @Diffs;
283   $Added =~ s/^< //gm;
284   $Removed =~ s/^> //gm;
285   return ($Added, $Removed);
286 }
287
288 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
289 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
290 sub GetRegex {   # (Regex with ()'s, value)
291   $_[1] =~ /$_[0]/m;
292   return $1 
293     if (defined($1));
294   return "0";
295 }
296
297 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
298 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
299 sub GetRegexNum {
300   my ($Regex, $Num, $Regex2, $File) = @_;
301   my @Items = split "\n", `grep '$Regex' $File`;
302   return GetRegex $Regex2, $Items[$Num];
303 }
304
305 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
306 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
307 sub ChangeDir { # directory, logical name
308   my ($dir,$name) = @_;
309   chomp($dir);
310   if ( $VERBOSE ) { print "Changing To: $name ($dir)\n"; }
311   $result = chdir($dir);
312   if (!$result) {
313     print "ERROR!!! Cannot change directory to: $name ($dir) because $!"; 
314     return false;
315   }
316   return true;
317 }
318
319 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
320 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
321 sub ReadFile {
322   if (open (FILE, $_[0])) {
323     undef $/;
324     my $Ret = <FILE>;
325     close FILE;
326     $/ = '\n';
327     return $Ret;
328   } else {
329     print "Could not open file '$_[0]' for reading!\n";
330     return "";
331   }
332 }
333
334 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
335 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
336 sub WriteFile {  # (filename, contents)
337   open (FILE, ">$_[0]") or die "Could not open file '$_[0]' for writing!\n";
338   print FILE $_[1];
339   close FILE;
340 }
341
342 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
343 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
344 sub CopyFile { #filename, newfile
345   my ($file, $newfile) = @_;
346   chomp($file);
347   if ($VERBOSE) { print "Copying $file to $newfile\n"; }
348   copy($file, $newfile);
349 }
350
351 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
352 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
353 sub AddRecord {
354   my ($Val, $Filename,$WebDir) = @_;
355   my @Records;
356   if (open FILE, "$WebDir/$Filename") {
357     @Records = grep !/$DATE/, split "\n", <FILE>;
358     close FILE;
359   }
360   push @Records, "$DATE: $Val";
361   WriteFile "$WebDir/$Filename", (join "\n", @Records) . "\n";
362 }
363
364 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
365 #
366 # FormatTime - Convert a time from 1m23.45 into 83.45
367 #
368 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
369 sub FormatTime {
370   my $Time = shift;
371   if ($Time =~ m/([0-9]+)m([0-9.]+)/) {
372     $Time = sprintf("%7.4f", $1*60.0+$2);
373   }
374   return $Time;
375 }
376
377 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
378 #
379 # This function is meant to read in the dejagnu sum file and 
380 # return a string with only the results (i.e. PASS/FAIL/XPASS/
381 # XFAIL).
382 #
383 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
384 sub GetDejagnuTestResults { # (filename, log)
385     my ($filename, $DejagnuLog) = @_;
386     my @lines;
387     $/ = "\n"; #Make sure we're going line at a time.
388
389     if( $VERBOSE) { print "DEJAGNU TEST RESULTS:\n"; }
390
391     if (open SRCHFILE, $filename) {
392         # Process test results
393         while ( <SRCHFILE> ) {
394             if ( length($_) > 1 ) {
395                 chomp($_);
396                 if ( m/^(PASS|XPASS|FAIL|XFAIL): .*\/llvm\/test\/(.*)$/ ) {
397                     push(@lines, "$1: test/$2");
398                 }
399             }
400         }
401     }
402     close SRCHFILE;
403
404     my $content = join("\n", @lines);
405     return $content;
406 }
407
408
409
410 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
411 #
412 # This function acts as a mini web browswer submitting data
413 # to our central server via the post method
414 #
415 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
416 sub SendData{
417     $host = $_[0];
418     $file = $_[1];
419     $variables=$_[2];
420
421     $port=80;
422     $socketaddr= sockaddr_in $port, inet_aton $host or die "Bad hostname\n";
423     socket SOCK, PF_INET, SOCK_STREAM, getprotobyname('tcp') or 
424       die "Bad socket\n";
425     connect SOCK, $socketaddr or die "Bad connection\n";
426     select((select(SOCK), $| = 1)[0]);
427
428     #creating content here
429     my $content;
430     foreach $key (keys (%$variables)){
431         $value = $variables->{$key};
432         $value =~ s/([^A-Za-z0-9])/sprintf("%%%02X", ord($1))/seg;
433         $content .= "$key=$value&";
434     }
435
436     $length = length($content);
437
438     my $send= "POST $file HTTP/1.0\n";
439     $send.= "Content-Type: application/x-www-form-urlencoded\n";
440     $send.= "Content-length: $length\n\n";
441     $send.= "$content";
442
443     print SOCK $send;
444     my $result;
445     while(<SOCK>){
446         $result  .= $_;
447     }
448     close(SOCK);
449
450     my $sentdata="";
451     foreach $x (keys (%$variables)){
452         $value = $variables->{$x};
453         $sentdata.= "$x  => $value\n";
454     }
455     WriteFile "$Prefix-sentdata.txt", $sentdata;
456     
457
458     return $result;
459 }
460
461 ##############################################################
462 #
463 # Getting Start timestamp
464 #
465 ##############################################################
466 $starttime = `date "+20%y-%m-%d %H:%M:%S"`;
467
468 ##############################################################
469 #
470 # Create the CVS repository directory
471 #
472 ##############################################################
473 if (!$NOCHECKOUT) {
474   if (-d $BuildDir) {
475     if (!$NOREMOVE) {
476       if ( $VERBOSE ) {
477         print "Build directory exists! Removing it\n";
478       }
479       system "rm -rf $BuildDir";
480       mkdir $BuildDir or die "Could not create CVS checkout directory $BuildDir!";
481     } else {
482       if ( $VERBOSE ) {
483         print "Build directory exists!\n";
484       }
485     }
486   } else {
487     mkdir $BuildDir or die "Could not create CVS checkout directory $BuildDir!";
488   }
489 }
490 ChangeDir( $BuildDir, "CVS checkout directory" );
491
492
493 ##############################################################
494 #
495 # Check out the llvm tree, saving CVS messages to the cvs log...
496 #
497 ##############################################################
498 my $CVSOPT = "";
499 # Use compression if going over ssh.
500 $CVSOPT = "-z3" 
501   if $CVSRootDir =~ /^:ext:/;
502 my $CVSCMD = "$NICE cvs $CVSOPT -d $CVSRootDir co -P $CVSCOOPT";
503 if (!$NOCHECKOUT) {
504   if ( $VERBOSE ) { 
505     print "CHECKOUT STAGE:\n"; 
506     print "( time -p $CVSCMD llvm; cd llvm/projects ; $CVSCMD llvm-test ) " .
507           "> $CVSLog 2>&1\n";
508   }
509   system "( time -p $CVSCMD llvm; cd llvm/projects ; " .
510       "$CVSCMD llvm-test ) > $CVSLog 2>&1";
511   ChangeDir( $BuildDir , "CVS Checkout directory") ;
512 }
513 ChangeDir( "llvm" , "llvm source directory") ;
514
515 ##############################################################
516 #
517 # Get some static statistics about the current state of CVS
518 #
519 # This can probably be put on the server side
520 #
521 ##############################################################
522 my $CVSCheckoutTime_Wall = GetRegex "([0-9.]+)", `grep '^real' $CVSLog`;
523 my $CVSCheckoutTime_User = GetRegex "([0-9.]+)", `grep '^user' $CVSLog`;
524 my $CVSCheckoutTime_Sys = GetRegex "([0-9.]+)", `grep '^sys' $CVSLog`;
525 my $CVSCheckoutTime_CPU = $CVSCheckoutTime_User + $CVSCheckoutTime_Sys;
526
527 my $NumFilesInCVS = `egrep '^U' $CVSLog | wc -l` + 0;
528 my $NumDirsInCVS  = 
529    `egrep '^cvs (checkout|server|update):' $CVSLog | wc -l` + 0;
530
531 ##############################################################
532 #
533 # Extract some information from the CVS history... use a hash so no duplicate
534 # stuff is stored. This gets the history from the previous days worth
535 # of cvs activity and parses it.
536 #
537 ##############################################################
538
539 my (%AddedFiles, %ModifiedFiles, %RemovedFiles, %UsersCommitted, %UsersUpdated);
540
541 if(!$NOCVSSTATS){
542
543   if ($VERBOSE) { print "CVS HISTORY ANALYSIS STAGE\n"; }
544   @CVSHistory = split "\n", `cvs history -D '1 day ago' -a -xAMROCGUW`;
545 #print join "\n", @CVSHistory; print "\n";
546
547   my $DateRE = '[-/:0-9 ]+\+[0-9]+';
548
549 # Loop over every record from the CVS history, filling in the hashes.
550   foreach $File (@CVSHistory) {
551       my ($Type, $Date, $UID, $Rev, $Filename);
552       if ($File =~ /([AMRUGC]) ($DateRE) ([^ ]+) +([^ ]+) +([^ ]+) +([^ ]+)/) {
553           ($Type, $Date, $UID, $Rev, $Filename) = ($1, $2, $3, $4, "$6/$5");
554       } elsif ($File =~ /([W]) ($DateRE) ([^ ]+)/) {
555           ($Type, $Date, $UID, $Rev, $Filename) = ($1, $2, $3, "", "");
556       } elsif ($File =~ /([O]) ($DateRE) ([^ ]+) +([^ ]+)/) {
557           ($Type, $Date, $UID, $Rev, $Filename) = ($1, $2, $3, "", "$4/");
558       } else {
559           print "UNMATCHABLE: $File\n";
560           next;
561       }
562       # print "$File\nTy = $Type Date = '$Date' UID=$UID Rev=$Rev File = '$Filename'\n";
563       
564       if ($Filename =~ /^llvm/) {
565           if ($Type eq 'M') {        # Modified
566               $ModifiedFiles{$Filename} = 1;
567               $UsersCommitted{$UID} = 1;
568           } elsif ($Type eq 'A') {   # Added
569               $AddedFiles{$Filename} = 1;
570               $UsersCommitted{$UID} = 1;
571           } elsif ($Type eq 'R') {   # Removed
572               $RemovedFiles{$Filename} = 1;
573               $UsersCommitted{$UID} = 1;
574           } else {
575               $UsersUpdated{$UID} = 1;
576           }
577       }
578   }
579
580   my $TestError = 1;
581
582 }#!NOCVSSTATS
583
584 my $CVSAddedFiles = join "\n", sort keys %AddedFiles;
585 my $CVSModifiedFiles = join "\n", sort keys %ModifiedFiles;
586 my $CVSRemovedFiles = join "\n", sort keys %RemovedFiles;
587 my $UserCommitList = join "\n", sort keys %UsersCommitted;
588 my $UserUpdateList = join "\n", sort keys %UsersUpdated;
589
590 ##############################################################
591 #
592 # Build the entire tree, saving build messages to the build log
593 #
594 ##############################################################
595 if (!$NOCHECKOUT && !$NOBUILD) {
596   my $EXTRAFLAGS = "--enable-spec --with-objroot=.";
597   if ( $VERBOSE ) {
598     print "CONFIGURE STAGE:\n";
599     print "(time -p $NICE ./configure $CONFIGUREARGS $EXTRAFLAGS) " . 
600           "> $BuildLog 2>&1\n";
601   }
602   system "(time -p $NICE ./configure $CONFIGUREARGS $EXTRAFLAGS) " . 
603          "> $BuildLog 2>&1";
604   if ( $VERBOSE ) { 
605     print "BUILD STAGE:\n";
606     print "(time -p $NICE $MAKECMD $MAKEOPTS) >> $BuildLog 2>&1\n";
607   }
608   # Build the entire tree, capturing the output into $BuildLog
609   system "(time -p $NICE $MAKECMD $MAKEOPTS) >> $BuildLog 2>&1";
610 }
611
612 ##############################################################
613 #
614 # Get some statistics about the build...
615 #
616 ##############################################################
617 #this can de done on server
618 #my @Linked = split '\n', `grep Linking $BuildLog`;
619 #my $NumExecutables = scalar(grep(/executable/, @Linked));
620 #my $NumLibraries   = scalar(grep(!/executable/, @Linked));
621 #my $NumObjects     = `grep ']\: Compiling ' $BuildLog | wc -l` + 0;
622
623 # Get the number of lines of source code. Must be here after the build is done
624 # because countloc.sh uses the llvm-config script which must be built.
625 my $LOC = `utils/countloc.sh -topdir $BuildDir/llvm`;
626
627 # Get the time taken by the configure script
628 my $ConfigTimeU = GetRegexNum "^user", 0, "([0-9.]+)", "$BuildLog";
629 my $ConfigTimeS = GetRegexNum "^sys", 0, "([0-9.]+)", "$BuildLog";
630 my $ConfigTime  = $ConfigTimeU+$ConfigTimeS;  # ConfigTime = User+System
631 my $ConfigWallTime = GetRegexNum "^real", 0,"([0-9.]+)","$BuildLog";
632
633 $ConfigTime=-1 unless $ConfigTime;
634 $ConfigWallTime=-1 unless $ConfigWallTime;
635
636 my $BuildTimeU = GetRegexNum "^user", 1, "([0-9.]+)", "$BuildLog";
637 my $BuildTimeS = GetRegexNum "^sys", 1, "([0-9.]+)", "$BuildLog";
638 my $BuildTime  = $BuildTimeU+$BuildTimeS;  # BuildTime = User+System
639 my $BuildWallTime = GetRegexNum "^real", 1, "([0-9.]+)","$BuildLog";
640
641 $BuildTime=-1 unless $BuildTime;
642 $BuildWallTime=-1 unless $BuildWallTime;
643
644 my $BuildError = 0, $BuildStatus = "OK";
645 if ($NOBUILD) {
646   $BuildStatus = "Skipped by user";
647   $BuildError = 1;
648 }
649 elsif (`grep '^$MAKECMD\[^:]*: .*Error' $BuildLog | wc -l` + 0 ||
650   `grep '^$MAKECMD: \*\*\*.*Stop.' $BuildLog | wc -l`+0) {
651   $BuildStatus = "Error: compilation aborted";
652   $BuildError = 1;
653   if( $VERBOSE) { print  "\n***ERROR BUILDING TREE\n\n"; }
654 }
655 if ($BuildError) { $NODEJAGNU=1; }
656
657 my $a_file_sizes="";
658 my $o_file_sizes="";
659 if (!$BuildError) {
660   print "Organizing size of .o and .a files\n" 
661     if ( $VERBOSE );
662   ChangeDir( "$BuildDir/llvm", "Build Directory" );
663   $afiles.= `find utils/ -iname '*.a' -ls`;
664   $afiles.= `find lib/ -iname '*.a' -ls`;
665   $afiles.= `find tools/ -iname '*.a' -ls`;
666   if($BUILDTYPE eq "release"){
667     $afiles.= `find Release/ -iname '*.a' -ls`;
668   } elsif($BUILDTYPE eq "release-asserts") {
669    $afiles.= `find Release-Asserts/ -iname '*.a' -ls`;
670   } else {
671    $afiles.= `find Debug/ -iname '*.a' -ls`;
672   }
673   
674   $ofiles.= `find utils/ -iname '*.o' -ls`;
675   $ofiles.= `find lib/ -iname '*.o' -ls`;
676   $ofiles.= `find tools/ -iname '*.o' -ls`;
677   if($BUILDTYPE eq "release"){
678     $ofiles.= `find Release/ -iname '*.o' -ls`;
679   } elsif($BUILDTYPE eq "release-asserts") {
680     $ofiles.= `find Release-Asserts/ -iname '*.o' -ls`;
681   } else {
682     $ofiles.= `find Debug/ -iname '*.o' -ls`;
683   }
684   
685   @AFILES = split "\n", $afiles;
686   $a_file_sizes="";
687   foreach $x (@AFILES){
688     $x =~ m/.+\s+.+\s+.+\s+.+\s+.+\s+.+\s+(.+)\s+.+\s+.+\s+.+\s+(.+)/;
689     $a_file_sizes.="$1 $2 $BUILDTYPE\n";
690   }
691   @OFILES = split "\n", $ofiles;
692   $o_file_sizes="";
693   foreach $x (@OFILES){
694     $x =~ m/.+\s+.+\s+.+\s+.+\s+.+\s+.+\s+(.+)\s+.+\s+.+\s+.+\s+(.+)/;
695     $o_file_sizes.="$1 $2 $BUILDTYPE\n";
696   }
697 } else {
698   $a_file_sizes="No data due to a bad build.";
699   $o_file_sizes="No data due to a bad build.";
700 }
701
702 ##############################################################
703 #
704 # Running dejagnu tests
705 #
706 ##############################################################
707 my $DejangnuTestResults=""; # String containing the results of the dejagnu
708 my $dejagnu_output = "$DejagnuTestsLog";
709 if (!$NODEJAGNU) {
710   if($VERBOSE) { 
711     print "DEJAGNU FEATURE/REGRESSION TEST STAGE:\n"; 
712     print "(time -p $MAKECMD $MAKEOPTS check) > $dejagnu_output 2>&1\n";
713   }
714
715   #Run the feature and regression tests, results are put into testrun.sum
716   #Full log in testrun.log
717   system "(time -p $MAKECMD $MAKEOPTS check) > $dejagnu_output 2>&1";
718   
719   #Copy the testrun.log and testrun.sum to our webdir
720   CopyFile("test/testrun.log", $DejagnuLog);
721   CopyFile("test/testrun.sum", $DejagnuSum);
722   #can be done on server
723   $DejagnuTestResults = GetDejagnuTestResults($DejagnuSum, $DejagnuLog);
724   $unexpfail_tests = $DejagnuTestResults;
725 }
726
727 #Extract time of dejagnu tests
728 my $DejagnuTimeU = GetRegexNum "^user", 0, "([0-9.]+)", "$dejagnu_output";
729 my $DejagnuTimeS = GetRegexNum "^sys", 0, "([0-9.]+)", "$dejagnu_output";
730 $DejagnuTime  = $DejagnuTimeU+$DejagnuTimeS;  # DejagnuTime = User+System
731 $DejagnuWallTime = GetRegexNum "^real", 0,"([0-9.]+)","$dejagnu_output"; 
732 $DejagnuTestResults = 
733   "Dejagnu skipped by user choice." unless $DejagnuTestResults;
734 $DejagnuTime     = "0.0" unless $DejagnuTime;
735 $DejagnuWallTime = "0.0" unless $DejagnuWallTime;
736
737 ##############################################################
738 #
739 # Get warnings from the build
740 #
741 ##############################################################
742 if (!$NODEJAGNU) {
743   if ( $VERBOSE ) { print "BUILD INFORMATION COLLECTION STAGE\n"; }
744   my @Warn = split "\n", `egrep 'warning:|Entering dir' $BuildLog`;
745   my @Warnings;
746   my $CurDir = "";
747
748   foreach $Warning (@Warn) {
749     if ($Warning =~ m/Entering directory \`([^\`]+)\'/) {
750       $CurDir = $1;                 # Keep track of directory warning is in...
751       # Remove buildir prefix if included
752       if ($CurDir =~ m#$BuildDir/llvm/(.*)#) { $CurDir = $1; }
753     } else {
754       push @Warnings, "$CurDir/$Warning";     # Add directory to warning...
755     }
756   }
757   my $WarningsFile =  join "\n", @Warnings;
758   $WarningsFile =~ s/:[0-9]+:/::/g;
759
760   # Emit the warnings file, so we can diff...
761   WriteFile "$WebDir/$DATE-Warnings.txt", $WarningsFile . "\n";
762   my ($WarningsAdded, $WarningsRemoved) = DiffFiles "-Warnings.txt";
763
764   # Output something to stdout if something has changed
765   #print "ADDED   WARNINGS:\n$WarningsAdded\n\n" if (length $WarningsAdded);
766   #print "REMOVED WARNINGS:\n$WarningsRemoved\n\n" if (length $WarningsRemoved);
767
768   #my @TmpWarningsAdded = split "\n", $WarningsAdded; ~PJ on upgrade
769   #my @TmpWarningsRemoved = split "\n", $WarningsRemoved; ~PJ on upgrade
770
771 } #endif !NODEGAGNU
772
773 ##############################################################
774 #
775 # If we built the tree successfully, run the nightly programs tests...
776 #
777 # A set of tests to run is passed in (i.e. "SingleSource" "MultiSource" 
778 # "External")
779 #
780 ##############################################################
781 sub TestDirectory {
782   my $SubDir = shift;  
783   ChangeDir( "$BuildDir/llvm/projects/llvm-test/$SubDir", 
784              "Programs Test Subdirectory" ) || return ("", "");
785   
786   my $ProgramTestLog = "$Prefix-$SubDir-ProgramTest.txt";
787   
788   # Run the programs tests... creating a report.nightly.csv file
789   if (!$NOTEST) {
790     if( $VERBOSE) { 
791       print "$MAKECMD -k $MAKEOPTS $PROGTESTOPTS report.nightly.csv ".
792             "TEST=nightly > $ProgramTestLog 2>&1\n"; 
793     }
794     system "$MAKECMD -k $MAKEOPTS $PROGTESTOPTS report.nightly.csv ".
795            "TEST=nightly > $ProgramTestLog 2>&1";
796     $llcbeta_options=`$MAKECMD print-llcbeta-option`;
797   } 
798
799   my $ProgramsTable;
800   if (`grep '^$MAKECMD\[^:]: .*Error' $ProgramTestLog | wc -l` + 0) {
801     $TestError = 1;
802     $ProgramsTable="Error running test $SubDir\n";
803     print "ERROR TESTING\n";
804   } elsif (`grep '^$MAKECMD\[^:]: .*No rule to make target' $ProgramTestLog | wc -l` + 0) {
805     $TestError = 1;
806     $ProgramsTable="Makefile error running tests $SubDir!\n";
807     print "ERROR TESTING\n";
808   } else {
809     $TestError = 0;
810   #
811   # Create a list of the tests which were run...
812   #
813   system "egrep 'TEST-(PASS|FAIL)' < $ProgramTestLog ".
814          "| sort > $Prefix-$SubDir-Tests.txt";
815   }
816   $ProgramsTable = ReadFile "report.nightly.csv";
817
818   ChangeDir( "../../..", "Programs Test Parent Directory" );
819   return ($ProgramsTable, $llcbeta_options);
820 } #end sub TestDirectory
821
822 ##############################################################
823 #
824 # Calling sub TestDirectory
825 #
826 ##############################################################
827 if (!$BuildError) {
828   if ( $VERBOSE ) {
829      print "SingleSource TEST STAGE\n";
830   }
831   ($SingleSourceProgramsTable, $llcbeta_options) = 
832     TestDirectory("SingleSource");
833   WriteFile "$Prefix-SingleSource-Performance.txt", $SingleSourceProgramsTable;
834   if ( $VERBOSE ) {
835     print "MultiSource TEST STAGE\n";
836   }
837   ($MultiSourceProgramsTable, $llcbeta_options) = TestDirectory("MultiSource");
838   WriteFile "$Prefix-MultiSource-Performance.txt", $MultiSourceProgramsTable;
839   if ( ! $NOEXTERNALS ) {
840     if ( $VERBOSE ) {
841       print "External TEST STAGE\n";
842     }
843     ($ExternalProgramsTable, $llcbeta_options) = TestDirectory("External");
844     WriteFile "$Prefix-External-Performance.txt", $ExternalProgramsTable;
845     system "cat $Prefix-SingleSource-Tests.txt " . 
846                "$Prefix-MultiSource-Tests.txt ".
847                "$Prefix-External-Tests.txt | sort > $Prefix-Tests.txt";
848     system "cat $Prefix-SingleSource-Performance.txt " . 
849                "$Prefix-MultiSource-Performance.txt ".
850                "$Prefix-External-Performance.txt | sort > $Prefix-Performance.txt";
851   } else {
852     $ExternalProgramsTable = "External TEST STAGE SKIPPED\n";
853     if ( $VERBOSE ) {
854       print "External TEST STAGE SKIPPED\n";
855     }
856     system "cat $Prefix-SingleSource-Tests.txt " . 
857                "$Prefix-MultiSource-Tests.txt ".
858                " | sort > $Prefix-Tests.txt";
859     system "cat $Prefix-SingleSource-Performance.txt " . 
860                "$Prefix-MultiSource-Performance.txt ".
861                " | sort > $Prefix-Performance.txt";
862   }
863
864   ##############################################################
865   #
866   # 
867   # gathering tests added removed broken information here 
868   #
869   #
870   ##############################################################
871   my $dejagnu_test_list = ReadFile "$Prefix-Tests.txt";
872   my @DEJAGNU = split "\n", $dejagnu_test_list;
873   my ($passes, $fails, $xfails) = "";
874
875   if(!$NODEJAGNU) {
876     for ($x=0; $x<@DEJAGNU; $x++) {
877       if ($DEJAGNU[$x] =~ m/^PASS:/) {
878         $passes.="$DEJAGNU[$x]\n";
879       }
880       elsif ($DEJAGNU[$x] =~ m/^FAIL:/) {
881         $fails.="$DEJAGNU[$x]\n";
882       }
883       elsif ($DEJAGNU[$x] =~ m/^XFAIL:/) {
884         $xfails.="$DEJAGNU[$x]\n";
885       }
886     }
887   }
888   
889 } #end if !$BuildError
890
891
892 ##############################################################
893 #
894 # If we built the tree successfully, runs of the Olden suite with
895 # LARGE_PROBLEM_SIZE on so that we can get some "running" statistics.
896 #
897 ##############################################################
898 if (!$BuildError) {
899   if ( $VERBOSE ) { print "OLDEN TEST SUITE STAGE\n"; }
900   my ($NATTime, $CBETime, $LLCTime, $JITTime, $OptTime, $BytecodeSize,
901   $MachCodeSize) = ("","","","","","","");
902   if (!$NORUNNINGTESTS) {
903     ChangeDir( "$BuildDir/llvm/projects/llvm-test/MultiSource/Benchmarks/Olden",
904                 "Olden Test Directory");
905
906     # Clean out previous results...
907     system "$NICE $MAKECMD $MAKEOPTS clean > /dev/null 2>&1";
908
909     # Run the nightly test in this directory, with LARGE_PROBLEM_SIZE and
910     # GET_STABLE_NUMBERS enabled!
911     if( $VERBOSE ) { 
912       print "$MAKECMD -k $MAKEOPTS $PROGTESTOPTS report.nightly.csv.out " .
913             "TEST=nightly  LARGE_PROBLEM_SIZE=1 GET_STABLE_NUMBERS=1 " .
914             "> /dev/null 2>&1\n"; 
915     }
916     system "$MAKECMD -k $MAKEOPTS $PROGTESTOPTS report.nightly.csv.out " .
917            "TEST=nightly LARGE_PROBLEM_SIZE=1 GET_STABLE_NUMBERS=1 " .
918            "> /dev/null 2>&1";
919     system "cp report.nightly.csv $OldenTestsLog";
920   }  
921 }
922
923 ##############################################################
924 #
925 # Getting end timestamp
926 #
927 ##############################################################
928 $endtime = `date "+20%y-%m-%d %H:%M:%S"`;
929
930
931 ##############################################################
932 #
933 # Place all the logs neatly into one humungous file
934 #
935 ##############################################################
936 if ( $VERBOSE ) { print "PREPARING LOGS TO BE SENT TO SERVER\n"; }
937
938 $machine_data = "uname: ".`uname -a`. 
939                 "hardware: ".`uname -m`.
940                 "os: ".`uname -sr`.
941                 "name: ".`uname -n`.
942                 "date: ".`date \"+20%y-%m-%d\"`.
943                 "time: ".`date +\"%H:%M:%S\"`; 
944
945 my @CVS_DATA;
946 my $cvs_data;
947 @CVS_DATA = ReadFile "$CVSLog";
948 $cvs_data = join("\n", @CVS_DATA);
949
950 my @BUILD_DATA;
951 my $build_data;
952 @BUILD_DATA = ReadFile "$BuildLog";
953 $build_data = join("\n", @BUILD_DATA);
954
955 my (@DEJAGNU_LOG, @DEJAGNU_SUM, @DEJAGNULOG_FULL, @GCC_VERSION);
956 my ($dejagnutests_log ,$dejagnutests_sum, $dejagnulog_full) = "";
957 my ($gcc_version, $gcc_version_long) = "";
958
959 $gcc_version_long="";
960 if ($GCCPATH ne "") {
961         $gcc_version_long = `$GCCPATH/gcc --version`;
962 } else {
963         $gcc_version_long = `gcc --version`;
964 }
965 @GCC_VERSION = split '\n', $gcc_version_long;
966 $gcc_version = $GCC_VERSION[0];
967
968 if(!$BuildError){
969   @DEJAGNU_LOG = ReadFile "$DejagnuLog";
970   @DEJAGNU_SUM = ReadFile "$DejagnuSum";
971   $dejagnutests_log = join("\n", @DEJAGNU_LOG);
972   $dejagnutests_sum = join("\n", @DEJAGNU_SUM);
973
974   @DEJAGNULOG_FULL = ReadFile "$DejagnuTestsLog";
975   $dejagnulog_full = join("\n", @DEJAGNULOG_FULL);
976 }
977
978 ##############################################################
979 #
980 # Send data via a post request
981 #
982 ##############################################################
983
984 if ( $VERBOSE ) { print "SEND THE DATA VIA THE POST REQUEST\n"; }
985
986 my %hash_of_data = (
987   'machine_data' => $machine_data,
988   'build_data' => $build_data,
989   'gcc_version' => $gcc_version,
990   'nickname' => $nickname,
991   'dejagnutime_wall' => $DejagnuWallTime,
992   'dejagnutime_cpu' => $DejagnuTime,
993   'cvscheckouttime_wall' => $CVSCheckoutTime_Wall,
994   'cvscheckouttime_cpu' => $CVSCheckoutTime_CPU,
995   'configtime_wall' => $ConfigWallTime,
996   'configtime_cpu'=> $ConfigTime,
997   'buildtime_wall' => $BuildWallTime,
998   'buildtime_cpu' => $BuildTime,
999   'warnings' => $WarningsFile,
1000   'cvsusercommitlist' => $UserCommitList,
1001   'cvsuserupdatelist' => $UserUpdateList,
1002   'cvsaddedfiles' => $CVSAddedFiles,
1003   'cvsmodifiedfiles' => $CVSModifiedFiles,
1004   'cvsremovedfiles' => $CVSRemovedFiles,
1005   'lines_of_code' => $LOC,
1006   'cvs_file_count' => $NumFilesInCVS,
1007   'cvs_dir_count' => $NumDirsInCVS,
1008   'buildstatus' => $BuildStatus,
1009   'singlesource_programstable' => $SingleSourceProgramsTable,
1010   'multisource_programstable' => $MultiSourceProgramsTable,
1011   'externalsource_programstable' => $ExternalProgramsTable,
1012   'llcbeta_options' => $multisource_llcbeta_options,
1013   'warnings_removed' => $WarningsRemoved,
1014   'warnings_added' => $WarningsAdded,
1015   'passing_tests' => $passes,
1016   'expfail_tests' => $xfails,
1017   'unexpfail_tests' => $fails,
1018   'all_tests' => $dejagnu_test_list,
1019   'new_tests' => "",
1020   'removed_tests' => "",
1021   'dejagnutests_results' => $DejagnuTestResults,
1022   'dejagnutests_log' => $dejagnulog_full,
1023   'starttime' => $starttime,
1024   'endtime' => $endtime,
1025   'o_file_sizes' => $o_file_sizes,
1026   'a_file_sizes' => $a_file_sizes
1027 );
1028
1029 $TESTING = 0;
1030
1031 if ($TESTING) {
1032   print "============================\n";
1033   foreach $x(keys %hash_of_data){
1034       print "$x  => $hash_of_data{$x}\n";
1035   }
1036 } else {
1037   my $response = SendData $SUBMITSERVER,$SUBMITSCRIPT,\%hash_of_data;
1038   if( $VERBOSE) { print "============================\n$response"; }
1039 }
1040
1041 ##############################################################
1042 #
1043 # Remove the cvs tree...
1044 #
1045 ##############################################################
1046 system ( "$NICE rm -rf $BuildDir") 
1047   if (!$NOCHECKOUT and !$NOREMOVE);
1048 system ( "$NICE rm -rf $WebDir") 
1049   if (!$NOCHECKOUT and !$NOREMOVE and !$NOREMOVERESULTS);