blob: 059d0c0b407408c894599c9ff6013b73d76801c1 [file] [log] [blame]
Alkis Evlogimenos2e142f52004-01-07 01:48:26 +00001#!/usr/bin/perl -w
Chris Lattner4c7e3032003-01-20 06:11:03 +00002#
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 Gaekeb3dab902003-10-11 05:34:00 +000010# 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.
Chris Lattner4d00fde2004-05-28 20:30:23 +000016# -nofeaturetests Do not run the feature tests.
17# -noregressiontests Do not run the regression tests.
Brian Gaekeb3dab902003-10-11 05:34:00 +000018# -notest Do not even attempt to run the test programs. Implies
19# -norunningtests.
20# -norunningtests Do not run the Olden benchmark suite with
21# LARGE_PROBLEM_SIZE enabled.
Reid Spencer1d914632004-06-23 07:45:46 +000022# -noexternals Do not run the external tests (for cases where povray
23# or SPEC are not installed)
Brian Gaekeb3dab902003-10-11 05:34:00 +000024# -parallel Run two parallel jobs with GNU Make.
Reid Spencerf6d02332004-06-11 07:06:22 +000025# -release Build an LLVM Release version
26# -pedantic Enable additional GCC warnings to detect possible errors.
Chris Lattnerbb0aca52003-12-19 03:47:31 +000027# -enable-linscan Enable linearscan tests
Brian Gaeke047e6062004-08-05 19:54:59 +000028# -disable-llc Disable LLC tests in the nightly tester.
29# -disable-jit Disable JIT tests in the nightly tester.
Chris Lattner4d00fde2004-05-28 20:30:23 +000030# -verbose Turn on some debug output
31# -debug Print information useful only to maintainers of this script.
Reid Spencercb6a3aa2004-06-22 15:38:37 +000032# -nice Checkout/Configure/Build with "nice" to reduce impact
33# on busy servers.
34# -gnuplotscript Next argument specifies gnuplot script to use
35# -templatefile Next argument specifies template file to use
Chris Lattner892cdb32004-07-27 08:29:06 +000036# -gccpath Path to gcc/g++ used to build LLVM
Chris Lattnerbb0aca52003-12-19 03:47:31 +000037#
Brian Gaekeb3dab902003-10-11 05:34:00 +000038# CVSROOT is the CVS repository from which the tree will be checked out,
39# specified either in the full :method:user@host:/dir syntax, or
40# just /dir if using a local repo.
41# BUILDDIR is the directory where sources for this test run will be checked out
42# AND objects for this test run will be built. This directory MUST NOT
43# exist before the script is run; it will be created by the cvs checkout
44# process and erased (unless -noremove is specified; see above.)
45# WEBDIR is the directory into which the test results web page will be written,
46# AND in which the "index.html" is assumed to be a symlink to the most recent
47# copy of the results. This directory MUST exist before the script is run.
Reid Spencercb6a3aa2004-06-22 15:38:37 +000048# LLVMGCCDIR is the directory in which the LLVM GCC Front End is installed
49# to. This is the same as you would have for a normal LLVM build.
Chris Lattner4c7e3032003-01-20 06:11:03 +000050#
51use POSIX qw(strftime);
52
Brian Gaekeb3dab902003-10-11 05:34:00 +000053my $HOME = $ENV{'HOME'};
54my $CVSRootDir = $ENV{'CVSROOT'};
Chris Lattner9d13efa2003-10-14 01:22:08 +000055 $CVSRootDir = "/home/vadve/shared/PublicCVS"
Chris Lattner4d00fde2004-05-28 20:30:23 +000056 unless $CVSRootDir;
57my $BuildDir = $ENV{'BUILDDIR'};
58 $BuildDir = "$HOME/buildtest"
59 unless $BuildDir;
60my $WebDir = $ENV{'WEBDIR'};
61 $WebDir = "$HOME/cvs/testresults-X86"
62 unless $WebDir;
Chris Lattner2f8cb572003-01-20 18:05:27 +000063
64# Calculate the date prefix...
65@TIME = localtime;
66my $DATE = sprintf "%4d-%02d-%02d", $TIME[5]+1900, $TIME[4]+1, $TIME[3];
67my $DateString = strftime "%B %d, %Y", localtime;
Reid Spencercb6a3aa2004-06-22 15:38:37 +000068my $TestStartTime = gmtime;
69
70# Command line argument settings...
71my $NOCHECKOUT = 0;
72my $NOREMOVE = 0;
73my $NOFEATURES = 0;
74my $NOREGRESSIONS = 0;
75my $NOTEST = 0;
76my $NORUNNINGTESTS = 0;
Reid Spencer1d914632004-06-23 07:45:46 +000077my $NOEXTERNALS = 0;
Reid Spencercb6a3aa2004-06-22 15:38:37 +000078my $MAKEOPTS = "";
79my $PROGTESTOPTS = "";
80my $VERBOSE = 0;
81my $DEBUG = 0;
Brian Gaeke047e6062004-08-05 19:54:59 +000082my $CONFIGUREARGS = "";
Reid Spencercb6a3aa2004-06-22 15:38:37 +000083my $NICE = "";
Chris Lattner2f8cb572003-01-20 18:05:27 +000084
Chris Lattnerb3440302003-01-22 16:14:05 +000085sub ReadFile {
86 if (open (FILE, $_[0])) {
Reid Spencercb6a3aa2004-06-22 15:38:37 +000087 undef $/;
Chris Lattnerb3440302003-01-22 16:14:05 +000088 my $Ret = <FILE>;
89 close FILE;
Reid Spencercb6a3aa2004-06-22 15:38:37 +000090 $/ = '\n';
Chris Lattnerb3440302003-01-22 16:14:05 +000091 return $Ret;
92 } else {
93 print "Could not open file '$_[0]' for reading!";
94 return "";
95 }
96}
97
Chris Lattner2f8cb572003-01-20 18:05:27 +000098sub WriteFile { # (filename, contents)
99 open (FILE, ">$_[0]") or die "Could not open file '$_[0]' for writing!";
100 print FILE $_[1];
101 close FILE;
102}
103
104sub GetRegex { # (Regex with ()'s, value)
Chris Lattnerd9bdbaa2003-01-22 20:35:59 +0000105 $_[1] =~ /$_[0]/m;
Chris Lattner08e24762003-08-19 18:35:03 +0000106 if (defined($1)) {
107 return $1;
108 }
Reid Spencera337f0c2004-06-23 06:36:34 +0000109 return "0";
Chris Lattner2f8cb572003-01-20 18:05:27 +0000110}
111
Reid Spencercb6a3aa2004-06-22 15:38:37 +0000112sub AddRecord {
113 my ($Val, $Filename) = @_;
114 my @Records;
115 if (open FILE, "$WebDir/$Filename") {
116 @Records = grep !/$DATE/, split "\n", <FILE>;
117 close FILE;
118 }
119 push @Records, "$DATE: $Val";
120 WriteFile "$WebDir/$Filename", (join "\n", @Records) . "\n";
121 return @Records;
122}
123
Chris Lattner2f8cb572003-01-20 18:05:27 +0000124sub AddPreTag { # Add pre tags around nonempty list, or convert to "none"
125 $_ = shift;
Chris Lattner1cbc0a62003-01-20 19:18:44 +0000126 if (length) { return "<ul><pre>$_</pre></ul>"; } else { "<b>none</b><br>"; }
Chris Lattner2f8cb572003-01-20 18:05:27 +0000127}
128
Reid Spencercb6a3aa2004-06-22 15:38:37 +0000129sub ChangeDir { # directory, logical name
130 my ($dir,$name) = @_;
131 chomp($dir);
132 if ( $VERBOSE ) { print "Changing To: $name ($dir)\n"; }
133 chdir($dir) || die "Cannot change directory to: $name ($dir) ";
134}
135
Chris Lattner2f8cb572003-01-20 18:05:27 +0000136sub GetDir {
137 my $Suffix = shift;
138 opendir DH, $WebDir;
139 my @Result = reverse sort grep !/$DATE/, grep /[-0-9]+$Suffix/, readdir DH;
140 closedir DH;
141 return @Result;
142}
143
144# DiffFiles - Diff the current version of the file against the last version of
145# the file, reporting things added and removed. This is used to report, for
146# example, added and removed warnings. This returns a pair (added, removed)
147#
148sub DiffFiles {
149 my $Suffix = shift;
150 my @Others = GetDir $Suffix;
151 if (@Others == 0) { # No other files? We added all entries...
152 return (`cat $WebDir/$DATE$Suffix`, "");
153 }
154 # Diff the files now...
155 my @Diffs = split "\n", `diff $WebDir/$DATE$Suffix $WebDir/$Others[0]`;
156 my $Added = join "\n", grep /^</, @Diffs;
157 my $Removed = join "\n", grep /^>/, @Diffs;
Chris Lattner1cbc0a62003-01-20 19:18:44 +0000158 $Added =~ s/^< //gm;
159 $Removed =~ s/^> //gm;
Chris Lattner2f8cb572003-01-20 18:05:27 +0000160 return ($Added, $Removed);
161}
162
Chris Lattner196a14a2003-08-19 15:08:34 +0000163# FormatTime - Convert a time from 1m23.45 into 83.45
164sub FormatTime {
165 my $Time = shift;
166 if ($Time =~ m/([0-9]+)m([0-9.]+)/) {
167 $Time = sprintf("%7.4f", $1*60.0+$2);
168 }
169 return $Time;
170}
171
Chris Lattnerbf6a4dc2003-08-18 06:05:21 +0000172sub GetRegexNum {
173 my ($Regex, $Num, $Regex2, $File) = @_;
174 my @Items = split "\n", `grep '$Regex' $File`;
175 return GetRegex $Regex2, $Items[$Num];
176}
177
Chris Lattner4d00fde2004-05-28 20:30:23 +0000178sub GetQMTestResults { # (filename)
179 my ($filename) = @_;
180 my @lines;
181 my $firstline;
182 $/ = "\n"; #Make sure we're going line at a time.
183 if (open SRCHFILE, $filename) {
Reid Spencer542e8592004-05-30 00:17:47 +0000184 # Skip stuff before ---TEST RESULTS
Chris Lattner4d00fde2004-05-28 20:30:23 +0000185 while ( <SRCHFILE> ) {
Reid Spenceraa0bfbe2004-05-31 20:59:55 +0000186 if ( m/^--- TEST RESULTS/ ) { last; }
Chris Lattner4d00fde2004-05-28 20:30:23 +0000187 }
Reid Spencer542e8592004-05-30 00:17:47 +0000188 # Process test results
Reid Spenceraa0bfbe2004-05-31 20:59:55 +0000189 push(@lines,"<h3>TEST RESULTS</h3><ol><li>\n");
190 my $first_list = 1;
191 my $should_break = 1;
Reid Spencerf5d0af32004-06-08 08:01:33 +0000192 my $nocopy = 0;
Chris Lattner4d00fde2004-05-28 20:30:23 +0000193 while ( <SRCHFILE> ) {
194 if ( length($_) > 1 ) {
Reid Spencercb6a3aa2004-06-22 15:38:37 +0000195 chomp($_);
196 if ( ! m/: PASS[ ]*$/ &&
197 ! m/^ qmtest.target:/ &&
198 ! m/^ local/ &&
199 ! m/^gmake:/ ) {
200 if ( m/: XFAIL/ ) {
201 $nocopy = 1;
202 } elsif ( m/: XPASS/ || m/: FAIL/ ) {
203 $nocopy = 0;
204 if ( $first_list ) {
205 $first_list = 0;
206 $should_break = 1;
207 push(@lines,"<b>$_</b><br/>\n");
208 } else {
209 push(@lines,"</li><li><b>$_</b><br/>\n");
210 }
211 } elsif ( m/^--- STATISTICS/ ) {
212 if ( $first_list ) { push(@lines,"<b>PERFECT!</b>"); }
213 push(@lines,"</li></ol><h3>STATISTICS</h3><pre>\n");
214 $should_break = 0;
215 $nocopy = 0;
216 } elsif ( m/^--- TESTS WITH/ ) {
217 $should_break = 1;
218 $first_list = 1;
219 $nocopy = 0;
220 push(@lines,"</pre><h3>TESTS WITH UNEXPECTED RESULTS</h3><ol><li>\n");
221 } elsif ( m/^real / ) {
222 last;
223 } elsif (!$nocopy) {
224 if ( $should_break ) {
225 push(@lines,"$_<br/>\n");
226 } else {
227 push(@lines,"$_\n");
228 }
229 }
230 }
Chris Lattner4d00fde2004-05-28 20:30:23 +0000231 }
232 }
233 close SRCHFILE;
234 }
235 my $content = join("",@lines);
Reid Spencerf5d0af32004-06-08 08:01:33 +0000236 return "$content</li></ol>\n";
237}
Chris Lattner4d00fde2004-05-28 20:30:23 +0000238
Reid Spencercb6a3aa2004-06-22 15:38:37 +0000239
240#####################################################################
241## MAIN PROGRAM
242#####################################################################
243
244my $Template = "";
245my $PlotScriptFilename = "";
246
247# Parse arguments...
248while (scalar(@ARGV) and ($_ = $ARGV[0], /^[-+]/)) {
249 shift;
250 last if /^--$/; # Stop processing arguments on --
251
252 # List command line options here...
253 if (/^-nocheckout$/) { $NOCHECKOUT = 1; next; }
254 if (/^-noremove$/) { $NOREMOVE = 1; next; }
255 if (/^-nofeaturetests$/) { $NOFEATURES = 1; next; }
256 if (/^-noregressiontests$/){ $NOREGRESSIONS = 1; next; }
257 if (/^-notest$/) { $NOTEST = 1; $NORUNNINGTESTS = 1; next; }
258 if (/^-norunningtests$/) { $NORUNNINGTESTS = 1; next; }
259 if (/^-parallel$/) { $MAKEOPTS = "$MAKEOPTS -j2 -l3.0"; next; }
260 if (/^-release$/) { $MAKEOPTS = "$MAKEOPTS ENABLE_OPTIMIZED=1"; next; }
261 if (/^-pedantic$/) {
262 $MAKEOPTS = "$MAKEOPTS CompileOptimizeOpts='-O3 -DNDEBUG -finline-functions -Wpointer-arith -Wcast-align -Wno-deprecated -Wold-style-cast -Wabi -Woverloaded-virtual -ffor-scope'";
263 next;
264 }
265 if (/^-enable-linscan$/) { $PROGTESTOPTS .= " ENABLE_LINEARSCAN=1"; next; }
Brian Gaeke047e6062004-08-05 19:54:59 +0000266 if (/^-disable-llc$/) { $PROGTESTOPTS .= " DISABLE_LLC=1";
267 $CONFIGUREARGS .= " --disable-llc_diffs"; next; }
268 if (/^-disable-jit$/) { $PROGTESTOPTS .= " DISABLE_JIT=1";
269 $CONFIGUREARGS .= " --disable-jit"; next; }
Reid Spencercb6a3aa2004-06-22 15:38:37 +0000270 if (/^-verbose$/) { $VERBOSE = 1; next; }
271 if (/^-debug$/) { $DEBUG = 1; next; }
272 if (/^-nice$/) { $NICE = "nice "; next; }
273 if (/^-gnuplotscript$/) { $PlotScriptFilename = $ARGV[0]; shift; next; }
Reid Spencerc5b67052004-06-23 14:07:12 +0000274 if (/^-templatefile$/) { $Template = $ARGV[0]; shift; next; }
Chris Lattner892cdb32004-07-27 08:29:06 +0000275 if (/^-gccpath/) { $CONFIGUREARGS=" CC=$ARGV[0]/gcc CXX=$ARGV[0]/g++"; shift; next; }
Reid Spencer1d914632004-06-23 07:45:46 +0000276 if (/^-noexternals$/) { $NOEXTERNALS = 1; next; }
Reid Spencercb6a3aa2004-06-22 15:38:37 +0000277
278 print "Unknown option: $_ : ignoring!\n";
279}
280
281if ($ENV{'LLVMGCCDIR'}) {
282 $CONFIGUREARGS .= " --with-llvmgccdir=" . $ENV{'LLVMGCCDIR'};
283}
Brian Gaeke047e6062004-08-05 19:54:59 +0000284if ($CONFIGUREARGS !~ /--disable-jit/) {
285 $CONFIGUREARGS .= " --enable-jit";
286}
Reid Spencercb6a3aa2004-06-22 15:38:37 +0000287
288die "Must specify 0 or 3 options!" if (@ARGV != 0 and @ARGV != 3);
289
290if (@ARGV == 3) {
291 $CVSRootDir = $ARGV[0];
292 $BuildDir = $ARGV[1];
293 $WebDir = $ARGV[2];
294}
295
Reid Spencercb6a3aa2004-06-22 15:38:37 +0000296my $Prefix = "$WebDir/$DATE";
297
298#define the file names we'll use
299my $BuildLog = "$Prefix-Build-Log.txt";
300my $CVSLog = "$Prefix-CVS-Log.txt";
301my $FeatureTestsLog = "$Prefix-FeatureTests-Log.txt";
302my $RegressionTestsLog = "$Prefix-RegressionTests-Log.txt";
303my $OldenTestsLog = "$Prefix-Olden-tests.txt";
304my $SingleSourceLog = "$Prefix-SingleSource-ProgramTest.txt.gz";
305my $MultiSourceLog = "$Prefix-MultiSource-ProgramTest.txt.gz";
306my $ExternalLog = "$Prefix-External-ProgramTest.txt.gz";
307
308if ($VERBOSE) {
309 print "INITIALIZED\n";
310 print "CVS Root = $CVSRootDir\n";
311 print "BuildDir = $BuildDir\n";
312 print "WebDir = $WebDir\n";
313 print "Prefix = $Prefix\n";
314 print "CVSLog = $CVSLog\n";
315 print "BuildLog = $BuildLog\n";
316}
317
318
319#
320# Create the CVS repository directory
321#
322if (!$NOCHECKOUT) {
323 if (-d $BuildDir) {
324 if (!$NOREMOVE) {
325 system "rm -rf $BuildDir";
326 } else {
327 die "CVS checkout directory $BuildDir already exists!";
328 }
329 }
330 mkdir $BuildDir or die "Could not create CVS checkout directory $BuildDir!";
331}
332
333ChangeDir( $BuildDir, "CVS checkout directory" );
334
335
336#
337# Check out the llvm tree, saving CVS messages to the cvs log...
338#
339$CVSOPT = "";
340$CVSOPT = "-z3" if $CVSRootDir =~ /^:ext:/; # Use compression if going over ssh.
341if (!$NOCHECKOUT) {
342 if ( $VERBOSE ) { print "CHECKOUT STAGE\n"; }
Reid Spencer214c6d62004-09-05 20:57:22 +0000343 system "( time -p $NICE cvs $CVSOPT -d $CVSRootDir co -APR llvm; cd llvm/projects ; " .
344 "$NICE cvs $CVSOPT -d $CVSRootDir co -APR llvm-test ) > $CVSLog 2>&1";
Reid Spencer10ffe012004-09-05 07:58:10 +0000345 ChangeDir( $BuildDir , "CVS Checkout directory") ;
Reid Spencercb6a3aa2004-06-22 15:38:37 +0000346}
347
348ChangeDir( "llvm" , "llvm source directory") ;
349
350if (!$NOCHECKOUT) {
351 if ( $VERBOSE ) { print "UPDATE STAGE\n"; }
Reid Spencer10ffe012004-09-05 07:58:10 +0000352 system "$NICE cvs update -PdRA >> $CVSLog 2>&1" ;
Reid Spencercb6a3aa2004-06-22 15:38:37 +0000353}
354
Reid Spencerc5b67052004-06-23 14:07:12 +0000355if ( $Template eq "" ) {
356 $Template = "$BuildDir/llvm/utils/NightlyTestTemplate.html";
357}
358die "Template file $Template is not readable" if ( ! -r "$Template" );
359
360if ( $PlotScriptFilename eq "" ) {
361 $PlotScriptFilename = "$BuildDir/llvm/utils/NightlyTest.gnuplot";
362}
363die "GNUPlot Script $PlotScriptFilename is not readable" if ( ! -r "$PlotScriptFilename" );
364
Reid Spencercb6a3aa2004-06-22 15:38:37 +0000365# Read in the HTML template file...
366if ( $VERBOSE ) { print "READING TEMPLATE\n"; }
367my $TemplateContents = ReadFile $Template;
368
369#
370# Get some static statistics about the current state of CVS
371#
372my $CVSCheckoutTime = GetRegex "([0-9.]+)", `grep '^real' $CVSLog`;
373my $NumFilesInCVS = `egrep '^U' $CVSLog | wc -l` + 0;
374my $NumDirsInCVS = `egrep '^cvs (checkout|server|update):' $CVSLog | wc -l` + 0;
Reid Spencere993f462004-09-06 19:32:55 +0000375$LOC = `utils/countloc.sh`;
Reid Spencercb6a3aa2004-06-22 15:38:37 +0000376
377#
378# Build the entire tree, saving build messages to the build log
379#
380if (!$NOCHECKOUT) {
381 if ( $VERBOSE ) { print "CONFIGURE STAGE\n"; }
382 system "(time -p $NICE ./configure $CONFIGUREARGS --enable-spec --with-objroot=.) > $BuildLog 2>&1";
383
384 if ( $VERBOSE ) { print "BUILD STAGE\n"; }
385 # Build the entire tree, capturing the output into $BuildLog
386 system "(time -p $NICE gmake $MAKEOPTS) >> $BuildLog 2>&1";
387}
388
389
390#
391# Get some statistics about the build...
392#
393my @Linked = split '\n', `grep Linking $BuildLog`;
394my $NumExecutables = scalar(grep(/executable/, @Linked));
395my $NumLibraries = scalar(grep(!/executable/, @Linked));
396my $NumObjects = `grep '^Compiling' $BuildLog | wc -l` + 0;
397
398my $ConfigTimeU = GetRegexNum "^user", 0, "([0-9.]+)", "$BuildLog";
399my $ConfigTimeS = GetRegexNum "^sys", 0, "([0-9.]+)", "$BuildLog";
400my $ConfigTime = $ConfigTimeU+$ConfigTimeS; # ConfigTime = User+System
401my $ConfigWallTime = GetRegexNum "^real", 0,"([0-9.]+)","$BuildLog";
402
403my $BuildTimeU = GetRegexNum "^user", 1, "([0-9.]+)", "$BuildLog";
404my $BuildTimeS = GetRegexNum "^sys", 1, "([0-9.]+)", "$BuildLog";
405my $BuildTime = $BuildTimeU+$BuildTimeS; # BuildTime = User+System
406my $BuildWallTime = GetRegexNum "^real", 1, "([0-9.]+)","$BuildLog";
407
408my $BuildError = "";
409if (`grep '^gmake[^:]*: .*Error' $BuildLog | wc -l` + 0 ||
410 `grep '^gmake: \*\*\*.*Stop.' $BuildLog | wc -l`+0) {
411 $BuildError = "<h3><font color='red'>Build error: compilation " .
412 "<a href=\"$DATE-Build-Log.txt\">aborted</a></font></h3>";
413 if ($VERBOSE) { print "BUILD ERROR\n"; }
414}
415
Brian Gaeke22800982004-06-25 07:25:28 +0000416if ($BuildError) { $NOFEATURES = 1; $NOREGRESSIONS = 1; }
417
Chris Lattner4d00fde2004-05-28 20:30:23 +0000418# Get results of feature tests.
419my $FeatureTestResults; # String containing the results of the feature tests
420my $FeatureTime; # System+CPU Time for feature tests
421my $FeatureWallTime; # Wall Clock Time for feature tests
422if (!$NOFEATURES) {
423 if ( $VERBOSE ) { print "FEATURE TEST STAGE\n"; }
Reid Spencercb6a3aa2004-06-22 15:38:37 +0000424 my $feature_output = "$FeatureTestsLog";
Chris Lattner4d00fde2004-05-28 20:30:23 +0000425
426 # Run the feature tests so we can summarize the results
Reid Spencercb6a3aa2004-06-22 15:38:37 +0000427 system "(time -p gmake $MAKEOPTS -C test Feature.t) > $feature_output 2>&1";
Chris Lattner4d00fde2004-05-28 20:30:23 +0000428
429 # Extract test results
430 $FeatureTestResults = GetQMTestResults("$feature_output");
431
432 # Extract time of feature tests
433 my $FeatureTimeU = GetRegexNum "^user", 0, "([0-9.]+)", "$feature_output";
434 my $FeatureTimeS = GetRegexNum "^sys", 0, "([0-9.]+)", "$feature_output";
435 $FeatureTime = $FeatureTimeU+$FeatureTimeS; # FeatureTime = User+System
436 $FeatureWallTime = GetRegexNum "^real", 0,"([0-9.]+)","$feature_output";
437 # Run the regression tests so we can summarize the results
438} else {
439 $FeatureTestResults = "Skipped by user choice.";
440 $FeatureTime = "0.0";
441 $FeatureWallTime = "0.0";
442}
443
444if (!$NOREGRESSIONS) {
445 if ( $VERBOSE ) { print "REGRESSION TEST STAGE\n"; }
Reid Spencercb6a3aa2004-06-22 15:38:37 +0000446 my $regression_output = "$RegressionTestsLog";
Chris Lattner4d00fde2004-05-28 20:30:23 +0000447
448 # Run the regression tests so we can summarize the results
Reid Spencercb6a3aa2004-06-22 15:38:37 +0000449 system "(time -p gmake $MAKEOPTS -C test Regression.t) > $regression_output 2>&1";
Chris Lattner4d00fde2004-05-28 20:30:23 +0000450
451 # Extract test results
452 $RegressionTestResults = GetQMTestResults("$regression_output");
453
454 # Extract time of regressions tests
455 my $RegressionTimeU = GetRegexNum "^user", 0, "([0-9.]+)", "$regression_output";
456 my $RegressionTimeS = GetRegexNum "^sys", 0, "([0-9.]+)", "$regression_output";
457 $RegressionTime = $RegressionTimeU+$RegressionTimeS; # RegressionTime = User+System
458 $RegressionWallTime = GetRegexNum "^real", 0,"([0-9.]+)","$regression_output";
459} else {
460 $RegressionTestResults = "Skipped by user choice.";
461 $RegressionTime = "0.0";
462 $RegressionWallTime = "0.0";
463}
464
465if ($DEBUG) {
466 print $FeatureTestResults;
467 print $RegressionTestResults;
468}
469
470if ( $VERBOSE ) { print "BUILD INFORMATION COLLECTION STAGE\n"; }
Chris Lattnerb3440302003-01-22 16:14:05 +0000471#
Chris Lattner4c7e3032003-01-20 06:11:03 +0000472# Get warnings from the build
Chris Lattnerb3440302003-01-22 16:14:05 +0000473#
Reid Spencercb6a3aa2004-06-22 15:38:37 +0000474my @Warn = split "\n", `egrep 'warning:|Entering dir' $BuildLog`;
Chris Lattner4c7e3032003-01-20 06:11:03 +0000475my @Warnings;
476my $CurDir = "";
477
478foreach $Warning (@Warn) {
479 if ($Warning =~ m/Entering directory \`([^\`]+)\'/) {
480 $CurDir = $1; # Keep track of directory warning is in...
Misha Brukman8e9554a2003-08-14 15:26:28 +0000481 if ($CurDir =~ m#$BuildDir/llvm/(.*)#) { # Remove buildir prefix if included
Chris Lattner4c7e3032003-01-20 06:11:03 +0000482 $CurDir = $1;
483 }
484 } else {
485 push @Warnings, "$CurDir/$Warning"; # Add directory to warning...
486 }
487}
Chris Lattner1cbc0a62003-01-20 19:18:44 +0000488my $WarningsFile = join "\n", @Warnings;
489my $WarningsList = AddPreTag $WarningsFile;
490$WarningsFile =~ s/:[0-9]+:/::/g;
Chris Lattner4c7e3032003-01-20 06:11:03 +0000491
Chris Lattner2f8cb572003-01-20 18:05:27 +0000492# Emit the warnings file, so we can diff...
493WriteFile "$WebDir/$DATE-Warnings.txt", $WarningsFile . "\n";
494my ($WarningsAdded, $WarningsRemoved) = DiffFiles "-Warnings.txt";
Chris Lattner4c7e3032003-01-20 06:11:03 +0000495
Chris Lattner9efd7f42003-10-18 19:31:39 +0000496# Output something to stdout if something has changed
497print "ADDED WARNINGS:\n$WarningsAdded\n\n" if (length $WarningsAdded);
498print "REMOVED WARNINGS:\n$WarningsRemoved\n\n" if (length $WarningsRemoved);
499
Chris Lattnerbe197872003-10-19 16:54:00 +0000500$WarningsAdded = AddPreTag $WarningsAdded;
501$WarningsRemoved = AddPreTag $WarningsRemoved;
Chris Lattnerb3440302003-01-22 16:14:05 +0000502
503#
Chris Lattner4c7e3032003-01-20 06:11:03 +0000504# Get some statistics about CVS commits over the current day...
Chris Lattnerb3440302003-01-22 16:14:05 +0000505#
Chris Lattner4d00fde2004-05-28 20:30:23 +0000506if ($VERBOSE) { print "CVS HISTORY ANALYSIS STAGE\n"; }
Chris Lattner4c7e3032003-01-20 06:11:03 +0000507@CVSHistory = split "\n", `cvs history -D '1 day ago' -a -xAMROCGUW`;
508#print join "\n", @CVSHistory; print "\n";
509
510# Extract some information from the CVS history... use a hash so no duplicate
511# stuff is stored.
Misha Brukman1b366892003-07-07 21:27:40 +0000512my (%AddedFiles, %ModifiedFiles, %RemovedFiles, %UsersCommitted, %UsersUpdated);
Chris Lattner4c7e3032003-01-20 06:11:03 +0000513
Brian Gaeke43f38672004-06-10 07:44:28 +0000514my $DateRE = '[-/:0-9 ]+\+[0-9]+';
Chris Lattnerd9bdbaa2003-01-22 20:35:59 +0000515
Chris Lattner4c7e3032003-01-20 06:11:03 +0000516# Loop over every record from the CVS history, filling in the hashes.
517foreach $File (@CVSHistory) {
518 my ($Type, $Date, $UID, $Rev, $Filename);
Misha Brukman8e9554a2003-08-14 15:26:28 +0000519 if ($File =~ /([AMRUGC]) ($DateRE) ([^ ]+) +([^ ]+) +([^ ]+) +([^ ]+)/) {
Chris Lattner4c7e3032003-01-20 06:11:03 +0000520 ($Type, $Date, $UID, $Rev, $Filename) = ($1, $2, $3, $4, "$6/$5");
Chris Lattnerd56147d2004-01-12 16:55:30 +0000521 } elsif ($File =~ /([W]) ($DateRE) ([^ ]+)/) {
522 ($Type, $Date, $UID, $Rev, $Filename) = ($1, $2, $3, "", "");
Misha Brukman1b366892003-07-07 21:27:40 +0000523 } elsif ($File =~ /([O]) ($DateRE) ([^ ]+) +([^ ]+)/) {
Chris Lattnerd9bdbaa2003-01-22 20:35:59 +0000524 ($Type, $Date, $UID, $Rev, $Filename) = ($1, $2, $3, "", "$4/");
Chris Lattner4c7e3032003-01-20 06:11:03 +0000525 } else {
Chris Lattnerd9bdbaa2003-01-22 20:35:59 +0000526 print "UNMATCHABLE: $File\n";
Brian Gaeke43f38672004-06-10 07:44:28 +0000527 next;
Chris Lattnerd9bdbaa2003-01-22 20:35:59 +0000528 }
529 # print "$File\nTy = $Type Date = '$Date' UID=$UID Rev=$Rev File = '$Filename'\n";
530
531 if ($Filename =~ /^llvm/) {
532 if ($Type eq 'M') { # Modified
533 $ModifiedFiles{$Filename} = 1;
534 $UsersCommitted{$UID} = 1;
535 } elsif ($Type eq 'A') { # Added
536 $AddedFiles{$Filename} = 1;
537 $UsersCommitted{$UID} = 1;
538 } elsif ($Type eq 'R') { # Removed
539 $RemovedFiles{$Filename} = 1;
540 $UsersCommitted{$UID} = 1;
541 } else {
542 $UsersUpdated{$UID} = 1;
543 }
Chris Lattner4c7e3032003-01-20 06:11:03 +0000544 }
545}
546
Chris Lattner1cbc0a62003-01-20 19:18:44 +0000547my $UserCommitList = join "\n", keys %UsersCommitted;
548my $UserUpdateList = join "\n", keys %UsersUpdated;
Chris Lattnerc9cdadf2003-08-06 16:02:50 +0000549my $AddedFilesList = AddPreTag join "\n", sort keys %AddedFiles;
550my $ModifiedFilesList = AddPreTag join "\n", sort keys %ModifiedFiles;
551my $RemovedFilesList = AddPreTag join "\n", sort keys %RemovedFiles;
Chris Lattner4c7e3032003-01-20 06:11:03 +0000552
Chris Lattnerec0e3742003-02-28 20:30:20 +0000553my $TestError = 1;
Reid Spencercb6a3aa2004-06-22 15:38:37 +0000554my $SingleSourceProgramsTable = "!";
555my $MultiSourceProgramsTable = "!";
556my $ExternalProgramsTable = "!";
Chris Lattnerb3440302003-01-22 16:14:05 +0000557
Chris Lattnerbf6a4dc2003-08-18 06:05:21 +0000558
559sub TestDirectory {
560 my $SubDir = shift;
561
Reid Spencer10ffe012004-09-05 07:58:10 +0000562 ChangeDir( "projects/llvm-test/$SubDir", "Programs Test Subdirectory" );
Reid Spencercb6a3aa2004-06-22 15:38:37 +0000563
564 my $ProgramTestLog = "$Prefix-$SubDir-ProgramTest.txt";
Chris Lattnerec0e3742003-02-28 20:30:20 +0000565
566 # Run the programs tests... creating a report.nightly.html file
567 if (!$NOTEST) {
Chris Lattner20d13ea2004-06-03 03:29:39 +0000568 system "gmake -k $MAKEOPTS $PROGTESTOPTS report.nightly.html "
Reid Spencercb6a3aa2004-06-22 15:38:37 +0000569 . "TEST=nightly > $ProgramTestLog 2>&1";
Chris Lattnerec0e3742003-02-28 20:30:20 +0000570 } else {
Reid Spencercb6a3aa2004-06-22 15:38:37 +0000571 system "gunzip ${ProgramTestLog}.gz";
Chris Lattnerec0e3742003-02-28 20:30:20 +0000572 }
573
Chris Lattnerbf6a4dc2003-08-18 06:05:21 +0000574 my $ProgramsTable;
Reid Spencercb6a3aa2004-06-22 15:38:37 +0000575 if (`grep '^gmake[^:]: .*Error' $ProgramTestLog | wc -l` + 0){
Chris Lattnerec0e3742003-02-28 20:30:20 +0000576 $TestError = 1;
Chris Lattner2e8be142003-05-10 21:40:10 +0000577 $ProgramsTable = "<font color=white><h2>Error running tests!</h2></font>";
Chris Lattnerbe197872003-10-19 16:54:00 +0000578 print "ERROR TESTING\n";
Reid Spencercb6a3aa2004-06-22 15:38:37 +0000579 } elsif (`grep '^gmake[^:]: .*No rule to make target' $ProgramTestLog | wc -l` + 0) {
Chris Lattner6e51bfa2003-05-11 15:23:10 +0000580 $TestError = 1;
581 $ProgramsTable =
582 "<font color=white><h2>Makefile error running tests!</h2></font>";
Chris Lattnerbe197872003-10-19 16:54:00 +0000583 print "ERROR TESTING\n";
Chris Lattner6e51bfa2003-05-11 15:23:10 +0000584 } else {
Chris Lattnerec0e3742003-02-28 20:30:20 +0000585 $TestError = 0;
586 $ProgramsTable = ReadFile "report.nightly.html";
587
588 #
589 # Create a list of the tests which were run...
590 #
Reid Spencercb6a3aa2004-06-22 15:38:37 +0000591 system "egrep 'TEST-(PASS|FAIL)' < $ProgramTestLog "
Chris Lattnerbf6a4dc2003-08-18 06:05:21 +0000592 . "| sort > $Prefix-$SubDir-Tests.txt";
Chris Lattnerec0e3742003-02-28 20:30:20 +0000593 }
594
595 # Compress the test output
Reid Spencercb6a3aa2004-06-22 15:38:37 +0000596 system "gzip -f $ProgramTestLog";
597 ChangeDir( "../../..", "Programs Test Parent Directory" );
Chris Lattnerbf6a4dc2003-08-18 06:05:21 +0000598 return $ProgramsTable;
599}
600
Reid Spencercb6a3aa2004-06-22 15:38:37 +0000601# If we built the tree successfully, run the nightly programs tests...
Chris Lattnerbf6a4dc2003-08-18 06:05:21 +0000602if ($BuildError eq "") {
Chris Lattner4d00fde2004-05-28 20:30:23 +0000603 if ( $VERBOSE ) {
604 print "SingleSource TEST STAGE\n";
605 }
Chris Lattnerbf6a4dc2003-08-18 06:05:21 +0000606 $SingleSourceProgramsTable = TestDirectory("SingleSource");
Chris Lattner4d00fde2004-05-28 20:30:23 +0000607 if ( $VERBOSE ) {
608 print "MultiSource TEST STAGE\n";
609 }
Chris Lattnerbf6a4dc2003-08-18 06:05:21 +0000610 $MultiSourceProgramsTable = TestDirectory("MultiSource");
Reid Spencer1d914632004-06-23 07:45:46 +0000611 if ( ! $NOEXTERNALS ) {
612 if ( $VERBOSE ) {
613 print "External TEST STAGE\n";
614 }
615 $ExternalProgramsTable = TestDirectory("External");
616 system "cat $Prefix-SingleSource-Tests.txt $Prefix-MultiSource-Tests.txt ".
Chris Lattnereac3cdc2003-08-21 15:55:26 +0000617 " $Prefix-External-Tests.txt | sort > $Prefix-Tests.txt";
Reid Spencer1d914632004-06-23 07:45:46 +0000618 } else {
619 if ( $VERBOSE ) {
620 print "External TEST STAGE SKIPPED\n";
621 }
622 system "cat $Prefix-SingleSource-Tests.txt $Prefix-MultiSource-Tests.txt ".
623 " | sort > $Prefix-Tests.txt";
624 }
Chris Lattner5d6c4382003-01-23 19:31:28 +0000625}
Chris Lattnerb3440302003-01-22 16:14:05 +0000626
Reid Spencercb6a3aa2004-06-22 15:38:37 +0000627if ( $VERBOSE ) { print "TEST INFORMATION COLLECTION STAGE\n"; }
Chris Lattnerd9bdbaa2003-01-22 20:35:59 +0000628my ($TestsAdded, $TestsRemoved, $TestsFixed, $TestsBroken) = ("","","","");
629
Chris Lattnerec0e3742003-02-28 20:30:20 +0000630if ($TestError) {
631 $TestsAdded = "<b>error testing</b><br>";
632 $TestsRemoved = "<b>error testing</b><br>";
633 $TestsFixed = "<b>error testing</b><br>";
634 $TestsBroken = "<b>error testing</b><br>";
635} else {
636 my ($RTestsAdded, $RTestsRemoved) = DiffFiles "-Tests.txt";
637
638 my @RawTestsAddedArray = split '\n', $RTestsAdded;
639 my @RawTestsRemovedArray = split '\n', $RTestsRemoved;
640
641 my %OldTests = map {GetRegex('TEST-....: (.+)', $_)=>$_}
642 @RawTestsRemovedArray;
643 my %NewTests = map {GetRegex('TEST-....: (.+)', $_)=>$_}
644 @RawTestsAddedArray;
645
646 foreach $Test (keys %NewTests) {
647 if (!exists $OldTests{$Test}) { # TestAdded if in New but not old
648 $TestsAdded = "$TestsAdded$Test\n";
Chris Lattnerd9bdbaa2003-01-22 20:35:59 +0000649 } else {
Chris Lattnerec0e3742003-02-28 20:30:20 +0000650 if ($OldTests{$Test} =~ /TEST-PASS/) { # Was the old one a pass?
651 $TestsBroken = "$TestsBroken$Test\n"; # New one must be a failure
652 } else {
653 $TestsFixed = "$TestsFixed$Test\n"; # No, new one is a pass.
654 }
Chris Lattnerd9bdbaa2003-01-22 20:35:59 +0000655 }
656 }
Chris Lattnerec0e3742003-02-28 20:30:20 +0000657 foreach $Test (keys %OldTests) { # TestRemoved if in Old but not New
658 $TestsRemoved = "$TestsRemoved$Test\n" if (!exists $NewTests{$Test});
659 }
Chris Lattnerd9bdbaa2003-01-22 20:35:59 +0000660
Chris Lattner91480ff2003-10-21 15:47:31 +0000661 print "\nTESTS ADDED: \n\n$TestsAdded\n\n" if (length $TestsAdded);
662 print "\nTESTS REMOVED:\n\n$TestsRemoved\n\n" if (length $TestsRemoved);
663 print "\nTESTS FIXED: \n\n$TestsFixed\n\n" if (length $TestsFixed);
664 print "\nTESTS BROKEN: \n\n$TestsBroken\n\n" if (length $TestsBroken);
Chris Lattnerbe197872003-10-19 16:54:00 +0000665
Chris Lattnerec0e3742003-02-28 20:30:20 +0000666 $TestsAdded = AddPreTag $TestsAdded;
667 $TestsRemoved = AddPreTag $TestsRemoved;
668 $TestsFixed = AddPreTag $TestsFixed;
669 $TestsBroken = AddPreTag $TestsBroken;
670}
Chris Lattnerd9bdbaa2003-01-22 20:35:59 +0000671
Chris Lattner9efd7f42003-10-18 19:31:39 +0000672
Chris Lattner196a14a2003-08-19 15:08:34 +0000673# If we built the tree successfully, runs of the Olden suite with
674# LARGE_PROBLEM_SIZE on so that we can get some "running" statistics.
675if ($BuildError eq "") {
Reid Spencercb6a3aa2004-06-22 15:38:37 +0000676 if ( $VERBOSE ) { print "OLDEN TEST SUITE STAGE\n"; }
Chris Lattner08e24762003-08-19 18:35:03 +0000677 my ($NATTime, $CBETime, $LLCTime, $JITTime, $OptTime, $BytecodeSize,
Chris Lattner196a14a2003-08-19 15:08:34 +0000678 $MachCodeSize) = ("","","","","","","");
Chris Lattner08e24762003-08-19 18:35:03 +0000679 if (!$NORUNNINGTESTS) {
Reid Spencer10ffe012004-09-05 07:58:10 +0000680 ChangeDir( "$BuildDir/llvm/projects/llvm-test/MultiSource/Benchmarks/Olden",
Reid Spencercb6a3aa2004-06-22 15:38:37 +0000681 "Olden Test Directory");
Chris Lattner196a14a2003-08-19 15:08:34 +0000682
683 # Clean out previous results...
Reid Spencercb6a3aa2004-06-22 15:38:37 +0000684 system "$NICE gmake $MAKEOPTS clean > /dev/null 2>&1";
Chris Lattner196a14a2003-08-19 15:08:34 +0000685
686 # Run the nightly test in this directory, with LARGE_PROBLEM_SIZE enabled!
Brian Gaeke85668542004-06-04 00:07:12 +0000687 system "gmake -k $MAKEOPTS $PROGTESTOPTS report.nightly.raw.out TEST=nightly " .
Chris Lattner196a14a2003-08-19 15:08:34 +0000688 " LARGE_PROBLEM_SIZE=1 > /dev/null 2>&1";
Reid Spencercb6a3aa2004-06-22 15:38:37 +0000689 system "cp report.nightly.raw.out $OldenTestsLog";
Chris Lattner196a14a2003-08-19 15:08:34 +0000690 } else {
Reid Spencercb6a3aa2004-06-22 15:38:37 +0000691 system "gunzip ${OldenTestsLog}.gz";
Chris Lattner196a14a2003-08-19 15:08:34 +0000692 }
693
Reid Spencercb6a3aa2004-06-22 15:38:37 +0000694 # Now we know we have $OldenTestsLog as the raw output file. Split
Chris Lattner196a14a2003-08-19 15:08:34 +0000695 # it up into records and read the useful information.
Reid Spencercb6a3aa2004-06-22 15:38:37 +0000696 my @Records = split />>> ========= /, ReadFile "$OldenTestsLog";
Chris Lattner196a14a2003-08-19 15:08:34 +0000697 shift @Records; # Delete the first (garbage) record
698
699 # Loop over all of the records, summarizing them into rows for the running
700 # totals file.
701 my $WallTimeRE = "[A-Za-z0-9.: ]+\\(([0-9.]+) wall clock";
702 foreach $Rec (@Records) {
Chris Lattner08e24762003-08-19 18:35:03 +0000703 my $rNATTime = GetRegex 'TEST-RESULT-nat-time: real\s*([.0-9m]+)', $Rec;
704 my $rCBETime = GetRegex 'TEST-RESULT-cbe-time: real\s*([.0-9m]+)', $Rec;
705 my $rLLCTime = GetRegex 'TEST-RESULT-llc-time: real\s*([.0-9m]+)', $Rec;
706 my $rJITTime = GetRegex 'TEST-RESULT-jit-time: real\s*([.0-9m]+)', $Rec;
Chris Lattner196a14a2003-08-19 15:08:34 +0000707 my $rOptTime = GetRegex "TEST-RESULT-compile: $WallTimeRE", $Rec;
708 my $rBytecodeSize = GetRegex 'TEST-RESULT-compile: *([0-9]+)', $Rec;
709 my $rMachCodeSize = GetRegex 'TEST-RESULT-jit-machcode: *([0-9]+).*bytes of machine code', $Rec;
710
711 $NATTime .= " " . FormatTime($rNATTime);
712 $CBETime .= " " . FormatTime($rCBETime);
713 $LLCTime .= " " . FormatTime($rLLCTime);
714 $JITTime .= " " . FormatTime($rJITTime);
715 $OptTime .= " $rOptTime";
Chris Lattner08e24762003-08-19 18:35:03 +0000716 $BytecodeSize .= " $rBytecodeSize";
717 $MachCodeSize .= " $rMachCodeSize";
Chris Lattner196a14a2003-08-19 15:08:34 +0000718 }
719
720 # Now that we have all of the numbers we want, add them to the running totals
721 # files.
Chris Lattner08e24762003-08-19 18:35:03 +0000722 AddRecord($NATTime, "running_Olden_nat_time.txt");
Chris Lattner196a14a2003-08-19 15:08:34 +0000723 AddRecord($CBETime, "running_Olden_cbe_time.txt");
724 AddRecord($LLCTime, "running_Olden_llc_time.txt");
725 AddRecord($JITTime, "running_Olden_jit_time.txt");
726 AddRecord($OptTime, "running_Olden_opt_time.txt");
727 AddRecord($BytecodeSize, "running_Olden_bytecode.txt");
728 AddRecord($MachCodeSize, "running_Olden_machcode.txt");
Chris Lattner08e24762003-08-19 18:35:03 +0000729
Reid Spencercb6a3aa2004-06-22 15:38:37 +0000730 system "gzip -f $OldenTestsLog";
Chris Lattner196a14a2003-08-19 15:08:34 +0000731}
732
733
Chris Lattnerd9bdbaa2003-01-22 20:35:59 +0000734#
Chris Lattner4c7e3032003-01-20 06:11:03 +0000735# Get a list of the previous days that we can link to...
Chris Lattnerb3440302003-01-22 16:14:05 +0000736#
Chris Lattner2f8cb572003-01-20 18:05:27 +0000737my @PrevDays = map {s/.html//; $_} GetDir ".html";
Chris Lattner4c7e3032003-01-20 06:11:03 +0000738
Brian Gaeke253231e2004-06-11 19:55:30 +0000739if ((scalar @PrevDays) > 20) {
740 splice @PrevDays, 20; # Trim down list to something reasonable...
741}
Chris Lattner4c7e3032003-01-20 06:11:03 +0000742
Reid Spencercb6a3aa2004-06-22 15:38:37 +0000743# Format list for sidebar
744my $PrevDaysList = join "\n ", map { "<a href=\"$_.html\">$_</a><br>" } @PrevDays;
Chris Lattner4c7e3032003-01-20 06:11:03 +0000745
Chris Lattnerc75b14e2003-08-18 20:07:54 +0000746#
747# Start outputing files into the web directory
748#
Reid Spencercb6a3aa2004-06-22 15:38:37 +0000749ChangeDir( $WebDir, "Web Directory" );
Chris Lattnerc75b14e2003-08-18 20:07:54 +0000750
751# Add information to the files which accumulate information for graphs...
752AddRecord($LOC, "running_loc.txt");
753AddRecord($BuildTime, "running_build_time.txt");
754
Chris Lattner4d00fde2004-05-28 20:30:23 +0000755if ( $VERBOSE ) {
756 print "GRAPH GENERATION STAGE\n";
757}
Chris Lattnerc75b14e2003-08-18 20:07:54 +0000758#
759# Rebuild the graphs now...
760#
Chris Lattnerfe2597a2004-07-27 18:41:49 +0000761$GNUPLOT = "/usr/bin/gnuplot";
Brian Gaekeb3dab902003-10-11 05:34:00 +0000762$GNUPLOT = "gnuplot" if ! -x $GNUPLOT;
Reid Spencercb6a3aa2004-06-22 15:38:37 +0000763system ("$GNUPLOT", $PlotScriptFilename);
Chris Lattnerb3440302003-01-22 16:14:05 +0000764
Chris Lattner4c7e3032003-01-20 06:11:03 +0000765#
766# Remove the cvs tree...
767#
Reid Spencercb6a3aa2004-06-22 15:38:37 +0000768system ( "$NICE rm -rf $BuildDir") if (!$NOCHECKOUT and !$NOREMOVE);
Chris Lattner4c7e3032003-01-20 06:11:03 +0000769
Chris Lattnerb3440302003-01-22 16:14:05 +0000770#
Chris Lattner4c7e3032003-01-20 06:11:03 +0000771# Print out information...
Chris Lattnerb3440302003-01-22 16:14:05 +0000772#
Chris Lattner4d00fde2004-05-28 20:30:23 +0000773if ($VERBOSE) {
Chris Lattner4c7e3032003-01-20 06:11:03 +0000774 print "DateString: $DateString\n";
775 print "CVS Checkout: $CVSCheckoutTime seconds\n";
776 print "Files/Dirs/LOC in CVS: $NumFilesInCVS/$NumDirsInCVS/$LOC\n";
Chris Lattner4c7e3032003-01-20 06:11:03 +0000777 print "Build Time: $BuildTime seconds\n";
Chris Lattner4d00fde2004-05-28 20:30:23 +0000778 print "Feature Test Time: $FeatureTime seconds\n";
779 print "Regression Test Time: $RegressionTime seconds\n";
Chris Lattner4c7e3032003-01-20 06:11:03 +0000780 print "Libraries/Executables/Objects built: $NumLibraries/$NumExecutables/$NumObjects\n";
781
782 print "WARNINGS:\n $WarningsList\n";
783
Chris Lattner4c7e3032003-01-20 06:11:03 +0000784 print "Users committed: $UserCommitList\n";
785 print "Added Files: \n $AddedFilesList\n";
786 print "Modified Files: \n $ModifiedFilesList\n";
787 print "Removed Files: \n $RemovedFilesList\n";
788
789 print "Previous Days =\n $PrevDaysList\n";
790}
791
Chris Lattnerb3440302003-01-22 16:14:05 +0000792
Chris Lattner2f8cb572003-01-20 18:05:27 +0000793#
794# Output the files...
795#
796
Chris Lattner4d00fde2004-05-28 20:30:23 +0000797if ( $VERBOSE ) {
798 print "OUTPUT STAGE\n";
799}
Chris Lattner2f8cb572003-01-20 18:05:27 +0000800# Main HTML file...
Chris Lattner4c7e3032003-01-20 06:11:03 +0000801my $Output;
Reid Spencercb6a3aa2004-06-22 15:38:37 +0000802my $TestFinishTime = gmtime;
803my $TestPlatform = `uname -a`;
Chris Lattner4c7e3032003-01-20 06:11:03 +0000804eval "\$Output = <<ENDOFFILE;$TemplateContents\nENDOFFILE\n";
Chris Lattner2f8cb572003-01-20 18:05:27 +0000805WriteFile "$DATE.html", $Output;
Reid Spencercb6a3aa2004-06-22 15:38:37 +0000806system ( "ln -sf $DATE.html index.html" );
Chris Lattner4c7e3032003-01-20 06:11:03 +0000807
808# Change the index.html symlink...
Chris Lattner4c7e3032003-01-20 06:11:03 +0000809
Reid Spencercb6a3aa2004-06-22 15:38:37 +0000810# vim: sw=2 ai