Alkis Evlogimenos | 2e142f5 | 2004-01-07 01:48:26 +0000 | [diff] [blame] | 1 | #!/usr/bin/perl -w |
Chris Lattner | 4c7e303 | 2003-01-20 06:11:03 +0000 | [diff] [blame] | 2 | # |
| 3 | # Program: NightlyTest.pl |
| 4 | # |
| 5 | # Synopsis: Perform a series of tests which are designed to be run nightly. |
| 6 | # This is used to keep track of the status of the LLVM tree, tracking |
| 7 | # regressions and performance changes. This generates one web page a |
| 8 | # day which can be used to access this information. |
| 9 | # |
Brian Gaeke | b3dab90 | 2003-10-11 05:34:00 +0000 | [diff] [blame] | 10 | # Syntax: NightlyTest.pl [OPTIONS] [CVSROOT BUILDDIR WEBDIR] |
| 11 | # where |
| 12 | # OPTIONS may include one or more of the following: |
| 13 | # -nocheckout Do not create, checkout, update, or configure |
| 14 | # the source tree. |
| 15 | # -noremove Do not remove the BUILDDIR after it has been built. |
| 16 | # -notest Do not even attempt to run the test programs. Implies |
| 17 | # -norunningtests. |
| 18 | # -norunningtests Do not run the Olden benchmark suite with |
| 19 | # LARGE_PROBLEM_SIZE enabled. |
Tanya Lattner | 056ec06 | 2004-12-04 06:25:50 +0000 | [diff] [blame] | 20 | # -nodejagnu Do not run feature or regression tests |
Brian Gaeke | b3dab90 | 2003-10-11 05:34:00 +0000 | [diff] [blame] | 21 | # -parallel Run two parallel jobs with GNU Make. |
Reid Spencer | f6d0233 | 2004-06-11 07:06:22 +0000 | [diff] [blame] | 22 | # -release Build an LLVM Release version |
Reid Spencer | 39ce11b | 2005-01-13 18:02:40 +0000 | [diff] [blame] | 23 | # -enable-llcbeta Enable testing of beta features in llc. |
Brian Gaeke | 047e606 | 2004-08-05 19:54:59 +0000 | [diff] [blame] | 24 | # -disable-llc Disable LLC tests in the nightly tester. |
| 25 | # -disable-jit Disable JIT tests in the nightly tester. |
Evan Cheng | 2a0f984 | 2006-06-29 00:54:37 +0000 | [diff] [blame] | 26 | # -disable-cbe Disable C backend tests in the nightly tester. |
Chris Lattner | 4d00fde | 2004-05-28 20:30:23 +0000 | [diff] [blame] | 27 | # -verbose Turn on some debug output |
| 28 | # -debug Print information useful only to maintainers of this script. |
Reid Spencer | cb6a3aa | 2004-06-22 15:38:37 +0000 | [diff] [blame] | 29 | # -nice Checkout/Configure/Build with "nice" to reduce impact |
| 30 | # on busy servers. |
Misha Brukman | 2e9ac69 | 2004-11-08 03:28:27 +0000 | [diff] [blame] | 31 | # -f2c Next argument specifies path to F2C utility |
Reid Spencer | cb6a3aa | 2004-06-22 15:38:37 +0000 | [diff] [blame] | 32 | # -gnuplotscript Next argument specifies gnuplot script to use |
| 33 | # -templatefile Next argument specifies template file to use |
Chris Lattner | 892cdb3 | 2004-07-27 08:29:06 +0000 | [diff] [blame] | 34 | # -gccpath Path to gcc/g++ used to build LLVM |
Misha Brukman | f5f37f0 | 2005-05-26 16:28:55 +0000 | [diff] [blame] | 35 | # -cvstag Check out a specific CVS tag to build LLVM (useful for |
| 36 | # testing release branches) |
Misha Brukman | 4391bb5 | 2005-06-06 19:17:05 +0000 | [diff] [blame] | 37 | # -target Specify the target triplet |
Evan Cheng | 3468864 | 2006-02-08 09:08:06 +0000 | [diff] [blame] | 38 | # -cflags Next argument specifies that C compilation options that |
| 39 | # override the default. |
| 40 | # -cxxflags Next argument specifies that C++ compilation options that |
| 41 | # override the default. |
| 42 | # -ldflags Next argument specifies that linker options that override |
| 43 | # the default. |
Chris Lattner | f6dc20f | 2006-06-12 19:03:17 +0000 | [diff] [blame] | 44 | # -compileflags Next argument specifies extra options passed to make when |
| 45 | # building LLVM. |
Chris Lattner | bb0aca5 | 2003-12-19 03:47:31 +0000 | [diff] [blame] | 46 | # |
Chris Lattner | b0ddb49 | 2005-11-01 17:59:42 +0000 | [diff] [blame] | 47 | # ---------------- Options to configure llvm-test ---------------------------- |
Chris Lattner | f6dc20f | 2006-06-12 19:03:17 +0000 | [diff] [blame] | 48 | # -extraflags Next argument specifies extra options that are passed to |
| 49 | # compile the tests. |
| 50 | # -noexternals Do not run the external tests (for cases where povray |
| 51 | # or SPEC are not installed) |
| 52 | # -with-externals Specify a directory where the external tests are located. |
Chris Lattner | b0ddb49 | 2005-11-01 17:59:42 +0000 | [diff] [blame] | 53 | # |
Brian Gaeke | b3dab90 | 2003-10-11 05:34:00 +0000 | [diff] [blame] | 54 | # CVSROOT is the CVS repository from which the tree will be checked out, |
| 55 | # specified either in the full :method:user@host:/dir syntax, or |
| 56 | # just /dir if using a local repo. |
| 57 | # BUILDDIR is the directory where sources for this test run will be checked out |
| 58 | # AND objects for this test run will be built. This directory MUST NOT |
| 59 | # exist before the script is run; it will be created by the cvs checkout |
| 60 | # process and erased (unless -noremove is specified; see above.) |
| 61 | # WEBDIR is the directory into which the test results web page will be written, |
| 62 | # AND in which the "index.html" is assumed to be a symlink to the most recent |
Brian Gaeke | 90c82b9 | 2004-09-28 16:04:00 +0000 | [diff] [blame] | 63 | # copy of the results. This directory will be created if it does not exist. |
Reid Spencer | 932b69f | 2004-12-26 05:21:13 +0000 | [diff] [blame] | 64 | # LLVMGCCDIR is the directory in which the LLVM GCC Front End is installed |
| 65 | # to. This is the same as you would have for a normal LLVM build. |
Chris Lattner | 4c7e303 | 2003-01-20 06:11:03 +0000 | [diff] [blame] | 66 | # |
| 67 | use POSIX qw(strftime); |
Tanya Lattner | 5debe8c | 2004-11-21 00:02:40 +0000 | [diff] [blame] | 68 | use File::Copy; |
Chris Lattner | 4c7e303 | 2003-01-20 06:11:03 +0000 | [diff] [blame] | 69 | |
Brian Gaeke | b3dab90 | 2003-10-11 05:34:00 +0000 | [diff] [blame] | 70 | my $HOME = $ENV{'HOME'}; |
| 71 | my $CVSRootDir = $ENV{'CVSROOT'}; |
Chris Lattner | 9d13efa | 2003-10-14 01:22:08 +0000 | [diff] [blame] | 72 | $CVSRootDir = "/home/vadve/shared/PublicCVS" |
Chris Lattner | 4d00fde | 2004-05-28 20:30:23 +0000 | [diff] [blame] | 73 | unless $CVSRootDir; |
| 74 | my $BuildDir = $ENV{'BUILDDIR'}; |
| 75 | $BuildDir = "$HOME/buildtest" |
| 76 | unless $BuildDir; |
| 77 | my $WebDir = $ENV{'WEBDIR'}; |
| 78 | $WebDir = "$HOME/cvs/testresults-X86" |
| 79 | unless $WebDir; |
Chris Lattner | 2f8cb57 | 2003-01-20 18:05:27 +0000 | [diff] [blame] | 80 | |
| 81 | # Calculate the date prefix... |
| 82 | @TIME = localtime; |
| 83 | my $DATE = sprintf "%4d-%02d-%02d", $TIME[5]+1900, $TIME[4]+1, $TIME[3]; |
| 84 | my $DateString = strftime "%B %d, %Y", localtime; |
Chris Lattner | 004e19e | 2005-02-13 16:08:30 +0000 | [diff] [blame] | 85 | my $TestStartTime = gmtime() . "GMT<br>" . localtime() . " (local)"; |
Reid Spencer | cb6a3aa | 2004-06-22 15:38:37 +0000 | [diff] [blame] | 86 | |
| 87 | # Command line argument settings... |
| 88 | my $NOCHECKOUT = 0; |
Misha Brukman | 2e9ac69 | 2004-11-08 03:28:27 +0000 | [diff] [blame] | 89 | my $NOREMOVE = 0; |
Misha Brukman | 2e9ac69 | 2004-11-08 03:28:27 +0000 | [diff] [blame] | 90 | my $NOTEST = 0; |
Reid Spencer | cb6a3aa | 2004-06-22 15:38:37 +0000 | [diff] [blame] | 91 | my $NORUNNINGTESTS = 0; |
Reid Spencer | 1d91463 | 2004-06-23 07:45:46 +0000 | [diff] [blame] | 92 | my $NOEXTERNALS = 0; |
Misha Brukman | 2e9ac69 | 2004-11-08 03:28:27 +0000 | [diff] [blame] | 93 | my $MAKEOPTS = ""; |
Reid Spencer | cb6a3aa | 2004-06-22 15:38:37 +0000 | [diff] [blame] | 94 | my $PROGTESTOPTS = ""; |
Misha Brukman | 2e9ac69 | 2004-11-08 03:28:27 +0000 | [diff] [blame] | 95 | my $VERBOSE = 0; |
Reid Spencer | cb6a3aa | 2004-06-22 15:38:37 +0000 | [diff] [blame] | 96 | my $DEBUG = 0; |
Brian Gaeke | 047e606 | 2004-08-05 19:54:59 +0000 | [diff] [blame] | 97 | my $CONFIGUREARGS = ""; |
Misha Brukman | f5f37f0 | 2005-05-26 16:28:55 +0000 | [diff] [blame] | 98 | my $CVSCOOPT = "-APR"; |
Reid Spencer | cb6a3aa | 2004-06-22 15:38:37 +0000 | [diff] [blame] | 99 | my $NICE = ""; |
Tanya Lattner | 056ec06 | 2004-12-04 06:25:50 +0000 | [diff] [blame] | 100 | my $NODEJAGNU = 0; |
Chris Lattner | 2f8cb57 | 2003-01-20 18:05:27 +0000 | [diff] [blame] | 101 | |
Chris Lattner | b344030 | 2003-01-22 16:14:05 +0000 | [diff] [blame] | 102 | sub ReadFile { |
| 103 | if (open (FILE, $_[0])) { |
Reid Spencer | cb6a3aa | 2004-06-22 15:38:37 +0000 | [diff] [blame] | 104 | undef $/; |
Chris Lattner | b344030 | 2003-01-22 16:14:05 +0000 | [diff] [blame] | 105 | my $Ret = <FILE>; |
| 106 | close FILE; |
Reid Spencer | cb6a3aa | 2004-06-22 15:38:37 +0000 | [diff] [blame] | 107 | $/ = '\n'; |
Chris Lattner | b344030 | 2003-01-22 16:14:05 +0000 | [diff] [blame] | 108 | return $Ret; |
| 109 | } else { |
| 110 | print "Could not open file '$_[0]' for reading!"; |
| 111 | return ""; |
| 112 | } |
| 113 | } |
| 114 | |
Chris Lattner | 2f8cb57 | 2003-01-20 18:05:27 +0000 | [diff] [blame] | 115 | sub WriteFile { # (filename, contents) |
| 116 | open (FILE, ">$_[0]") or die "Could not open file '$_[0]' for writing!"; |
| 117 | print FILE $_[1]; |
| 118 | close FILE; |
| 119 | } |
| 120 | |
| 121 | sub GetRegex { # (Regex with ()'s, value) |
Chris Lattner | d9bdbaa | 2003-01-22 20:35:59 +0000 | [diff] [blame] | 122 | $_[1] =~ /$_[0]/m; |
Chris Lattner | 08e2476 | 2003-08-19 18:35:03 +0000 | [diff] [blame] | 123 | if (defined($1)) { |
| 124 | return $1; |
| 125 | } |
Reid Spencer | a337f0c | 2004-06-23 06:36:34 +0000 | [diff] [blame] | 126 | return "0"; |
Chris Lattner | 2f8cb57 | 2003-01-20 18:05:27 +0000 | [diff] [blame] | 127 | } |
| 128 | |
Brian Gaeke | 90c82b9 | 2004-09-28 16:04:00 +0000 | [diff] [blame] | 129 | sub Touch { |
| 130 | my @files = @_; |
| 131 | my $now = time; |
| 132 | foreach my $file (@files) { |
| 133 | if (! -f $file) { |
| 134 | open (FILE, ">$file") or warn "Could not create new file $file"; |
| 135 | close FILE; |
| 136 | } |
| 137 | utime $now, $now, $file; |
| 138 | } |
| 139 | } |
| 140 | |
Reid Spencer | cb6a3aa | 2004-06-22 15:38:37 +0000 | [diff] [blame] | 141 | sub AddRecord { |
| 142 | my ($Val, $Filename) = @_; |
| 143 | my @Records; |
| 144 | if (open FILE, "$WebDir/$Filename") { |
| 145 | @Records = grep !/$DATE/, split "\n", <FILE>; |
| 146 | close FILE; |
| 147 | } |
| 148 | push @Records, "$DATE: $Val"; |
| 149 | WriteFile "$WebDir/$Filename", (join "\n", @Records) . "\n"; |
Reid Spencer | cb6a3aa | 2004-06-22 15:38:37 +0000 | [diff] [blame] | 150 | } |
| 151 | |
Chris Lattner | 2f8cb57 | 2003-01-20 18:05:27 +0000 | [diff] [blame] | 152 | sub AddPreTag { # Add pre tags around nonempty list, or convert to "none" |
| 153 | $_ = shift; |
Reid Spencer | 7d6a515 | 2006-03-21 01:21:39 +0000 | [diff] [blame] | 154 | if (length) { return "<pre>$_</pre>"; } else { "<b>none</b><br>"; } |
| 155 | } |
| 156 | |
| 157 | sub ArrayToList { # Add <li> tags around nonempty list or convert to "none" |
| 158 | my $result = ""; |
| 159 | if (scalar @_) { |
| 160 | $result = "<ul>"; |
| 161 | foreach $item (@_) { |
| 162 | $result .= "<li><tt>$item</tt></li>"; |
| 163 | } |
| 164 | $result .= "</ul>"; |
| 165 | } else { |
| 166 | $result = "<p><b>none</b></p>"; |
| 167 | } |
| 168 | return $result; |
Chris Lattner | 2f8cb57 | 2003-01-20 18:05:27 +0000 | [diff] [blame] | 169 | } |
| 170 | |
Reid Spencer | cb6a3aa | 2004-06-22 15:38:37 +0000 | [diff] [blame] | 171 | sub ChangeDir { # directory, logical name |
| 172 | my ($dir,$name) = @_; |
| 173 | chomp($dir); |
| 174 | if ( $VERBOSE ) { print "Changing To: $name ($dir)\n"; } |
| 175 | chdir($dir) || die "Cannot change directory to: $name ($dir) "; |
| 176 | } |
| 177 | |
Tanya Lattner | 5debe8c | 2004-11-21 00:02:40 +0000 | [diff] [blame] | 178 | sub CopyFile { #filename, newfile |
| 179 | my ($file, $newfile) = @_; |
| 180 | chomp($file); |
| 181 | if ($VERBOSE) { print "Copying $file to $newfile\n"; } |
| 182 | copy($file, $newfile); |
| 183 | } |
| 184 | |
Chris Lattner | 2f8cb57 | 2003-01-20 18:05:27 +0000 | [diff] [blame] | 185 | sub GetDir { |
| 186 | my $Suffix = shift; |
| 187 | opendir DH, $WebDir; |
| 188 | my @Result = reverse sort grep !/$DATE/, grep /[-0-9]+$Suffix/, readdir DH; |
| 189 | closedir DH; |
| 190 | return @Result; |
| 191 | } |
| 192 | |
| 193 | # DiffFiles - Diff the current version of the file against the last version of |
| 194 | # the file, reporting things added and removed. This is used to report, for |
| 195 | # example, added and removed warnings. This returns a pair (added, removed) |
| 196 | # |
| 197 | sub DiffFiles { |
| 198 | my $Suffix = shift; |
| 199 | my @Others = GetDir $Suffix; |
| 200 | if (@Others == 0) { # No other files? We added all entries... |
| 201 | return (`cat $WebDir/$DATE$Suffix`, ""); |
| 202 | } |
| 203 | # Diff the files now... |
| 204 | my @Diffs = split "\n", `diff $WebDir/$DATE$Suffix $WebDir/$Others[0]`; |
| 205 | my $Added = join "\n", grep /^</, @Diffs; |
| 206 | my $Removed = join "\n", grep /^>/, @Diffs; |
Chris Lattner | 1cbc0a6 | 2003-01-20 19:18:44 +0000 | [diff] [blame] | 207 | $Added =~ s/^< //gm; |
| 208 | $Removed =~ s/^> //gm; |
Chris Lattner | 2f8cb57 | 2003-01-20 18:05:27 +0000 | [diff] [blame] | 209 | return ($Added, $Removed); |
| 210 | } |
| 211 | |
Chris Lattner | 196a14a | 2003-08-19 15:08:34 +0000 | [diff] [blame] | 212 | # FormatTime - Convert a time from 1m23.45 into 83.45 |
| 213 | sub FormatTime { |
| 214 | my $Time = shift; |
| 215 | if ($Time =~ m/([0-9]+)m([0-9.]+)/) { |
| 216 | $Time = sprintf("%7.4f", $1*60.0+$2); |
| 217 | } |
| 218 | return $Time; |
| 219 | } |
| 220 | |
Chris Lattner | bf6a4dc | 2003-08-18 06:05:21 +0000 | [diff] [blame] | 221 | sub GetRegexNum { |
| 222 | my ($Regex, $Num, $Regex2, $File) = @_; |
| 223 | my @Items = split "\n", `grep '$Regex' $File`; |
| 224 | return GetRegex $Regex2, $Items[$Num]; |
| 225 | } |
| 226 | |
Tanya Lattner | 5debe8c | 2004-11-21 00:02:40 +0000 | [diff] [blame] | 227 | sub GetDejagnuTestResults { # (filename, log) |
| 228 | my ($filename, $DejagnuLog) = @_; |
| 229 | my @lines; |
| 230 | my $firstline; |
| 231 | $/ = "\n"; #Make sure we're going line at a time. |
Chris Lattner | 453d062 | 2005-03-10 16:26:50 +0000 | [diff] [blame] | 232 | |
Chris Lattner | 8f45731 | 2005-03-17 16:07:45 +0000 | [diff] [blame] | 233 | print "DEJAGNU TEST RESULTS:\n"; |
Chris Lattner | 453d062 | 2005-03-10 16:26:50 +0000 | [diff] [blame] | 234 | |
Tanya Lattner | 5debe8c | 2004-11-21 00:02:40 +0000 | [diff] [blame] | 235 | if (open SRCHFILE, $filename) { |
| 236 | # Process test results |
Tanya Lattner | 5debe8c | 2004-11-21 00:02:40 +0000 | [diff] [blame] | 237 | my $first_list = 1; |
| 238 | my $should_break = 1; |
| 239 | my $nocopy = 0; |
| 240 | my $readingsum = 0; |
| 241 | while ( <SRCHFILE> ) { |
| 242 | if ( length($_) > 1 ) { |
| 243 | chomp($_); |
| 244 | if ( m/^XPASS:/ || m/^FAIL:/ ) { |
| 245 | $nocopy = 0; |
| 246 | if ( $first_list ) { |
Misha Brukman | d3a5412 | 2005-03-10 16:32:33 +0000 | [diff] [blame] | 247 | push(@lines, "<h3>UNEXPECTED TEST RESULTS</h3><ol><li>\n"); |
Tanya Lattner | 5debe8c | 2004-11-21 00:02:40 +0000 | [diff] [blame] | 248 | $first_list = 0; |
| 249 | $should_break = 1; |
Misha Brukman | d3a5412 | 2005-03-10 16:32:33 +0000 | [diff] [blame] | 250 | push(@lines, "<b>$_</b><br/>\n"); |
Chris Lattner | 453d062 | 2005-03-10 16:26:50 +0000 | [diff] [blame] | 251 | print " $_\n"; |
Tanya Lattner | 5debe8c | 2004-11-21 00:02:40 +0000 | [diff] [blame] | 252 | } else { |
Misha Brukman | d3a5412 | 2005-03-10 16:32:33 +0000 | [diff] [blame] | 253 | push(@lines, "</li><li><b>$_</b><br/>\n"); |
Chris Lattner | 453d062 | 2005-03-10 16:26:50 +0000 | [diff] [blame] | 254 | print " $_\n"; |
Tanya Lattner | 5debe8c | 2004-11-21 00:02:40 +0000 | [diff] [blame] | 255 | } |
| 256 | } elsif ( m/Summary/ ) { |
Chris Lattner | 453d062 | 2005-03-10 16:26:50 +0000 | [diff] [blame] | 257 | if ( $first_list ) { |
Misha Brukman | d3a5412 | 2005-03-10 16:32:33 +0000 | [diff] [blame] | 258 | push(@lines, "<b>PERFECT!</b>"); |
| 259 | print " PERFECT!\n"; |
| 260 | } else { |
| 261 | push(@lines, "</li></ol>\n"); |
| 262 | } |
| 263 | push(@lines, "<h3>STATISTICS</h3><pre>\n"); |
Chris Lattner | 8f45731 | 2005-03-17 16:07:45 +0000 | [diff] [blame] | 264 | print "\nDEJAGNU STATISTICS:\n"; |
Tanya Lattner | 5debe8c | 2004-11-21 00:02:40 +0000 | [diff] [blame] | 265 | $should_break = 0; |
| 266 | $nocopy = 0; |
| 267 | $readingsum = 1; |
| 268 | } elsif ( $readingsum ) { |
| 269 | push(@lines,"$_\n"); |
Chris Lattner | 8f45731 | 2005-03-17 16:07:45 +0000 | [diff] [blame] | 270 | print " $_\n"; |
Tanya Lattner | 5debe8c | 2004-11-21 00:02:40 +0000 | [diff] [blame] | 271 | } |
| 272 | } |
| 273 | } |
| 274 | } |
| 275 | push(@lines, "</pre>\n"); |
| 276 | close SRCHFILE; |
| 277 | |
Misha Brukman | d3a5412 | 2005-03-10 16:32:33 +0000 | [diff] [blame] | 278 | my $content = join("", @lines); |
Tanya Lattner | 5debe8c | 2004-11-21 00:02:40 +0000 | [diff] [blame] | 279 | return "$content</li></ol>\n"; |
| 280 | } |
| 281 | |
Reid Spencer | cb6a3aa | 2004-06-22 15:38:37 +0000 | [diff] [blame] | 282 | |
| 283 | ##################################################################### |
| 284 | ## MAIN PROGRAM |
| 285 | ##################################################################### |
| 286 | |
| 287 | my $Template = ""; |
| 288 | my $PlotScriptFilename = ""; |
| 289 | |
| 290 | # Parse arguments... |
| 291 | while (scalar(@ARGV) and ($_ = $ARGV[0], /^[-+]/)) { |
| 292 | shift; |
| 293 | last if /^--$/; # Stop processing arguments on -- |
| 294 | |
| 295 | # List command line options here... |
| 296 | if (/^-nocheckout$/) { $NOCHECKOUT = 1; next; } |
Misha Brukman | 2e9ac69 | 2004-11-08 03:28:27 +0000 | [diff] [blame] | 297 | if (/^-noremove$/) { $NOREMOVE = 1; next; } |
Misha Brukman | 2e9ac69 | 2004-11-08 03:28:27 +0000 | [diff] [blame] | 298 | if (/^-notest$/) { $NOTEST = 1; $NORUNNINGTESTS = 1; next; } |
Reid Spencer | cb6a3aa | 2004-06-22 15:38:37 +0000 | [diff] [blame] | 299 | if (/^-norunningtests$/) { $NORUNNINGTESTS = 1; next; } |
Misha Brukman | 2e9ac69 | 2004-11-08 03:28:27 +0000 | [diff] [blame] | 300 | if (/^-parallel$/) { $MAKEOPTS = "$MAKEOPTS -j2 -l3.0"; next; } |
| 301 | if (/^-release$/) { $MAKEOPTS = "$MAKEOPTS ENABLE_OPTIMIZED=1"; next; } |
Chris Lattner | c82a6c8 | 2005-01-08 21:03:58 +0000 | [diff] [blame] | 302 | if (/^-enable-llcbeta$/) { $PROGTESTOPTS .= " ENABLE_LLCBETA=1"; next; } |
Brian Gaeke | 047e606 | 2004-08-05 19:54:59 +0000 | [diff] [blame] | 303 | if (/^-disable-llc$/) { $PROGTESTOPTS .= " DISABLE_LLC=1"; |
| 304 | $CONFIGUREARGS .= " --disable-llc_diffs"; next; } |
| 305 | if (/^-disable-jit$/) { $PROGTESTOPTS .= " DISABLE_JIT=1"; |
| 306 | $CONFIGUREARGS .= " --disable-jit"; next; } |
Evan Cheng | 2a0f984 | 2006-06-29 00:54:37 +0000 | [diff] [blame] | 307 | if (/^-disable-cbe$/) { $PROGTESTOPTS .= " DISABLE_CBE=1"; next; } |
Misha Brukman | 2e9ac69 | 2004-11-08 03:28:27 +0000 | [diff] [blame] | 308 | if (/^-verbose$/) { $VERBOSE = 1; next; } |
| 309 | if (/^-debug$/) { $DEBUG = 1; next; } |
| 310 | if (/^-nice$/) { $NICE = "nice "; next; } |
| 311 | if (/^-f2c$/) { |
| 312 | $CONFIGUREARGS .= " --with-f2c=$ARGV[0]"; shift; next; |
| 313 | } |
Reid Spencer | 43fdfdc | 2006-04-14 13:53:56 +0000 | [diff] [blame] | 314 | if (/^-with-externals/) { |
Evan Cheng | 19fd7ef | 2006-06-07 05:28:07 +0000 | [diff] [blame] | 315 | $CONFIGUREARGS .= " --with-externals=$ARGV[0]"; shift; next |
Reid Spencer | 43fdfdc | 2006-04-14 13:53:56 +0000 | [diff] [blame] | 316 | } |
Reid Spencer | cb6a3aa | 2004-06-22 15:38:37 +0000 | [diff] [blame] | 317 | if (/^-gnuplotscript$/) { $PlotScriptFilename = $ARGV[0]; shift; next; } |
Reid Spencer | c5b6705 | 2004-06-23 14:07:12 +0000 | [diff] [blame] | 318 | if (/^-templatefile$/) { $Template = $ARGV[0]; shift; next; } |
Misha Brukman | 2e9ac69 | 2004-11-08 03:28:27 +0000 | [diff] [blame] | 319 | if (/^-gccpath/) { |
| 320 | $CONFIGUREARGS .= " CC=$ARGV[0]/gcc CXX=$ARGV[0]/g++"; shift; next; |
| 321 | } |
Misha Brukman | f5f37f0 | 2005-05-26 16:28:55 +0000 | [diff] [blame] | 322 | if (/^-cvstag/) { $CVSCOOPT .= " -r $ARGV[0]"; shift; next; } |
Misha Brukman | 4391bb5 | 2005-06-06 19:17:05 +0000 | [diff] [blame] | 323 | if (/^-target/) { |
| 324 | $CONFIGUREARGS .= " --target=$ARGV[0]"; shift; next; |
| 325 | } |
Evan Cheng | 3468864 | 2006-02-08 09:08:06 +0000 | [diff] [blame] | 326 | if (/^-cflags/) { |
| 327 | $MAKEOPTS = "$MAKEOPTS C.Flags=\'$ARGV[0]\'"; shift; next; |
| 328 | } |
| 329 | if (/^-cxxflags/) { |
| 330 | $MAKEOPTS = "$MAKEOPTS CXX.Flags=\'$ARGV[0]\'"; shift; next; |
| 331 | } |
| 332 | if (/^-ldflags/) { |
| 333 | $MAKEOPTS = "$MAKEOPTS LD.Flags=\'$ARGV[0]\'"; shift; next; |
| 334 | } |
Chris Lattner | f6dc20f | 2006-06-12 19:03:17 +0000 | [diff] [blame] | 335 | if (/^-compileflags/) { |
| 336 | $MAKEOPTS = "$MAKEOPTS $ARGV[0]"; shift; next; |
| 337 | } |
| 338 | if (/^-extraflags/) { |
Evan Cheng | 14c299e | 2006-06-27 20:30:28 +0000 | [diff] [blame] | 339 | $CONFIGUREARGS .= " --with-extra-options=\'$ARGV[0]\'"; shift; next; |
Evan Cheng | 19fd7ef | 2006-06-07 05:28:07 +0000 | [diff] [blame] | 340 | } |
Reid Spencer | 1d91463 | 2004-06-23 07:45:46 +0000 | [diff] [blame] | 341 | if (/^-noexternals$/) { $NOEXTERNALS = 1; next; } |
Misha Brukman | 4391bb5 | 2005-06-06 19:17:05 +0000 | [diff] [blame] | 342 | if (/^-nodejagnu$/) { $NODEJAGNU = 1; next; } |
Reid Spencer | cb6a3aa | 2004-06-22 15:38:37 +0000 | [diff] [blame] | 343 | print "Unknown option: $_ : ignoring!\n"; |
| 344 | } |
| 345 | |
Reid Spencer | 932b69f | 2004-12-26 05:21:13 +0000 | [diff] [blame] | 346 | if ($ENV{'LLVMGCCDIR'}) { |
| 347 | $CONFIGUREARGS .= " --with-llvmgccdir=" . $ENV{'LLVMGCCDIR'}; |
| 348 | } |
Brian Gaeke | 047e606 | 2004-08-05 19:54:59 +0000 | [diff] [blame] | 349 | if ($CONFIGUREARGS !~ /--disable-jit/) { |
| 350 | $CONFIGUREARGS .= " --enable-jit"; |
| 351 | } |
Reid Spencer | cb6a3aa | 2004-06-22 15:38:37 +0000 | [diff] [blame] | 352 | |
| 353 | die "Must specify 0 or 3 options!" if (@ARGV != 0 and @ARGV != 3); |
| 354 | |
| 355 | if (@ARGV == 3) { |
| 356 | $CVSRootDir = $ARGV[0]; |
| 357 | $BuildDir = $ARGV[1]; |
| 358 | $WebDir = $ARGV[2]; |
| 359 | } |
| 360 | |
Reid Spencer | cb6a3aa | 2004-06-22 15:38:37 +0000 | [diff] [blame] | 361 | my $Prefix = "$WebDir/$DATE"; |
| 362 | |
| 363 | #define the file names we'll use |
| 364 | my $BuildLog = "$Prefix-Build-Log.txt"; |
| 365 | my $CVSLog = "$Prefix-CVS-Log.txt"; |
Reid Spencer | cb6a3aa | 2004-06-22 15:38:37 +0000 | [diff] [blame] | 366 | my $OldenTestsLog = "$Prefix-Olden-tests.txt"; |
| 367 | my $SingleSourceLog = "$Prefix-SingleSource-ProgramTest.txt.gz"; |
| 368 | my $MultiSourceLog = "$Prefix-MultiSource-ProgramTest.txt.gz"; |
| 369 | my $ExternalLog = "$Prefix-External-ProgramTest.txt.gz"; |
Tanya Lattner | 5debe8c | 2004-11-21 00:02:40 +0000 | [diff] [blame] | 370 | my $DejagnuLog = "$Prefix-Dejagnu-testrun.log"; |
| 371 | my $DejagnuSum = "$Prefix-Dejagnu-testrun.sum"; |
| 372 | my $DejagnuTestsLog = "$Prefix-DejagnuTests-Log.txt"; |
Reid Spencer | cb6a3aa | 2004-06-22 15:38:37 +0000 | [diff] [blame] | 373 | |
| 374 | if ($VERBOSE) { |
| 375 | print "INITIALIZED\n"; |
| 376 | print "CVS Root = $CVSRootDir\n"; |
| 377 | print "BuildDir = $BuildDir\n"; |
| 378 | print "WebDir = $WebDir\n"; |
| 379 | print "Prefix = $Prefix\n"; |
| 380 | print "CVSLog = $CVSLog\n"; |
| 381 | print "BuildLog = $BuildLog\n"; |
| 382 | } |
| 383 | |
Brian Gaeke | 90c82b9 | 2004-09-28 16:04:00 +0000 | [diff] [blame] | 384 | if (! -d $WebDir) { |
| 385 | mkdir $WebDir, 0777; |
| 386 | warn "Warning: $WebDir did not exist; creating it.\n"; |
| 387 | } |
Reid Spencer | cb6a3aa | 2004-06-22 15:38:37 +0000 | [diff] [blame] | 388 | |
| 389 | # |
| 390 | # Create the CVS repository directory |
| 391 | # |
| 392 | if (!$NOCHECKOUT) { |
| 393 | if (-d $BuildDir) { |
| 394 | if (!$NOREMOVE) { |
| 395 | system "rm -rf $BuildDir"; |
| 396 | } else { |
| 397 | die "CVS checkout directory $BuildDir already exists!"; |
| 398 | } |
| 399 | } |
| 400 | mkdir $BuildDir or die "Could not create CVS checkout directory $BuildDir!"; |
| 401 | } |
| 402 | |
| 403 | ChangeDir( $BuildDir, "CVS checkout directory" ); |
| 404 | |
| 405 | |
| 406 | # |
| 407 | # Check out the llvm tree, saving CVS messages to the cvs log... |
| 408 | # |
Misha Brukman | f5f37f0 | 2005-05-26 16:28:55 +0000 | [diff] [blame] | 409 | my $CVSOPT = ""; |
| 410 | # Use compression if going over ssh. |
| 411 | $CVSOPT = "-z3" if $CVSRootDir =~ /^:ext:/; |
| 412 | my $CVSCMD = "$NICE cvs $CVSOPT -d $CVSRootDir co $CVSCOOPT"; |
Reid Spencer | cb6a3aa | 2004-06-22 15:38:37 +0000 | [diff] [blame] | 413 | if (!$NOCHECKOUT) { |
| 414 | if ( $VERBOSE ) { print "CHECKOUT STAGE\n"; } |
Misha Brukman | f5f37f0 | 2005-05-26 16:28:55 +0000 | [diff] [blame] | 415 | system "( time -p $CVSCMD llvm; cd llvm/projects ; " . |
| 416 | "$CVSCMD llvm-test ) > $CVSLog 2>&1"; |
Reid Spencer | 10ffe01 | 2004-09-05 07:58:10 +0000 | [diff] [blame] | 417 | ChangeDir( $BuildDir , "CVS Checkout directory") ; |
Reid Spencer | cb6a3aa | 2004-06-22 15:38:37 +0000 | [diff] [blame] | 418 | } |
| 419 | |
| 420 | ChangeDir( "llvm" , "llvm source directory") ; |
| 421 | |
| 422 | if (!$NOCHECKOUT) { |
| 423 | if ( $VERBOSE ) { print "UPDATE STAGE\n"; } |
Reid Spencer | 10ffe01 | 2004-09-05 07:58:10 +0000 | [diff] [blame] | 424 | system "$NICE cvs update -PdRA >> $CVSLog 2>&1" ; |
Reid Spencer | cb6a3aa | 2004-06-22 15:38:37 +0000 | [diff] [blame] | 425 | } |
| 426 | |
Reid Spencer | c5b6705 | 2004-06-23 14:07:12 +0000 | [diff] [blame] | 427 | if ( $Template eq "" ) { |
| 428 | $Template = "$BuildDir/llvm/utils/NightlyTestTemplate.html"; |
| 429 | } |
| 430 | die "Template file $Template is not readable" if ( ! -r "$Template" ); |
| 431 | |
| 432 | if ( $PlotScriptFilename eq "" ) { |
| 433 | $PlotScriptFilename = "$BuildDir/llvm/utils/NightlyTest.gnuplot"; |
| 434 | } |
| 435 | die "GNUPlot Script $PlotScriptFilename is not readable" if ( ! -r "$PlotScriptFilename" ); |
| 436 | |
Reid Spencer | cb6a3aa | 2004-06-22 15:38:37 +0000 | [diff] [blame] | 437 | # Read in the HTML template file... |
| 438 | if ( $VERBOSE ) { print "READING TEMPLATE\n"; } |
| 439 | my $TemplateContents = ReadFile $Template; |
| 440 | |
| 441 | # |
| 442 | # Get some static statistics about the current state of CVS |
| 443 | # |
| 444 | my $CVSCheckoutTime = GetRegex "([0-9.]+)", `grep '^real' $CVSLog`; |
| 445 | my $NumFilesInCVS = `egrep '^U' $CVSLog | wc -l` + 0; |
| 446 | my $NumDirsInCVS = `egrep '^cvs (checkout|server|update):' $CVSLog | wc -l` + 0; |
Reid Spencer | e993f46 | 2004-09-06 19:32:55 +0000 | [diff] [blame] | 447 | $LOC = `utils/countloc.sh`; |
Reid Spencer | cb6a3aa | 2004-06-22 15:38:37 +0000 | [diff] [blame] | 448 | |
| 449 | # |
| 450 | # Build the entire tree, saving build messages to the build log |
| 451 | # |
| 452 | if (!$NOCHECKOUT) { |
| 453 | if ( $VERBOSE ) { print "CONFIGURE STAGE\n"; } |
Chris Lattner | f6dc20f | 2006-06-12 19:03:17 +0000 | [diff] [blame] | 454 | my $EXTRAFLAGS = "--enable-spec --with-objroot=."; |
Chris Lattner | e50caac | 2005-10-28 16:35:18 +0000 | [diff] [blame] | 455 | system "(time -p $NICE ./configure $CONFIGUREARGS $EXTRAFLAGS) > $BuildLog 2>&1"; |
Reid Spencer | cb6a3aa | 2004-06-22 15:38:37 +0000 | [diff] [blame] | 456 | |
| 457 | if ( $VERBOSE ) { print "BUILD STAGE\n"; } |
| 458 | # Build the entire tree, capturing the output into $BuildLog |
| 459 | system "(time -p $NICE gmake $MAKEOPTS) >> $BuildLog 2>&1"; |
| 460 | } |
| 461 | |
| 462 | |
| 463 | # |
| 464 | # Get some statistics about the build... |
| 465 | # |
| 466 | my @Linked = split '\n', `grep Linking $BuildLog`; |
| 467 | my $NumExecutables = scalar(grep(/executable/, @Linked)); |
| 468 | my $NumLibraries = scalar(grep(!/executable/, @Linked)); |
Chris Lattner | 0bb4828 | 2005-03-11 20:17:04 +0000 | [diff] [blame] | 469 | my $NumObjects = `grep ']\: Compiling ' $BuildLog | wc -l` + 0; |
Reid Spencer | cb6a3aa | 2004-06-22 15:38:37 +0000 | [diff] [blame] | 470 | |
| 471 | my $ConfigTimeU = GetRegexNum "^user", 0, "([0-9.]+)", "$BuildLog"; |
| 472 | my $ConfigTimeS = GetRegexNum "^sys", 0, "([0-9.]+)", "$BuildLog"; |
| 473 | my $ConfigTime = $ConfigTimeU+$ConfigTimeS; # ConfigTime = User+System |
| 474 | my $ConfigWallTime = GetRegexNum "^real", 0,"([0-9.]+)","$BuildLog"; |
| 475 | |
| 476 | my $BuildTimeU = GetRegexNum "^user", 1, "([0-9.]+)", "$BuildLog"; |
| 477 | my $BuildTimeS = GetRegexNum "^sys", 1, "([0-9.]+)", "$BuildLog"; |
| 478 | my $BuildTime = $BuildTimeU+$BuildTimeS; # BuildTime = User+System |
| 479 | my $BuildWallTime = GetRegexNum "^real", 1, "([0-9.]+)","$BuildLog"; |
| 480 | |
Misha Brukman | 9a61275 | 2005-01-12 03:31:38 +0000 | [diff] [blame] | 481 | my $BuildError = 0, $BuildStatus = "OK"; |
Reid Spencer | cb6a3aa | 2004-06-22 15:38:37 +0000 | [diff] [blame] | 482 | if (`grep '^gmake[^:]*: .*Error' $BuildLog | wc -l` + 0 || |
| 483 | `grep '^gmake: \*\*\*.*Stop.' $BuildLog | wc -l`+0) { |
Misha Brukman | 9a61275 | 2005-01-12 03:31:38 +0000 | [diff] [blame] | 484 | $BuildStatus = "<h3><font color='red'>error: compilation " . |
Reid Spencer | cb6a3aa | 2004-06-22 15:38:37 +0000 | [diff] [blame] | 485 | "<a href=\"$DATE-Build-Log.txt\">aborted</a></font></h3>"; |
Misha Brukman | 9a61275 | 2005-01-12 03:31:38 +0000 | [diff] [blame] | 486 | $BuildError = 1; |
Chris Lattner | 0831310 | 2005-12-11 19:55:39 +0000 | [diff] [blame] | 487 | print "\n***ERROR BUILDING TREE\n\n"; |
Reid Spencer | cb6a3aa | 2004-06-22 15:38:37 +0000 | [diff] [blame] | 488 | } |
| 489 | |
Tanya Lattner | 056ec06 | 2004-12-04 06:25:50 +0000 | [diff] [blame] | 490 | if ($BuildError) { $NODEJAGNU=1; } |
Brian Gaeke | 2280098 | 2004-06-25 07:25:28 +0000 | [diff] [blame] | 491 | |
Tanya Lattner | 5debe8c | 2004-11-21 00:02:40 +0000 | [diff] [blame] | 492 | my $DejangnuTestResults; # String containing the results of the dejagnu |
Tanya Lattner | 59a8655 | 2004-12-04 06:35:14 +0000 | [diff] [blame] | 493 | if(!$NODEJAGNU) { |
Tanya Lattner | 5debe8c | 2004-11-21 00:02:40 +0000 | [diff] [blame] | 494 | if($VERBOSE) { print "DEJAGNU FEATURE/REGRESSION TEST STAGE\n"; } |
| 495 | |
| 496 | my $dejagnu_output = "$DejagnuTestsLog"; |
| 497 | |
| 498 | #Run the feature and regression tests, results are put into testrun.sum |
| 499 | #Full log in testrun.log |
Tanya Lattner | 056ec06 | 2004-12-04 06:25:50 +0000 | [diff] [blame] | 500 | system "(time -p gmake $MAKEOPTS check) > $dejagnu_output 2>&1"; |
Tanya Lattner | 5debe8c | 2004-11-21 00:02:40 +0000 | [diff] [blame] | 501 | |
| 502 | #Extract time of dejagnu tests |
| 503 | my $DejagnuTimeU = GetRegexNum "^user", 0, "([0-9.]+)", "$dejagnu_output"; |
| 504 | my $DejagnuTimeS = GetRegexNum "^sys", 0, "([0-9.]+)", "$dejagnu_output"; |
| 505 | $DejagnuTime = $DejagnuTimeU+$DejagnuTimeS; # DejagnuTime = User+System |
| 506 | $DejagnuWallTime = GetRegexNum "^real", 0,"([0-9.]+)","$dejagnu_output"; |
| 507 | |
| 508 | #Copy the testrun.log and testrun.sum to our webdir |
| 509 | CopyFile("test/testrun.log", $DejagnuLog); |
| 510 | CopyFile("test/testrun.sum", $DejagnuSum); |
| 511 | |
| 512 | $DejagnuTestResults = GetDejagnuTestResults($DejagnuSum, $DejagnuLog); |
Tanya Lattner | a2dfbf9 | 2004-12-17 20:58:34 +0000 | [diff] [blame] | 513 | |
Tanya Lattner | 5debe8c | 2004-11-21 00:02:40 +0000 | [diff] [blame] | 514 | } else { |
| 515 | $DejagnuTestResults = "Skipped by user choice."; |
| 516 | $DejagnuTime = "0.0"; |
| 517 | $DejagnuWallTime = "0.0"; |
| 518 | } |
| 519 | |
Chris Lattner | 4d00fde | 2004-05-28 20:30:23 +0000 | [diff] [blame] | 520 | if ($DEBUG) { |
Tanya Lattner | 5debe8c | 2004-11-21 00:02:40 +0000 | [diff] [blame] | 521 | print $DejagnuTestResults; |
Chris Lattner | 4d00fde | 2004-05-28 20:30:23 +0000 | [diff] [blame] | 522 | } |
| 523 | |
| 524 | if ( $VERBOSE ) { print "BUILD INFORMATION COLLECTION STAGE\n"; } |
Chris Lattner | b344030 | 2003-01-22 16:14:05 +0000 | [diff] [blame] | 525 | # |
Chris Lattner | 4c7e303 | 2003-01-20 06:11:03 +0000 | [diff] [blame] | 526 | # Get warnings from the build |
Chris Lattner | b344030 | 2003-01-22 16:14:05 +0000 | [diff] [blame] | 527 | # |
Reid Spencer | cb6a3aa | 2004-06-22 15:38:37 +0000 | [diff] [blame] | 528 | my @Warn = split "\n", `egrep 'warning:|Entering dir' $BuildLog`; |
Chris Lattner | 4c7e303 | 2003-01-20 06:11:03 +0000 | [diff] [blame] | 529 | my @Warnings; |
| 530 | my $CurDir = ""; |
| 531 | |
| 532 | foreach $Warning (@Warn) { |
| 533 | if ($Warning =~ m/Entering directory \`([^\`]+)\'/) { |
| 534 | $CurDir = $1; # Keep track of directory warning is in... |
Misha Brukman | 8e9554a | 2003-08-14 15:26:28 +0000 | [diff] [blame] | 535 | if ($CurDir =~ m#$BuildDir/llvm/(.*)#) { # Remove buildir prefix if included |
Chris Lattner | 4c7e303 | 2003-01-20 06:11:03 +0000 | [diff] [blame] | 536 | $CurDir = $1; |
| 537 | } |
| 538 | } else { |
| 539 | push @Warnings, "$CurDir/$Warning"; # Add directory to warning... |
| 540 | } |
| 541 | } |
Chris Lattner | 1cbc0a6 | 2003-01-20 19:18:44 +0000 | [diff] [blame] | 542 | my $WarningsFile = join "\n", @Warnings; |
Reid Spencer | 7d6a515 | 2006-03-21 01:21:39 +0000 | [diff] [blame] | 543 | my $WarningsList = ArrayToList @Warnings; |
Chris Lattner | 1cbc0a6 | 2003-01-20 19:18:44 +0000 | [diff] [blame] | 544 | $WarningsFile =~ s/:[0-9]+:/::/g; |
Chris Lattner | 4c7e303 | 2003-01-20 06:11:03 +0000 | [diff] [blame] | 545 | |
Chris Lattner | 2f8cb57 | 2003-01-20 18:05:27 +0000 | [diff] [blame] | 546 | # Emit the warnings file, so we can diff... |
| 547 | WriteFile "$WebDir/$DATE-Warnings.txt", $WarningsFile . "\n"; |
| 548 | my ($WarningsAdded, $WarningsRemoved) = DiffFiles "-Warnings.txt"; |
Chris Lattner | 4c7e303 | 2003-01-20 06:11:03 +0000 | [diff] [blame] | 549 | |
Chris Lattner | 9efd7f4 | 2003-10-18 19:31:39 +0000 | [diff] [blame] | 550 | # Output something to stdout if something has changed |
| 551 | print "ADDED WARNINGS:\n$WarningsAdded\n\n" if (length $WarningsAdded); |
| 552 | print "REMOVED WARNINGS:\n$WarningsRemoved\n\n" if (length $WarningsRemoved); |
| 553 | |
Reid Spencer | 7d6a515 | 2006-03-21 01:21:39 +0000 | [diff] [blame] | 554 | my @TmpWarningsAdded = split "\n", $WarningsAdded; |
| 555 | my @TmpWarningsRemoved = split "\n", $WarningsRemoved; |
| 556 | $WarningsAdded = ArrayToList @TmpWarningsAdded; |
| 557 | $WarningsRemoved = ArrayToList @TmpWarningsRemoved; |
Chris Lattner | b344030 | 2003-01-22 16:14:05 +0000 | [diff] [blame] | 558 | |
| 559 | # |
Chris Lattner | 4c7e303 | 2003-01-20 06:11:03 +0000 | [diff] [blame] | 560 | # Get some statistics about CVS commits over the current day... |
Chris Lattner | b344030 | 2003-01-22 16:14:05 +0000 | [diff] [blame] | 561 | # |
Chris Lattner | 4d00fde | 2004-05-28 20:30:23 +0000 | [diff] [blame] | 562 | if ($VERBOSE) { print "CVS HISTORY ANALYSIS STAGE\n"; } |
Chris Lattner | 4c7e303 | 2003-01-20 06:11:03 +0000 | [diff] [blame] | 563 | @CVSHistory = split "\n", `cvs history -D '1 day ago' -a -xAMROCGUW`; |
| 564 | #print join "\n", @CVSHistory; print "\n"; |
| 565 | |
| 566 | # Extract some information from the CVS history... use a hash so no duplicate |
| 567 | # stuff is stored. |
Misha Brukman | 1b36689 | 2003-07-07 21:27:40 +0000 | [diff] [blame] | 568 | my (%AddedFiles, %ModifiedFiles, %RemovedFiles, %UsersCommitted, %UsersUpdated); |
Chris Lattner | 4c7e303 | 2003-01-20 06:11:03 +0000 | [diff] [blame] | 569 | |
Brian Gaeke | 43f3867 | 2004-06-10 07:44:28 +0000 | [diff] [blame] | 570 | my $DateRE = '[-/:0-9 ]+\+[0-9]+'; |
Chris Lattner | d9bdbaa | 2003-01-22 20:35:59 +0000 | [diff] [blame] | 571 | |
Chris Lattner | 4c7e303 | 2003-01-20 06:11:03 +0000 | [diff] [blame] | 572 | # Loop over every record from the CVS history, filling in the hashes. |
| 573 | foreach $File (@CVSHistory) { |
| 574 | my ($Type, $Date, $UID, $Rev, $Filename); |
Misha Brukman | 8e9554a | 2003-08-14 15:26:28 +0000 | [diff] [blame] | 575 | if ($File =~ /([AMRUGC]) ($DateRE) ([^ ]+) +([^ ]+) +([^ ]+) +([^ ]+)/) { |
Chris Lattner | 4c7e303 | 2003-01-20 06:11:03 +0000 | [diff] [blame] | 576 | ($Type, $Date, $UID, $Rev, $Filename) = ($1, $2, $3, $4, "$6/$5"); |
Chris Lattner | d56147d | 2004-01-12 16:55:30 +0000 | [diff] [blame] | 577 | } elsif ($File =~ /([W]) ($DateRE) ([^ ]+)/) { |
| 578 | ($Type, $Date, $UID, $Rev, $Filename) = ($1, $2, $3, "", ""); |
Misha Brukman | 1b36689 | 2003-07-07 21:27:40 +0000 | [diff] [blame] | 579 | } elsif ($File =~ /([O]) ($DateRE) ([^ ]+) +([^ ]+)/) { |
Chris Lattner | d9bdbaa | 2003-01-22 20:35:59 +0000 | [diff] [blame] | 580 | ($Type, $Date, $UID, $Rev, $Filename) = ($1, $2, $3, "", "$4/"); |
Chris Lattner | 4c7e303 | 2003-01-20 06:11:03 +0000 | [diff] [blame] | 581 | } else { |
Chris Lattner | d9bdbaa | 2003-01-22 20:35:59 +0000 | [diff] [blame] | 582 | print "UNMATCHABLE: $File\n"; |
Brian Gaeke | 43f3867 | 2004-06-10 07:44:28 +0000 | [diff] [blame] | 583 | next; |
Chris Lattner | d9bdbaa | 2003-01-22 20:35:59 +0000 | [diff] [blame] | 584 | } |
| 585 | # print "$File\nTy = $Type Date = '$Date' UID=$UID Rev=$Rev File = '$Filename'\n"; |
| 586 | |
| 587 | if ($Filename =~ /^llvm/) { |
| 588 | if ($Type eq 'M') { # Modified |
| 589 | $ModifiedFiles{$Filename} = 1; |
| 590 | $UsersCommitted{$UID} = 1; |
| 591 | } elsif ($Type eq 'A') { # Added |
| 592 | $AddedFiles{$Filename} = 1; |
| 593 | $UsersCommitted{$UID} = 1; |
| 594 | } elsif ($Type eq 'R') { # Removed |
| 595 | $RemovedFiles{$Filename} = 1; |
| 596 | $UsersCommitted{$UID} = 1; |
| 597 | } else { |
| 598 | $UsersUpdated{$UID} = 1; |
| 599 | } |
Chris Lattner | 4c7e303 | 2003-01-20 06:11:03 +0000 | [diff] [blame] | 600 | } |
| 601 | } |
| 602 | |
Chris Lattner | 5e5d220 | 2005-03-16 17:09:53 +0000 | [diff] [blame] | 603 | my $UserCommitList = join "\n", sort keys %UsersCommitted; |
| 604 | my $UserUpdateList = join "\n", sort keys %UsersUpdated; |
Chris Lattner | c9cdadf | 2003-08-06 16:02:50 +0000 | [diff] [blame] | 605 | my $AddedFilesList = AddPreTag join "\n", sort keys %AddedFiles; |
| 606 | my $ModifiedFilesList = AddPreTag join "\n", sort keys %ModifiedFiles; |
| 607 | my $RemovedFilesList = AddPreTag join "\n", sort keys %RemovedFiles; |
Chris Lattner | 4c7e303 | 2003-01-20 06:11:03 +0000 | [diff] [blame] | 608 | |
Chris Lattner | ec0e374 | 2003-02-28 20:30:20 +0000 | [diff] [blame] | 609 | my $TestError = 1; |
Reid Spencer | cb6a3aa | 2004-06-22 15:38:37 +0000 | [diff] [blame] | 610 | my $SingleSourceProgramsTable = "!"; |
| 611 | my $MultiSourceProgramsTable = "!"; |
| 612 | my $ExternalProgramsTable = "!"; |
Chris Lattner | b344030 | 2003-01-22 16:14:05 +0000 | [diff] [blame] | 613 | |
Chris Lattner | bf6a4dc | 2003-08-18 06:05:21 +0000 | [diff] [blame] | 614 | |
| 615 | sub TestDirectory { |
| 616 | my $SubDir = shift; |
| 617 | |
Reid Spencer | 10ffe01 | 2004-09-05 07:58:10 +0000 | [diff] [blame] | 618 | ChangeDir( "projects/llvm-test/$SubDir", "Programs Test Subdirectory" ); |
Reid Spencer | cb6a3aa | 2004-06-22 15:38:37 +0000 | [diff] [blame] | 619 | |
| 620 | my $ProgramTestLog = "$Prefix-$SubDir-ProgramTest.txt"; |
Chris Lattner | ec0e374 | 2003-02-28 20:30:20 +0000 | [diff] [blame] | 621 | |
| 622 | # Run the programs tests... creating a report.nightly.html file |
| 623 | if (!$NOTEST) { |
Chris Lattner | 20d13ea | 2004-06-03 03:29:39 +0000 | [diff] [blame] | 624 | system "gmake -k $MAKEOPTS $PROGTESTOPTS report.nightly.html " |
Reid Spencer | cb6a3aa | 2004-06-22 15:38:37 +0000 | [diff] [blame] | 625 | . "TEST=nightly > $ProgramTestLog 2>&1"; |
Chris Lattner | ec0e374 | 2003-02-28 20:30:20 +0000 | [diff] [blame] | 626 | } else { |
Reid Spencer | cb6a3aa | 2004-06-22 15:38:37 +0000 | [diff] [blame] | 627 | system "gunzip ${ProgramTestLog}.gz"; |
Chris Lattner | ec0e374 | 2003-02-28 20:30:20 +0000 | [diff] [blame] | 628 | } |
| 629 | |
Chris Lattner | bf6a4dc | 2003-08-18 06:05:21 +0000 | [diff] [blame] | 630 | my $ProgramsTable; |
Reid Spencer | cb6a3aa | 2004-06-22 15:38:37 +0000 | [diff] [blame] | 631 | if (`grep '^gmake[^:]: .*Error' $ProgramTestLog | wc -l` + 0){ |
Chris Lattner | ec0e374 | 2003-02-28 20:30:20 +0000 | [diff] [blame] | 632 | $TestError = 1; |
Chris Lattner | 2e8be14 | 2003-05-10 21:40:10 +0000 | [diff] [blame] | 633 | $ProgramsTable = "<font color=white><h2>Error running tests!</h2></font>"; |
Chris Lattner | be19787 | 2003-10-19 16:54:00 +0000 | [diff] [blame] | 634 | print "ERROR TESTING\n"; |
Reid Spencer | cb6a3aa | 2004-06-22 15:38:37 +0000 | [diff] [blame] | 635 | } elsif (`grep '^gmake[^:]: .*No rule to make target' $ProgramTestLog | wc -l` + 0) { |
Chris Lattner | 6e51bfa | 2003-05-11 15:23:10 +0000 | [diff] [blame] | 636 | $TestError = 1; |
| 637 | $ProgramsTable = |
| 638 | "<font color=white><h2>Makefile error running tests!</h2></font>"; |
Chris Lattner | be19787 | 2003-10-19 16:54:00 +0000 | [diff] [blame] | 639 | print "ERROR TESTING\n"; |
Chris Lattner | 6e51bfa | 2003-05-11 15:23:10 +0000 | [diff] [blame] | 640 | } else { |
Chris Lattner | ec0e374 | 2003-02-28 20:30:20 +0000 | [diff] [blame] | 641 | $TestError = 0; |
| 642 | $ProgramsTable = ReadFile "report.nightly.html"; |
| 643 | |
| 644 | # |
| 645 | # Create a list of the tests which were run... |
| 646 | # |
Reid Spencer | cb6a3aa | 2004-06-22 15:38:37 +0000 | [diff] [blame] | 647 | system "egrep 'TEST-(PASS|FAIL)' < $ProgramTestLog " |
Chris Lattner | bf6a4dc | 2003-08-18 06:05:21 +0000 | [diff] [blame] | 648 | . "| sort > $Prefix-$SubDir-Tests.txt"; |
Chris Lattner | ec0e374 | 2003-02-28 20:30:20 +0000 | [diff] [blame] | 649 | } |
| 650 | |
| 651 | # Compress the test output |
Reid Spencer | cb6a3aa | 2004-06-22 15:38:37 +0000 | [diff] [blame] | 652 | system "gzip -f $ProgramTestLog"; |
| 653 | ChangeDir( "../../..", "Programs Test Parent Directory" ); |
Chris Lattner | bf6a4dc | 2003-08-18 06:05:21 +0000 | [diff] [blame] | 654 | return $ProgramsTable; |
| 655 | } |
| 656 | |
Reid Spencer | cb6a3aa | 2004-06-22 15:38:37 +0000 | [diff] [blame] | 657 | # If we built the tree successfully, run the nightly programs tests... |
Misha Brukman | 9a61275 | 2005-01-12 03:31:38 +0000 | [diff] [blame] | 658 | if (!$BuildError) { |
Chris Lattner | 4d00fde | 2004-05-28 20:30:23 +0000 | [diff] [blame] | 659 | if ( $VERBOSE ) { |
| 660 | print "SingleSource TEST STAGE\n"; |
| 661 | } |
Chris Lattner | bf6a4dc | 2003-08-18 06:05:21 +0000 | [diff] [blame] | 662 | $SingleSourceProgramsTable = TestDirectory("SingleSource"); |
Chris Lattner | 4d00fde | 2004-05-28 20:30:23 +0000 | [diff] [blame] | 663 | if ( $VERBOSE ) { |
| 664 | print "MultiSource TEST STAGE\n"; |
| 665 | } |
Chris Lattner | bf6a4dc | 2003-08-18 06:05:21 +0000 | [diff] [blame] | 666 | $MultiSourceProgramsTable = TestDirectory("MultiSource"); |
Reid Spencer | 1d91463 | 2004-06-23 07:45:46 +0000 | [diff] [blame] | 667 | if ( ! $NOEXTERNALS ) { |
| 668 | if ( $VERBOSE ) { |
| 669 | print "External TEST STAGE\n"; |
| 670 | } |
| 671 | $ExternalProgramsTable = TestDirectory("External"); |
| 672 | system "cat $Prefix-SingleSource-Tests.txt $Prefix-MultiSource-Tests.txt ". |
Chris Lattner | eac3cdc | 2003-08-21 15:55:26 +0000 | [diff] [blame] | 673 | " $Prefix-External-Tests.txt | sort > $Prefix-Tests.txt"; |
Reid Spencer | 1d91463 | 2004-06-23 07:45:46 +0000 | [diff] [blame] | 674 | } else { |
Reid Spencer | b8e825b | 2004-12-04 22:18:28 +0000 | [diff] [blame] | 675 | $ExternalProgramsTable = '<tr><td>External TEST STAGE SKIPPED</td></tr>'; |
Reid Spencer | 1d91463 | 2004-06-23 07:45:46 +0000 | [diff] [blame] | 676 | if ( $VERBOSE ) { |
| 677 | print "External TEST STAGE SKIPPED\n"; |
| 678 | } |
| 679 | system "cat $Prefix-SingleSource-Tests.txt $Prefix-MultiSource-Tests.txt ". |
| 680 | " | sort > $Prefix-Tests.txt"; |
| 681 | } |
Chris Lattner | 5d6c438 | 2003-01-23 19:31:28 +0000 | [diff] [blame] | 682 | } |
Chris Lattner | b344030 | 2003-01-22 16:14:05 +0000 | [diff] [blame] | 683 | |
Reid Spencer | cb6a3aa | 2004-06-22 15:38:37 +0000 | [diff] [blame] | 684 | if ( $VERBOSE ) { print "TEST INFORMATION COLLECTION STAGE\n"; } |
Chris Lattner | d9bdbaa | 2003-01-22 20:35:59 +0000 | [diff] [blame] | 685 | my ($TestsAdded, $TestsRemoved, $TestsFixed, $TestsBroken) = ("","","",""); |
| 686 | |
Chris Lattner | ec0e374 | 2003-02-28 20:30:20 +0000 | [diff] [blame] | 687 | if ($TestError) { |
| 688 | $TestsAdded = "<b>error testing</b><br>"; |
| 689 | $TestsRemoved = "<b>error testing</b><br>"; |
| 690 | $TestsFixed = "<b>error testing</b><br>"; |
| 691 | $TestsBroken = "<b>error testing</b><br>"; |
| 692 | } else { |
| 693 | my ($RTestsAdded, $RTestsRemoved) = DiffFiles "-Tests.txt"; |
| 694 | |
| 695 | my @RawTestsAddedArray = split '\n', $RTestsAdded; |
| 696 | my @RawTestsRemovedArray = split '\n', $RTestsRemoved; |
| 697 | |
| 698 | my %OldTests = map {GetRegex('TEST-....: (.+)', $_)=>$_} |
| 699 | @RawTestsRemovedArray; |
| 700 | my %NewTests = map {GetRegex('TEST-....: (.+)', $_)=>$_} |
| 701 | @RawTestsAddedArray; |
| 702 | |
| 703 | foreach $Test (keys %NewTests) { |
| 704 | if (!exists $OldTests{$Test}) { # TestAdded if in New but not old |
| 705 | $TestsAdded = "$TestsAdded$Test\n"; |
Chris Lattner | d9bdbaa | 2003-01-22 20:35:59 +0000 | [diff] [blame] | 706 | } else { |
Chris Lattner | ec0e374 | 2003-02-28 20:30:20 +0000 | [diff] [blame] | 707 | if ($OldTests{$Test} =~ /TEST-PASS/) { # Was the old one a pass? |
| 708 | $TestsBroken = "$TestsBroken$Test\n"; # New one must be a failure |
| 709 | } else { |
| 710 | $TestsFixed = "$TestsFixed$Test\n"; # No, new one is a pass. |
| 711 | } |
Chris Lattner | d9bdbaa | 2003-01-22 20:35:59 +0000 | [diff] [blame] | 712 | } |
| 713 | } |
Chris Lattner | ec0e374 | 2003-02-28 20:30:20 +0000 | [diff] [blame] | 714 | foreach $Test (keys %OldTests) { # TestRemoved if in Old but not New |
| 715 | $TestsRemoved = "$TestsRemoved$Test\n" if (!exists $NewTests{$Test}); |
| 716 | } |
Chris Lattner | d9bdbaa | 2003-01-22 20:35:59 +0000 | [diff] [blame] | 717 | |
Chris Lattner | 91480ff | 2003-10-21 15:47:31 +0000 | [diff] [blame] | 718 | print "\nTESTS ADDED: \n\n$TestsAdded\n\n" if (length $TestsAdded); |
| 719 | print "\nTESTS REMOVED:\n\n$TestsRemoved\n\n" if (length $TestsRemoved); |
| 720 | print "\nTESTS FIXED: \n\n$TestsFixed\n\n" if (length $TestsFixed); |
| 721 | print "\nTESTS BROKEN: \n\n$TestsBroken\n\n" if (length $TestsBroken); |
Chris Lattner | be19787 | 2003-10-19 16:54:00 +0000 | [diff] [blame] | 722 | |
Chris Lattner | ec0e374 | 2003-02-28 20:30:20 +0000 | [diff] [blame] | 723 | $TestsAdded = AddPreTag $TestsAdded; |
| 724 | $TestsRemoved = AddPreTag $TestsRemoved; |
| 725 | $TestsFixed = AddPreTag $TestsFixed; |
| 726 | $TestsBroken = AddPreTag $TestsBroken; |
| 727 | } |
Chris Lattner | d9bdbaa | 2003-01-22 20:35:59 +0000 | [diff] [blame] | 728 | |
Chris Lattner | 9efd7f4 | 2003-10-18 19:31:39 +0000 | [diff] [blame] | 729 | |
Chris Lattner | 196a14a | 2003-08-19 15:08:34 +0000 | [diff] [blame] | 730 | # If we built the tree successfully, runs of the Olden suite with |
| 731 | # LARGE_PROBLEM_SIZE on so that we can get some "running" statistics. |
Misha Brukman | 9a61275 | 2005-01-12 03:31:38 +0000 | [diff] [blame] | 732 | if (!$BuildError) { |
Reid Spencer | cb6a3aa | 2004-06-22 15:38:37 +0000 | [diff] [blame] | 733 | if ( $VERBOSE ) { print "OLDEN TEST SUITE STAGE\n"; } |
Chris Lattner | 08e2476 | 2003-08-19 18:35:03 +0000 | [diff] [blame] | 734 | my ($NATTime, $CBETime, $LLCTime, $JITTime, $OptTime, $BytecodeSize, |
Chris Lattner | 196a14a | 2003-08-19 15:08:34 +0000 | [diff] [blame] | 735 | $MachCodeSize) = ("","","","","","",""); |
Chris Lattner | 08e2476 | 2003-08-19 18:35:03 +0000 | [diff] [blame] | 736 | if (!$NORUNNINGTESTS) { |
Reid Spencer | 10ffe01 | 2004-09-05 07:58:10 +0000 | [diff] [blame] | 737 | ChangeDir( "$BuildDir/llvm/projects/llvm-test/MultiSource/Benchmarks/Olden", |
Reid Spencer | cb6a3aa | 2004-06-22 15:38:37 +0000 | [diff] [blame] | 738 | "Olden Test Directory"); |
Chris Lattner | 196a14a | 2003-08-19 15:08:34 +0000 | [diff] [blame] | 739 | |
| 740 | # Clean out previous results... |
Reid Spencer | cb6a3aa | 2004-06-22 15:38:37 +0000 | [diff] [blame] | 741 | system "$NICE gmake $MAKEOPTS clean > /dev/null 2>&1"; |
Chris Lattner | 196a14a | 2003-08-19 15:08:34 +0000 | [diff] [blame] | 742 | |
Chris Lattner | 36dc5c7 | 2004-11-06 21:35:40 +0000 | [diff] [blame] | 743 | # Run the nightly test in this directory, with LARGE_PROBLEM_SIZE and |
| 744 | # GET_STABLE_NUMBERS enabled! |
Brian Gaeke | 8566854 | 2004-06-04 00:07:12 +0000 | [diff] [blame] | 745 | system "gmake -k $MAKEOPTS $PROGTESTOPTS report.nightly.raw.out TEST=nightly " . |
Chris Lattner | 36dc5c7 | 2004-11-06 21:35:40 +0000 | [diff] [blame] | 746 | " LARGE_PROBLEM_SIZE=1 GET_STABLE_NUMBERS=1 > /dev/null 2>&1"; |
Reid Spencer | cb6a3aa | 2004-06-22 15:38:37 +0000 | [diff] [blame] | 747 | system "cp report.nightly.raw.out $OldenTestsLog"; |
Chris Lattner | 196a14a | 2003-08-19 15:08:34 +0000 | [diff] [blame] | 748 | } else { |
Reid Spencer | cb6a3aa | 2004-06-22 15:38:37 +0000 | [diff] [blame] | 749 | system "gunzip ${OldenTestsLog}.gz"; |
Chris Lattner | 196a14a | 2003-08-19 15:08:34 +0000 | [diff] [blame] | 750 | } |
| 751 | |
Reid Spencer | cb6a3aa | 2004-06-22 15:38:37 +0000 | [diff] [blame] | 752 | # Now we know we have $OldenTestsLog as the raw output file. Split |
Chris Lattner | 196a14a | 2003-08-19 15:08:34 +0000 | [diff] [blame] | 753 | # it up into records and read the useful information. |
Reid Spencer | cb6a3aa | 2004-06-22 15:38:37 +0000 | [diff] [blame] | 754 | my @Records = split />>> ========= /, ReadFile "$OldenTestsLog"; |
Chris Lattner | 196a14a | 2003-08-19 15:08:34 +0000 | [diff] [blame] | 755 | shift @Records; # Delete the first (garbage) record |
| 756 | |
| 757 | # Loop over all of the records, summarizing them into rows for the running |
| 758 | # totals file. |
Chris Lattner | fed8a14 | 2004-12-14 22:42:59 +0000 | [diff] [blame] | 759 | my $WallTimeRE = "Time: ([0-9.]+) seconds \\([0-9.]+ wall clock"; |
Chris Lattner | 196a14a | 2003-08-19 15:08:34 +0000 | [diff] [blame] | 760 | foreach $Rec (@Records) { |
Chris Lattner | 36dc5c7 | 2004-11-06 21:35:40 +0000 | [diff] [blame] | 761 | my $rNATTime = GetRegex 'TEST-RESULT-nat-time: program\s*([.0-9m]+)', $Rec; |
| 762 | my $rCBETime = GetRegex 'TEST-RESULT-cbe-time: program\s*([.0-9m]+)', $Rec; |
| 763 | my $rLLCTime = GetRegex 'TEST-RESULT-llc-time: program\s*([.0-9m]+)', $Rec; |
| 764 | my $rJITTime = GetRegex 'TEST-RESULT-jit-time: program\s*([.0-9m]+)', $Rec; |
Chris Lattner | fed8a14 | 2004-12-14 22:42:59 +0000 | [diff] [blame] | 765 | my $rOptTime = GetRegex "TEST-RESULT-compile: .*$WallTimeRE", $Rec; |
Chris Lattner | 196a14a | 2003-08-19 15:08:34 +0000 | [diff] [blame] | 766 | my $rBytecodeSize = GetRegex 'TEST-RESULT-compile: *([0-9]+)', $Rec; |
Chris Lattner | 196a14a | 2003-08-19 15:08:34 +0000 | [diff] [blame] | 767 | |
| 768 | $NATTime .= " " . FormatTime($rNATTime); |
| 769 | $CBETime .= " " . FormatTime($rCBETime); |
| 770 | $LLCTime .= " " . FormatTime($rLLCTime); |
| 771 | $JITTime .= " " . FormatTime($rJITTime); |
| 772 | $OptTime .= " $rOptTime"; |
Chris Lattner | 08e2476 | 2003-08-19 18:35:03 +0000 | [diff] [blame] | 773 | $BytecodeSize .= " $rBytecodeSize"; |
Chris Lattner | 196a14a | 2003-08-19 15:08:34 +0000 | [diff] [blame] | 774 | } |
| 775 | |
| 776 | # Now that we have all of the numbers we want, add them to the running totals |
| 777 | # files. |
Chris Lattner | 08e2476 | 2003-08-19 18:35:03 +0000 | [diff] [blame] | 778 | AddRecord($NATTime, "running_Olden_nat_time.txt"); |
Chris Lattner | 196a14a | 2003-08-19 15:08:34 +0000 | [diff] [blame] | 779 | AddRecord($CBETime, "running_Olden_cbe_time.txt"); |
| 780 | AddRecord($LLCTime, "running_Olden_llc_time.txt"); |
| 781 | AddRecord($JITTime, "running_Olden_jit_time.txt"); |
| 782 | AddRecord($OptTime, "running_Olden_opt_time.txt"); |
| 783 | AddRecord($BytecodeSize, "running_Olden_bytecode.txt"); |
Chris Lattner | 08e2476 | 2003-08-19 18:35:03 +0000 | [diff] [blame] | 784 | |
Reid Spencer | cb6a3aa | 2004-06-22 15:38:37 +0000 | [diff] [blame] | 785 | system "gzip -f $OldenTestsLog"; |
Chris Lattner | 196a14a | 2003-08-19 15:08:34 +0000 | [diff] [blame] | 786 | } |
| 787 | |
| 788 | |
Chris Lattner | d9bdbaa | 2003-01-22 20:35:59 +0000 | [diff] [blame] | 789 | # |
Chris Lattner | 4c7e303 | 2003-01-20 06:11:03 +0000 | [diff] [blame] | 790 | # Get a list of the previous days that we can link to... |
Chris Lattner | b344030 | 2003-01-22 16:14:05 +0000 | [diff] [blame] | 791 | # |
Chris Lattner | 2f8cb57 | 2003-01-20 18:05:27 +0000 | [diff] [blame] | 792 | my @PrevDays = map {s/.html//; $_} GetDir ".html"; |
Chris Lattner | 4c7e303 | 2003-01-20 06:11:03 +0000 | [diff] [blame] | 793 | |
Brian Gaeke | 253231e | 2004-06-11 19:55:30 +0000 | [diff] [blame] | 794 | if ((scalar @PrevDays) > 20) { |
| 795 | splice @PrevDays, 20; # Trim down list to something reasonable... |
| 796 | } |
Chris Lattner | 4c7e303 | 2003-01-20 06:11:03 +0000 | [diff] [blame] | 797 | |
Reid Spencer | cb6a3aa | 2004-06-22 15:38:37 +0000 | [diff] [blame] | 798 | # Format list for sidebar |
| 799 | my $PrevDaysList = join "\n ", map { "<a href=\"$_.html\">$_</a><br>" } @PrevDays; |
Chris Lattner | 4c7e303 | 2003-01-20 06:11:03 +0000 | [diff] [blame] | 800 | |
Chris Lattner | c75b14e | 2003-08-18 20:07:54 +0000 | [diff] [blame] | 801 | # |
Brian Gaeke | 90c82b9 | 2004-09-28 16:04:00 +0000 | [diff] [blame] | 802 | # Start outputting files into the web directory |
Chris Lattner | c75b14e | 2003-08-18 20:07:54 +0000 | [diff] [blame] | 803 | # |
Reid Spencer | cb6a3aa | 2004-06-22 15:38:37 +0000 | [diff] [blame] | 804 | ChangeDir( $WebDir, "Web Directory" ); |
Chris Lattner | c75b14e | 2003-08-18 20:07:54 +0000 | [diff] [blame] | 805 | |
Brian Gaeke | 90c82b9 | 2004-09-28 16:04:00 +0000 | [diff] [blame] | 806 | # Make sure we don't get errors running the nightly tester the first time |
| 807 | # because of files that don't exist. |
| 808 | Touch ('running_build_time.txt', 'running_Olden_llc_time.txt', |
Chris Lattner | e50caac | 2005-10-28 16:35:18 +0000 | [diff] [blame] | 809 | 'running_loc.txt', |
Brian Gaeke | 90c82b9 | 2004-09-28 16:04:00 +0000 | [diff] [blame] | 810 | 'running_Olden_bytecode.txt', 'running_Olden_nat_time.txt', |
| 811 | 'running_Olden_cbe_time.txt', 'running_Olden_opt_time.txt', |
| 812 | 'running_Olden_jit_time.txt'); |
| 813 | |
Chris Lattner | c75b14e | 2003-08-18 20:07:54 +0000 | [diff] [blame] | 814 | # Add information to the files which accumulate information for graphs... |
| 815 | AddRecord($LOC, "running_loc.txt"); |
| 816 | AddRecord($BuildTime, "running_build_time.txt"); |
| 817 | |
Chris Lattner | 4d00fde | 2004-05-28 20:30:23 +0000 | [diff] [blame] | 818 | if ( $VERBOSE ) { |
| 819 | print "GRAPH GENERATION STAGE\n"; |
| 820 | } |
Chris Lattner | c75b14e | 2003-08-18 20:07:54 +0000 | [diff] [blame] | 821 | # |
| 822 | # Rebuild the graphs now... |
| 823 | # |
Chris Lattner | fe2597a | 2004-07-27 18:41:49 +0000 | [diff] [blame] | 824 | $GNUPLOT = "/usr/bin/gnuplot"; |
Brian Gaeke | b3dab90 | 2003-10-11 05:34:00 +0000 | [diff] [blame] | 825 | $GNUPLOT = "gnuplot" if ! -x $GNUPLOT; |
Reid Spencer | cb6a3aa | 2004-06-22 15:38:37 +0000 | [diff] [blame] | 826 | system ("$GNUPLOT", $PlotScriptFilename); |
Chris Lattner | b344030 | 2003-01-22 16:14:05 +0000 | [diff] [blame] | 827 | |
Chris Lattner | 4c7e303 | 2003-01-20 06:11:03 +0000 | [diff] [blame] | 828 | # |
| 829 | # Remove the cvs tree... |
| 830 | # |
Reid Spencer | cb6a3aa | 2004-06-22 15:38:37 +0000 | [diff] [blame] | 831 | system ( "$NICE rm -rf $BuildDir") if (!$NOCHECKOUT and !$NOREMOVE); |
Chris Lattner | 4c7e303 | 2003-01-20 06:11:03 +0000 | [diff] [blame] | 832 | |
Chris Lattner | 5e5d220 | 2005-03-16 17:09:53 +0000 | [diff] [blame] | 833 | print "\nUSERS WHO COMMITTED:\n " . (join "\n ", sort keys %UsersCommitted) . "\n" |
| 834 | if (scalar %UsersCommitted); |
| 835 | |
| 836 | print "\nADDED FILES:\n " . (join "\n ", sort keys %AddedFiles) . "\n" |
| 837 | if (scalar %AddedFiles); |
| 838 | |
| 839 | print "\nCHANGED FILES:\n " . (join "\n ", sort keys %ModifiedFiles) . "\n" |
| 840 | if (scalar %ModifiedFiles); |
| 841 | |
| 842 | print "\nREMOVED FILES:\n " . (join "\n ", sort keys %RemovedFiles) . "\n" |
| 843 | if (scalar %RemovedFiles); |
| 844 | |
Chris Lattner | b344030 | 2003-01-22 16:14:05 +0000 | [diff] [blame] | 845 | # |
Chris Lattner | 4c7e303 | 2003-01-20 06:11:03 +0000 | [diff] [blame] | 846 | # Print out information... |
Chris Lattner | b344030 | 2003-01-22 16:14:05 +0000 | [diff] [blame] | 847 | # |
Chris Lattner | 4d00fde | 2004-05-28 20:30:23 +0000 | [diff] [blame] | 848 | if ($VERBOSE) { |
Chris Lattner | 4c7e303 | 2003-01-20 06:11:03 +0000 | [diff] [blame] | 849 | print "DateString: $DateString\n"; |
| 850 | print "CVS Checkout: $CVSCheckoutTime seconds\n"; |
| 851 | print "Files/Dirs/LOC in CVS: $NumFilesInCVS/$NumDirsInCVS/$LOC\n"; |
Chris Lattner | 4c7e303 | 2003-01-20 06:11:03 +0000 | [diff] [blame] | 852 | print "Build Time: $BuildTime seconds\n"; |
| 853 | print "Libraries/Executables/Objects built: $NumLibraries/$NumExecutables/$NumObjects\n"; |
| 854 | |
| 855 | print "WARNINGS:\n $WarningsList\n"; |
Chris Lattner | 4c7e303 | 2003-01-20 06:11:03 +0000 | [diff] [blame] | 856 | print "Previous Days =\n $PrevDaysList\n"; |
| 857 | } |
| 858 | |
Chris Lattner | b344030 | 2003-01-22 16:14:05 +0000 | [diff] [blame] | 859 | |
Chris Lattner | 2f8cb57 | 2003-01-20 18:05:27 +0000 | [diff] [blame] | 860 | # |
| 861 | # Output the files... |
| 862 | # |
| 863 | |
Chris Lattner | 4d00fde | 2004-05-28 20:30:23 +0000 | [diff] [blame] | 864 | if ( $VERBOSE ) { |
| 865 | print "OUTPUT STAGE\n"; |
| 866 | } |
Chris Lattner | 2f8cb57 | 2003-01-20 18:05:27 +0000 | [diff] [blame] | 867 | # Main HTML file... |
Chris Lattner | 4c7e303 | 2003-01-20 06:11:03 +0000 | [diff] [blame] | 868 | my $Output; |
Chris Lattner | 004e19e | 2005-02-13 16:08:30 +0000 | [diff] [blame] | 869 | my $TestFinishTime = gmtime() . " GMT<br>" . localtime() . " (local)"; |
| 870 | |
Reid Spencer | cb6a3aa | 2004-06-22 15:38:37 +0000 | [diff] [blame] | 871 | my $TestPlatform = `uname -a`; |
Chris Lattner | 4c7e303 | 2003-01-20 06:11:03 +0000 | [diff] [blame] | 872 | eval "\$Output = <<ENDOFFILE;$TemplateContents\nENDOFFILE\n"; |
Chris Lattner | 2f8cb57 | 2003-01-20 18:05:27 +0000 | [diff] [blame] | 873 | WriteFile "$DATE.html", $Output; |
Chris Lattner | d9aadd4 | 2006-01-31 16:10:53 +0000 | [diff] [blame] | 874 | |
| 875 | # Remove the symlink before creating it for systems that don't have "ln -sf". |
| 876 | system ("rm index.html"); |
| 877 | system ("ln -s $DATE.html index.html"); |
Chris Lattner | 4c7e303 | 2003-01-20 06:11:03 +0000 | [diff] [blame] | 878 | |
| 879 | # Change the index.html symlink... |
Chris Lattner | 4c7e303 | 2003-01-20 06:11:03 +0000 | [diff] [blame] | 880 | |
Reid Spencer | cb6a3aa | 2004-06-22 15:38:37 +0000 | [diff] [blame] | 881 | # vim: sw=2 ai |