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