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