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