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