3 # Program: NightlyTest.pl
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.
10 # Syntax: NightlyTest.pl [OPTIONS] [CVSROOT BUILDDIR WEBDIR]
12 # OPTIONS may include one or more of the following:
13 # -nocheckout Do not create, checkout, update, or configure
15 # -noremove Do not remove the BUILDDIR after it has been built.
16 # -nofeaturetests Do not run the feature tests.
17 # -noregressiontests Do not run the regression tests.
18 # -notest Do not even attempt to run the test programs. Implies
20 # -norunningtests Do not run the Olden benchmark suite with
21 # LARGE_PROBLEM_SIZE enabled.
22 # -parallel Run two parallel jobs with GNU Make.
23 # -enable-linscan Enable linearscan tests
24 # -disable-codegen Disable LLC and JIT tests in the nightly tester.
25 # -verbose Turn on some debug output
26 # -debug Print information useful only to maintainers of this script.
28 # CVSROOT is the CVS repository from which the tree will be checked out,
29 # specified either in the full :method:user@host:/dir syntax, or
30 # just /dir if using a local repo.
31 # BUILDDIR is the directory where sources for this test run will be checked out
32 # AND objects for this test run will be built. This directory MUST NOT
33 # exist before the script is run; it will be created by the cvs checkout
34 # process and erased (unless -noremove is specified; see above.)
35 # WEBDIR is the directory into which the test results web page will be written,
36 # AND in which the "index.html" is assumed to be a symlink to the most recent
37 # copy of the results. This directory MUST exist before the script is run.
39 use POSIX qw(strftime);
41 my $HOME = $ENV{'HOME'};
42 my $CVSRootDir = $ENV{'CVSROOT'};
43 $CVSRootDir = "/home/vadve/shared/PublicCVS"
45 my $BuildDir = $ENV{'BUILDDIR'};
46 $BuildDir = "$HOME/buildtest"
48 my $WebDir = $ENV{'WEBDIR'};
49 $WebDir = "$HOME/cvs/testresults-X86"
52 # Calculate the date prefix...
54 my $DATE = sprintf "%4d-%02d-%02d", $TIME[5]+1900, $TIME[4]+1, $TIME[3];
55 my $DateString = strftime "%B %d, %Y", localtime;
59 if (open (FILE, $_[0])) {
64 print "Could not open file '$_[0]' for reading!";
69 sub WriteFile { # (filename, contents)
70 open (FILE, ">$_[0]") or die "Could not open file '$_[0]' for writing!";
75 sub GetRegex { # (Regex with ()'s, value)
83 sub AddPreTag { # Add pre tags around nonempty list, or convert to "none"
85 if (length) { return "<ul><pre>$_</pre></ul>"; } else { "<b>none</b><br>"; }
91 my @Result = reverse sort grep !/$DATE/, grep /[-0-9]+$Suffix/, readdir DH;
96 # DiffFiles - Diff the current version of the file against the last version of
97 # the file, reporting things added and removed. This is used to report, for
98 # example, added and removed warnings. This returns a pair (added, removed)
102 my @Others = GetDir $Suffix;
103 if (@Others == 0) { # No other files? We added all entries...
104 return (`cat $WebDir/$DATE$Suffix`, "");
106 # Diff the files now...
107 my @Diffs = split "\n", `diff $WebDir/$DATE$Suffix $WebDir/$Others[0]`;
108 my $Added = join "\n", grep /^</, @Diffs;
109 my $Removed = join "\n", grep /^>/, @Diffs;
111 $Removed =~ s/^> //gm;
112 return ($Added, $Removed);
115 # FormatTime - Convert a time from 1m23.45 into 83.45
118 if ($Time =~ m/([0-9]+)m([0-9.]+)/) {
119 $Time = sprintf("%7.4f", $1*60.0+$2);
125 # Command line argument settings...
129 my $NOREGRESSIONS = 0;
131 my $NORUNNINGTESTS = 0;
133 my $PROGTESTOPTS = "";
138 while (scalar(@ARGV) and ($_ = $ARGV[0], /^[-+]/)) {
140 last if /^--$/; # Stop processing arguments on --
142 # List command line options here...
143 if (/^-nocheckout$/) { $NOCHECKOUT = 1; next; }
144 if (/^-noremove$/) { $NOREMOVE = 1; next; }
145 if (/^-nofeaturetests$/) { $NOFEATURES = 1; next; }
146 if (/^-noregressiontests$/){ $NOREGRESSIONS = 1; next; }
147 if (/^-notest$/) { $NOTEST = 1; $NORUNNINGTESTS = 1; next; }
148 if (/^-norunningtests$/) { $NORUNNINGTESTS = 1; next; }
149 if (/^-parallel$/) { $MAKEOPTS = "-j2 -l3.0"; next; }
150 if (/^-enable-linscan$/) { $PROGTESTOPTS .= " ENABLE_LINEARSCAN=1"; next; }
151 if (/^-disable-codegen$/){ $PROGTESTOPTS .= " DISABLE_JIT=1 DISABLE_LLC=1"; next; }
152 if (/^-verbose$/) { $VERBOSE = 1; next; }
153 if (/^-debug$/) { $DEBUG = 1; next; }
155 print "Unknown option: $_ : ignoring!\n";
158 die "Must specify 0 or 3 options!" if (@ARGV != 0 and @ARGV != 3);
161 $CVSRootDir = $ARGV[0];
162 $BuildDir = $ARGV[1];
167 my $Template = "$BuildDir/llvm/utils/NightlyTestTemplate.html";
168 my $Prefix = "$WebDir/$DATE";
171 print "INITIALIZED\n";
172 print "CVS Root = $CVSRootDir\n";
173 print "BuildDir = $BuildDir\n";
174 print "WebDir = $WebDir\n";
175 print "Prefix = $Prefix\n";
180 # Create the CVS repository directory
185 system "rm -rf $BuildDir";
187 die "CVS checkout directory $BuildDir already exists!";
190 mkdir $BuildDir or die "Could not create CVS checkout directory $BuildDir!";
192 chdir $BuildDir or die "Could not change to CVS checkout directory $BuildDir!";
196 # Check out the llvm tree, saving CVS messages to the cvs log...
199 $CVSOPT = "-z3" if $CVSRootDir =~ /^:ext:/; # Use compression if going over ssh.
201 if ( $VERBOSE ) { print "CHECKOUT STAGE\n"; }
202 system "(time -p cvs $CVSOPT -d $CVSRootDir co llvm) > $Prefix-CVS-Log.txt 2>&1";
205 chdir "llvm" or die "Could not change into llvm directory!";
208 if ( $VERBOSE ) { print "UPDATE STAGE\n"; }
209 system "cvs update -P -d > /dev/null 2>&1" ;
212 # Read in the HTML template file...
213 my $TemplateContents = ReadFile $Template;
217 # Get some static statistics about the current state of CVS
219 my $CVSCheckoutTime = GetRegex "([0-9.]+)", `grep '^real' $Prefix-CVS-Log.txt`;
220 my $NumFilesInCVS = `egrep '^U' $Prefix-CVS-Log.txt | wc -l` + 0;
221 my $NumDirsInCVS = `egrep '^cvs (checkout|server|update):' $Prefix-CVS-Log.txt | wc -l` + 0;
222 $LOC = GetRegex "([0-9]+) +total", `wc -l \`utils/getsrcs.sh\` | grep total`;
225 # Build the entire tree, saving build messages to the build log
228 if ( $VERBOSE ) { print "CONFIGURE STAGE\n"; }
229 system "(time -p ./configure --enable-jit --enable-spec --with-objroot=.) > $Prefix-Build-Log.txt 2>&1";
231 if ( $VERBOSE ) { print "BUILD STAGE\n"; }
232 # Build the entire tree, capturing the output into $Prefix-Build-Log.txt
233 system "(time -p gmake $MAKEOPTS) >> $Prefix-Build-Log.txt 2>&1";
238 my ($Regex, $Num, $Regex2, $File) = @_;
239 my @Items = split "\n", `grep '$Regex' $File`;
240 return GetRegex $Regex2, $Items[$Num];
244 # Get some statistics about the build...
246 my @Linked = split '\n', `grep Linking $Prefix-Build-Log.txt`;
247 my $NumExecutables = scalar(grep(/executable/, @Linked));
248 my $NumLibraries = scalar(grep(!/executable/, @Linked));
249 my $NumObjects = `grep '^Compiling' $Prefix-Build-Log.txt | wc -l` + 0;
251 my $ConfigTimeU = GetRegexNum "^user", 0, "([0-9.]+)", "$Prefix-Build-Log.txt";
252 my $ConfigTimeS = GetRegexNum "^sys", 0, "([0-9.]+)", "$Prefix-Build-Log.txt";
253 my $ConfigTime = $ConfigTimeU+$ConfigTimeS; # ConfigTime = User+System
254 my $ConfigWallTime = GetRegexNum "^real", 0,"([0-9.]+)","$Prefix-Build-Log.txt";
256 my $BuildTimeU = GetRegexNum "^user", 1, "([0-9.]+)", "$Prefix-Build-Log.txt";
257 my $BuildTimeS = GetRegexNum "^sys", 1, "([0-9.]+)", "$Prefix-Build-Log.txt";
258 my $BuildTime = $BuildTimeU+$BuildTimeS; # BuildTime = User+System
259 my $BuildWallTime = GetRegexNum "^real", 1, "([0-9.]+)","$Prefix-Build-Log.txt";
262 if (`grep '^gmake[^:]*: .*Error' $Prefix-Build-Log.txt | wc -l` + 0 ||
263 `grep '^gmake: \*\*\*.*Stop.' $Prefix-Build-Log.txt | wc -l`+0) {
264 $BuildError = "<h3><font color='red'>Build error: compilation " .
265 "<a href=\"$DATE-Build-Log.txt\">aborted</a></font></h3>";
266 print "BUILD ERROR\n";
269 sub GetQMTestResults { # (filename)
273 $/ = "\n"; #Make sure we're going line at a time.
274 if (open SRCHFILE, $filename) {
275 # Skip stuff before ---TEST RESULTS
276 while ( <SRCHFILE> ) {
277 if ( m/^--- TEST RESULTS/ ) { last; }
279 # Process test results
280 push(@lines,"<h3>TEST RESULTS</h3><ol><li>\n");
282 my $should_break = 1;
283 while ( <SRCHFILE> ) {
284 if ( length($_) > 1 ) {
286 if ( ! m/: PASS[ ]*$/ &&
287 ! m/^ qmtest.target:/ &&
290 if ( m/: XFAIL/ || m/: XPASS/ || m/: FAIL/ ) {
294 push(@lines,"<b>$_</b><br/>\n");
296 push(@lines,"</li><li><b>$_</b><br/>\n");
298 } elsif ( m/^--- STATISTICS/ ) {
299 if ( $first_list ) { push(@lines,"<b>PERFECT!</b>"); }
300 push(@lines,"</li></ol><h3>STATISTICS</h3><pre>\n");
302 } elsif ( m/^--- TESTS WITH/ ) {
305 push(@lines,"</pre><h3>TESTS WITH UNEXPECTED RESULTS</h3><ol><li>\n");
306 } elsif ( m/^real / ) {
309 if ( $should_break ) {
310 push(@lines,"$_<br/>\n");
320 my $content = join("",@lines);
321 return "$content</pre>\n";
324 # Get results of feature tests.
325 my $FeatureTestResults; # String containing the results of the feature tests
326 my $FeatureTime; # System+CPU Time for feature tests
327 my $FeatureWallTime; # Wall Clock Time for feature tests
329 if ( $VERBOSE ) { print "FEATURE TEST STAGE\n"; }
330 my $feature_output = "$Prefix-FeatureTests-Log.txt";
332 # Run the feature tests so we can summarize the results
333 system "(time -p gmake -C test Feature.t) > $feature_output 2>&1";
335 # Extract test results
336 $FeatureTestResults = GetQMTestResults("$feature_output");
338 # Extract time of feature tests
339 my $FeatureTimeU = GetRegexNum "^user", 0, "([0-9.]+)", "$feature_output";
340 my $FeatureTimeS = GetRegexNum "^sys", 0, "([0-9.]+)", "$feature_output";
341 $FeatureTime = $FeatureTimeU+$FeatureTimeS; # FeatureTime = User+System
342 $FeatureWallTime = GetRegexNum "^real", 0,"([0-9.]+)","$feature_output";
343 # Run the regression tests so we can summarize the results
345 $FeatureTestResults = "Skipped by user choice.";
346 $FeatureTime = "0.0";
347 $FeatureWallTime = "0.0";
350 if (!$NOREGRESSIONS) {
351 if ( $VERBOSE ) { print "REGRESSION TEST STAGE\n"; }
352 my $regression_output = "$Prefix-RegressionTests-Log.txt";
354 # Run the regression tests so we can summarize the results
355 system "(time -p gmake -C test Regression.t) > $regression_output 2>&1";
357 # Extract test results
358 $RegressionTestResults = GetQMTestResults("$regression_output");
360 # Extract time of regressions tests
361 my $RegressionTimeU = GetRegexNum "^user", 0, "([0-9.]+)", "$regression_output";
362 my $RegressionTimeS = GetRegexNum "^sys", 0, "([0-9.]+)", "$regression_output";
363 $RegressionTime = $RegressionTimeU+$RegressionTimeS; # RegressionTime = User+System
364 $RegressionWallTime = GetRegexNum "^real", 0,"([0-9.]+)","$regression_output";
366 $RegressionTestResults = "Skipped by user choice.";
367 $RegressionTime = "0.0";
368 $RegressionWallTime = "0.0";
372 print $FeatureTestResults;
373 print $RegressionTestResults;
376 if ( $VERBOSE ) { print "BUILD INFORMATION COLLECTION STAGE\n"; }
378 # Get warnings from the build
380 my @Warn = split "\n", `egrep 'warning:|Entering dir' $Prefix-Build-Log.txt`;
384 foreach $Warning (@Warn) {
385 if ($Warning =~ m/Entering directory \`([^\`]+)\'/) {
386 $CurDir = $1; # Keep track of directory warning is in...
387 if ($CurDir =~ m#$BuildDir/llvm/(.*)#) { # Remove buildir prefix if included
391 push @Warnings, "$CurDir/$Warning"; # Add directory to warning...
394 my $WarningsFile = join "\n", @Warnings;
395 my $WarningsList = AddPreTag $WarningsFile;
396 $WarningsFile =~ s/:[0-9]+:/::/g;
398 # Emit the warnings file, so we can diff...
399 WriteFile "$WebDir/$DATE-Warnings.txt", $WarningsFile . "\n";
400 my ($WarningsAdded, $WarningsRemoved) = DiffFiles "-Warnings.txt";
402 # Output something to stdout if something has changed
403 print "ADDED WARNINGS:\n$WarningsAdded\n\n" if (length $WarningsAdded);
404 print "REMOVED WARNINGS:\n$WarningsRemoved\n\n" if (length $WarningsRemoved);
406 $WarningsAdded = AddPreTag $WarningsAdded;
407 $WarningsRemoved = AddPreTag $WarningsRemoved;
410 # Get some statistics about CVS commits over the current day...
412 if ($VERBOSE) { print "CVS HISTORY ANALYSIS STAGE\n"; }
413 @CVSHistory = split "\n", `cvs history -D '1 day ago' -a -xAMROCGUW`;
414 #print join "\n", @CVSHistory; print "\n";
416 # Extract some information from the CVS history... use a hash so no duplicate
418 my (%AddedFiles, %ModifiedFiles, %RemovedFiles, %UsersCommitted, %UsersUpdated);
420 my $DateRE = "[-:0-9 ]+\\+[0-9]+";
422 # Loop over every record from the CVS history, filling in the hashes.
423 foreach $File (@CVSHistory) {
424 my ($Type, $Date, $UID, $Rev, $Filename);
425 if ($File =~ /([AMRUGC]) ($DateRE) ([^ ]+) +([^ ]+) +([^ ]+) +([^ ]+)/) {
426 ($Type, $Date, $UID, $Rev, $Filename) = ($1, $2, $3, $4, "$6/$5");
427 } elsif ($File =~ /([W]) ($DateRE) ([^ ]+)/) {
428 ($Type, $Date, $UID, $Rev, $Filename) = ($1, $2, $3, "", "");
429 } elsif ($File =~ /([O]) ($DateRE) ([^ ]+) +([^ ]+)/) {
430 ($Type, $Date, $UID, $Rev, $Filename) = ($1, $2, $3, "", "$4/");
432 print "UNMATCHABLE: $File\n";
434 # print "$File\nTy = $Type Date = '$Date' UID=$UID Rev=$Rev File = '$Filename'\n";
436 if ($Filename =~ /^llvm/) {
437 if ($Type eq 'M') { # Modified
438 $ModifiedFiles{$Filename} = 1;
439 $UsersCommitted{$UID} = 1;
440 } elsif ($Type eq 'A') { # Added
441 $AddedFiles{$Filename} = 1;
442 $UsersCommitted{$UID} = 1;
443 } elsif ($Type eq 'R') { # Removed
444 $RemovedFiles{$Filename} = 1;
445 $UsersCommitted{$UID} = 1;
447 $UsersUpdated{$UID} = 1;
452 my $UserCommitList = join "\n", keys %UsersCommitted;
453 my $UserUpdateList = join "\n", keys %UsersUpdated;
454 my $AddedFilesList = AddPreTag join "\n", sort keys %AddedFiles;
455 my $ModifiedFilesList = AddPreTag join "\n", sort keys %ModifiedFiles;
456 my $RemovedFilesList = AddPreTag join "\n", sort keys %RemovedFiles;
459 my $SingleSourceProgramsTable;
460 my $MultiSourceProgramsTable;
461 my $ExternalProgramsTable;
467 chdir "test/Programs/$SubDir" or
468 die "Could not change into test/Programs/$SubDir testdir!";
470 # Run the programs tests... creating a report.nightly.html file
472 system "gmake -k $MAKEOPTS $PROGTESTOPTS report.nightly.html "
473 . "TEST=nightly > $Prefix-$SubDir-ProgramTest.txt 2>&1";
475 system "gunzip $Prefix-$SubDir-ProgramTest.txt.gz";
479 if (`grep '^gmake[^:]: .*Error' $Prefix-$SubDir-ProgramTest.txt | wc -l` + 0){
481 $ProgramsTable = "<font color=white><h2>Error running tests!</h2></font>";
482 print "ERROR TESTING\n";
483 } elsif (`grep '^gmake[^:]: .*No rule to make target' $Prefix-$SubDir-ProgramTest.txt | wc -l` + 0) {
486 "<font color=white><h2>Makefile error running tests!</h2></font>";
487 print "ERROR TESTING\n";
490 $ProgramsTable = ReadFile "report.nightly.html";
493 # Create a list of the tests which were run...
495 system "egrep 'TEST-(PASS|FAIL)' < $Prefix-$SubDir-ProgramTest.txt "
496 . "| sort > $Prefix-$SubDir-Tests.txt";
499 # Compress the test output
500 system "gzip -f $Prefix-$SubDir-ProgramTest.txt";
501 chdir "../../.." or die "Cannot return to parent directory!";
502 return $ProgramsTable;
505 # If we build the tree successfully, run the nightly programs tests...
506 if ($BuildError eq "") {
508 print "SingleSource TEST STAGE\n";
510 $SingleSourceProgramsTable = TestDirectory("SingleSource");
512 print "MultiSource TEST STAGE\n";
514 $MultiSourceProgramsTable = TestDirectory("MultiSource");
516 print "External TEST STAGE\n";
518 $ExternalProgramsTable = TestDirectory("External");
519 system "cat $Prefix-SingleSource-Tests.txt $Prefix-MultiSource-Tests.txt ".
520 " $Prefix-External-Tests.txt | sort > $Prefix-Tests.txt";
524 print "TEST INFORMATION COLLECTION STAGE\n";
526 my ($TestsAdded, $TestsRemoved, $TestsFixed, $TestsBroken) = ("","","","");
529 $TestsAdded = "<b>error testing</b><br>";
530 $TestsRemoved = "<b>error testing</b><br>";
531 $TestsFixed = "<b>error testing</b><br>";
532 $TestsBroken = "<b>error testing</b><br>";
534 my ($RTestsAdded, $RTestsRemoved) = DiffFiles "-Tests.txt";
536 my @RawTestsAddedArray = split '\n', $RTestsAdded;
537 my @RawTestsRemovedArray = split '\n', $RTestsRemoved;
539 my %OldTests = map {GetRegex('TEST-....: (.+)', $_)=>$_}
540 @RawTestsRemovedArray;
541 my %NewTests = map {GetRegex('TEST-....: (.+)', $_)=>$_}
544 foreach $Test (keys %NewTests) {
545 if (!exists $OldTests{$Test}) { # TestAdded if in New but not old
546 $TestsAdded = "$TestsAdded$Test\n";
548 if ($OldTests{$Test} =~ /TEST-PASS/) { # Was the old one a pass?
549 $TestsBroken = "$TestsBroken$Test\n"; # New one must be a failure
551 $TestsFixed = "$TestsFixed$Test\n"; # No, new one is a pass.
555 foreach $Test (keys %OldTests) { # TestRemoved if in Old but not New
556 $TestsRemoved = "$TestsRemoved$Test\n" if (!exists $NewTests{$Test});
559 print "\nTESTS ADDED: \n\n$TestsAdded\n\n" if (length $TestsAdded);
560 print "\nTESTS REMOVED:\n\n$TestsRemoved\n\n" if (length $TestsRemoved);
561 print "\nTESTS FIXED: \n\n$TestsFixed\n\n" if (length $TestsFixed);
562 print "\nTESTS BROKEN: \n\n$TestsBroken\n\n" if (length $TestsBroken);
564 $TestsAdded = AddPreTag $TestsAdded;
565 $TestsRemoved = AddPreTag $TestsRemoved;
566 $TestsFixed = AddPreTag $TestsFixed;
567 $TestsBroken = AddPreTag $TestsBroken;
571 # If we built the tree successfully, runs of the Olden suite with
572 # LARGE_PROBLEM_SIZE on so that we can get some "running" statistics.
573 if ($BuildError eq "") {
574 my ($NATTime, $CBETime, $LLCTime, $JITTime, $OptTime, $BytecodeSize,
575 $MachCodeSize) = ("","","","","","","");
576 if (!$NORUNNINGTESTS) {
577 chdir "test/Programs/MultiSource/Benchmarks/Olden" or die "Olden tests moved?";
579 # Clean out previous results...
580 system "gmake $MAKEOPTS clean > /dev/null 2>&1";
582 # Run the nightly test in this directory, with LARGE_PROBLEM_SIZE enabled!
583 system "gmake -k $MAKEOPTS report.nightly.raw.out TEST=nightly " .
584 " LARGE_PROBLEM_SIZE=1 > /dev/null 2>&1";
585 system "cp report.nightly.raw.out $Prefix-Olden-tests.txt";
587 system "gunzip $Prefix-Olden-tests.txt.gz";
590 # Now we know we have $Prefix-Olden-tests.txt as the raw output file. Split
591 # it up into records and read the useful information.
592 my @Records = split />>> ========= /, ReadFile "$Prefix-Olden-tests.txt";
593 shift @Records; # Delete the first (garbage) record
595 # Loop over all of the records, summarizing them into rows for the running
597 my $WallTimeRE = "[A-Za-z0-9.: ]+\\(([0-9.]+) wall clock";
598 foreach $Rec (@Records) {
599 my $rNATTime = GetRegex 'TEST-RESULT-nat-time: real\s*([.0-9m]+)', $Rec;
600 my $rCBETime = GetRegex 'TEST-RESULT-cbe-time: real\s*([.0-9m]+)', $Rec;
601 my $rLLCTime = GetRegex 'TEST-RESULT-llc-time: real\s*([.0-9m]+)', $Rec;
602 my $rJITTime = GetRegex 'TEST-RESULT-jit-time: real\s*([.0-9m]+)', $Rec;
603 my $rOptTime = GetRegex "TEST-RESULT-compile: $WallTimeRE", $Rec;
604 my $rBytecodeSize = GetRegex 'TEST-RESULT-compile: *([0-9]+)', $Rec;
605 my $rMachCodeSize = GetRegex 'TEST-RESULT-jit-machcode: *([0-9]+).*bytes of machine code', $Rec;
607 $NATTime .= " " . FormatTime($rNATTime);
608 $CBETime .= " " . FormatTime($rCBETime);
609 $LLCTime .= " " . FormatTime($rLLCTime);
610 $JITTime .= " " . FormatTime($rJITTime);
611 $OptTime .= " $rOptTime";
612 $BytecodeSize .= " $rBytecodeSize";
613 $MachCodeSize .= " $rMachCodeSize";
616 # Now that we have all of the numbers we want, add them to the running totals
618 AddRecord($NATTime, "running_Olden_nat_time.txt");
619 AddRecord($CBETime, "running_Olden_cbe_time.txt");
620 AddRecord($LLCTime, "running_Olden_llc_time.txt");
621 AddRecord($JITTime, "running_Olden_jit_time.txt");
622 AddRecord($OptTime, "running_Olden_opt_time.txt");
623 AddRecord($BytecodeSize, "running_Olden_bytecode.txt");
624 AddRecord($MachCodeSize, "running_Olden_machcode.txt");
626 system "gzip -f $Prefix-Olden-tests.txt";
633 # Get a list of the previous days that we can link to...
635 my @PrevDays = map {s/.html//; $_} GetDir ".html";
637 splice @PrevDays, 20; # Trim down list to something reasonable...
639 my $PrevDaysList = # Format list for sidebar
640 join "\n ", map { "<a href=\"$_.html\">$_</a><br>" } @PrevDays;
643 # Start outputing files into the web directory
645 chdir $WebDir or die "Could not change into web directory!";
647 # Add information to the files which accumulate information for graphs...
648 AddRecord($LOC, "running_loc.txt");
649 AddRecord($BuildTime, "running_build_time.txt");
652 print "GRAPH GENERATION STAGE\n";
655 # Rebuild the graphs now...
657 $GNUPLOT = "/usr/dcs/software/supported/bin/gnuplot";
658 $GNUPLOT = "gnuplot" if ! -x $GNUPLOT;
659 $PlotScriptFilename = "$BuildDir/llvm/utils/NightlyTest.gnuplot";
660 system ($GNUPLOT, $PlotScriptFilename);
663 # Remove the cvs tree...
665 system "rm -rf $BuildDir" if (!$NOCHECKOUT and !$NOREMOVE);
668 # Print out information...
671 print "DateString: $DateString\n";
672 print "CVS Checkout: $CVSCheckoutTime seconds\n";
673 print "Files/Dirs/LOC in CVS: $NumFilesInCVS/$NumDirsInCVS/$LOC\n";
674 print "Build Time: $BuildTime seconds\n";
675 print "Feature Test Time: $FeatureTime seconds\n";
676 print "Regression Test Time: $RegressionTime seconds\n";
677 print "Libraries/Executables/Objects built: $NumLibraries/$NumExecutables/$NumObjects\n";
679 print "WARNINGS:\n $WarningsList\n";
681 print "Users committed: $UserCommitList\n";
682 print "Added Files: \n $AddedFilesList\n";
683 print "Modified Files: \n $ModifiedFilesList\n";
684 print "Removed Files: \n $RemovedFilesList\n";
686 print "Previous Days =\n $PrevDaysList\n";
691 # Output the files...
695 print "OUTPUT STAGE\n";
699 eval "\$Output = <<ENDOFFILE;$TemplateContents\nENDOFFILE\n";
700 WriteFile "$DATE.html", $Output;
702 # Change the index.html symlink...
703 system "ln -sf $DATE.html index.html";
706 my ($Val, $Filename) = @_;
708 if (open FILE, "$WebDir/$Filename") {
709 @Records = grep !/$DATE/, split "\n", <FILE>;
712 push @Records, "$DATE: $Val";
713 WriteFile "$WebDir/$Filename", (join "\n", @Records) . "\n";