[llvm-commits] CVS: llvm/utils/NewNightlyTest.pl

Reid Spencer reid at x10sys.com
Sun Aug 13 02:53:18 PDT 2006



Changes in directory llvm/utils:

NewNightlyTest.pl updated: 1.48 -> 1.49
---
Log message:

Changes for LLVM coding standard compliance:
  1. Remove tabs
  2. Wrap to 80 columns
  3. Put spaces between "if" or "elsif" and expression
  4. Put { on same line as if statement.
  5. Make indentation be 2 spaces.
Functionality change:
  Run utils/countloc.sh after the build is done. This is necessary because
  that script now uses llvm-config to find the top src directory.


---
Diffs of the changes:  (+491 -508)

 NewNightlyTest.pl |  999 ++++++++++++++++++++++++++----------------------------
 1 files changed, 491 insertions(+), 508 deletions(-)


Index: llvm/utils/NewNightlyTest.pl
diff -u llvm/utils/NewNightlyTest.pl:1.48 llvm/utils/NewNightlyTest.pl:1.49
--- llvm/utils/NewNightlyTest.pl:1.48	Fri Aug 11 18:02:09 2006
+++ llvm/utils/NewNightlyTest.pl	Sun Aug 13 04:53:02 2006
@@ -9,7 +9,7 @@
 # Synopsis: Perform a series of tests which are designed to be run nightly.
 #           This is used to keep track of the status of the LLVM tree, tracking
 #           regressions and performance changes. Submits this information 
-#           to llvm.org where it is placed into the nightlytestresults database. 
+#           to llvm.org where it is placed into the nightlytestresults database.
 #
 # Modified heavily by Patrick Jenkins, July 2006
 #
@@ -88,16 +88,13 @@
 # Getting environment variables
 #
 ##############################################################
-my $HOME = $ENV{'HOME'};
+my $HOME       = $ENV{'HOME'};
 my $CVSRootDir = $ENV{'CVSROOT'};
-   $CVSRootDir = "/home/vadve/shared/PublicCVS"
-    unless $CVSRootDir;
+$CVSRootDir    = "/home/vadve/shared/PublicCVS" unless $CVSRootDir;
 my $BuildDir   = $ENV{'BUILDDIR'};
-   $BuildDir   = "$HOME/buildtest"
-    unless $BuildDir;
+$BuildDir      = "$HOME/buildtest" unless $BuildDir;
 my $WebDir     = $ENV{'WEBDIR'};
-   $WebDir     = "$HOME/cvs/testresults-X86"
-    unless $WebDir;
+$WebDir        = "$HOME/cvs/testresults-X86" unless $WebDir;
 
 ##############################################################
 #
@@ -123,114 +120,94 @@
 $SUBMITSCRIPT = "/nightlytest/NightlyTestAccept.cgi";
 
 while (scalar(@ARGV) and ($_ = $ARGV[0], /^[-+]/)) {
-    shift;
-    last if /^--$/;  # Stop processing arguments on --
+  shift;
+  last if /^--$/;  # Stop processing arguments on --
 
   # List command line options here...
-    if (/^-nocheckout$/)     { $NOCHECKOUT = 1; next; }
-    if (/^-nocvsstats$/)     { $NOCVSSTATS = 1; next; }
-    if (/^-noremove$/)       { $NOREMOVE = 1; next; }
-    if (/^-noremoveresults$/) { $NOREMOVERESULTS = 1; next; }
-    if (/^-notest$/)         { $NOTEST = 1; $NORUNNINGTESTS = 1; next; }
-    if (/^-norunningtests$/) { $NORUNNINGTESTS = 1; next; }
-    if (/^-parallel$/)       { $MAKEOPTS = "$MAKEOPTS -j2 -l3.0"; next; }
-    if (/^-release$/)        { $MAKEOPTS = "$MAKEOPTS ENABLE_OPTIMIZED=1 ".
-    						   						             "OPTIMIZE_OPTION=-O2"; 
-    						               $BUILDTYPE="release"; next; }
-    if (/^-enable-llcbeta$/) { $PROGTESTOPTS .= " ENABLE_LLCBETA=1"; next; }
-    if (/^-disable-llc$/)    { $PROGTESTOPTS .= " DISABLE_LLC=1";
-			       $CONFIGUREARGS .= " --disable-llc_diffs"; next; } 
-    if (/^-disable-jit$/)    { $PROGTESTOPTS .= " DISABLE_JIT=1";
-			       $CONFIGUREARGS .= " --disable-jit"; next; }
-    if (/^-disable-cbe$/)    { $PROGTESTOPTS .= " DISABLE_CBE=1"; next; }
-    if (/^-verbose$/)        { $VERBOSE = 1; next; }
-    if (/^-debug$/)          { $DEBUG = 1; next; }
-    if (/^-nice$/)           { $NICE = "nice "; next; }
-    if (/^-f2c$/)            {
-	$CONFIGUREARGS .= " --with-f2c=$ARGV[0]"; shift; next;
-    }
-    if (/^-with-externals$/)  {
-	$CONFIGUREARGS .= " --with-externals=$ARGV[0]"; shift; next;
-    }
-    if (/^-submit-server/)  {
-	$SUBMITSERVER = "$ARGV[0]"; shift; next;
-    }
-    if (/^-submit-script/)  {
-	$SUBMITSCRIPT = "$ARGV[0]"; shift; next;
-    }
-    if (/^-nickname$/)   	{ $nickname = "$ARGV[0]"; shift; next; }
-    if (/^-gccpath/)         { $CONFIGUREARGS .= 
-    													   " CC=$ARGV[0]/gcc CXX=$ARGV[0]/g++"; 
-                               $GCCPATH=$ARGV[0]; 
-                               shift;  
-                               next;}
-    else{ $GCCPATH=""; }
-    if (/^-cvstag/)          { $CVSCOOPT .= " -r $ARGV[0]"; shift; next; } 
-    else{ $CVSCOOPT="";}
-    if (/^-target/)          {
-	$CONFIGUREARGS .= " --target=$ARGV[0]"; shift; next;
-    }
-    if (/^-cflags/)          {
-	$MAKEOPTS = "$MAKEOPTS C.Flags=\'$ARGV[0]\'"; shift; next;
-    }
-    if (/^-cxxflags/)        {
-	$MAKEOPTS = "$MAKEOPTS CXX.Flags=\'$ARGV[0]\'"; shift; next;
-    }
-    if (/^-ldflags/)         {
-	$MAKEOPTS = "$MAKEOPTS LD.Flags=\'$ARGV[0]\'"; shift; next;
-    }
-    if (/^-compileflags/)    {
-	$MAKEOPTS = "$MAKEOPTS $ARGV[0]"; shift; next;
-    }
-    if (/^-use-gmake/)    {
-			$MAKECMD = "gmake"; shift; next;
-    }
-    if (/^-compileflags/)    {
-        $MAKEOPTS = "$MAKEOPTS $ARGV[0]"; shift; next;
-    }
-    if (/^-extraflags/)      {
-        $CONFIGUREARGS .= " --with-extra-options=\'$ARGV[0]\'"; shift; next;
-    }
-    if (/^-noexternals$/)    { $NOEXTERNALS = 1; next; }
-    if (/^-nodejagnu$/)      { $NODEJAGNU = 1; next; }
-    if (/^-nobuild$/)        { $NOBUILD = 1; next; }
-    print "Unknown option: $_ : ignoring!\n";
+  if (/^-nocheckout$/)     { $NOCHECKOUT = 1; next; }
+  if (/^-nocvsstats$/)     { $NOCVSSTATS = 1; next; }
+  if (/^-noremove$/)       { $NOREMOVE = 1; next; }
+  if (/^-noremoveresults$/){ $NOREMOVERESULTS = 1; next; }
+  if (/^-notest$/)         { $NOTEST = 1; $NORUNNINGTESTS = 1; next; }
+  if (/^-norunningtests$/) { $NORUNNINGTESTS = 1; next; }
+  if (/^-parallel$/)       { $MAKEOPTS = "$MAKEOPTS -j2 -l3.0"; next; }
+  if (/^-release$/)        { $MAKEOPTS = "$MAKEOPTS ENABLE_OPTIMIZED=1 ".
+                             "OPTIMIZE_OPTION=-O2"; $BUILDTYPE="release"; next;}
+  if (/^-enable-llcbeta$/) { $PROGTESTOPTS .= " ENABLE_LLCBETA=1"; next; }
+  if (/^-disable-llc$/)    { $PROGTESTOPTS .= " DISABLE_LLC=1";
+                             $CONFIGUREARGS .= " --disable-llc_diffs"; next; } 
+  if (/^-disable-jit$/)    { $PROGTESTOPTS .= " DISABLE_JIT=1";
+                             $CONFIGUREARGS .= " --disable-jit"; next; }
+  if (/^-disable-cbe$/)    { $PROGTESTOPTS .= " DISABLE_CBE=1"; next; }
+  if (/^-verbose$/)        { $VERBOSE = 1; next; }
+  if (/^-debug$/)          { $DEBUG = 1; next; }
+  if (/^-nice$/)           { $NICE = "nice "; next; }
+  if (/^-f2c$/)            { $CONFIGUREARGS .= " --with-f2c=$ARGV[0]"; 
+                             shift; next; }
+  if (/^-with-externals$/) { $CONFIGUREARGS .= " --with-externals=$ARGV[0]"; 
+                             shift; next; }
+  if (/^-submit-server/)   { $SUBMITSERVER = "$ARGV[0]"; shift; next; }
+  if (/^-submit-script/)   { $SUBMITSCRIPT = "$ARGV[0]"; shift; next; }
+  if (/^-nickname$/)       { $nickname = "$ARGV[0]"; shift; next; } 
+  if (/^-gccpath/)         { $CONFIGUREARGS .= 
+                             " CC=$ARGV[0]/gcc CXX=$ARGV[0]/g++"; 
+                             $GCCPATH=$ARGV[0]; shift;  next; }
+  else                     { $GCCPATH=""; }
+  if (/^-cvstag/)          { $CVSCOOPT .= " -r $ARGV[0]"; shift; next; } 
+  else                     { $CVSCOOPT="";}
+  if (/^-target/)          { $CONFIGUREARGS .= " --target=$ARGV[0]"; 
+                             shift; next; }
+  if (/^-cflags/)          { $MAKEOPTS = "$MAKEOPTS C.Flags=\'$ARGV[0]\'"; 
+                             shift; next; }
+  if (/^-cxxflags/)        { $MAKEOPTS = "$MAKEOPTS CXX.Flags=\'$ARGV[0]\'"; 
+                             shift; next; }
+  if (/^-ldflags/)         { $MAKEOPTS = "$MAKEOPTS LD.Flags=\'$ARGV[0]\'"; 
+                             shift; next; }
+  if (/^-compileflags/)    { $MAKEOPTS = "$MAKEOPTS $ARGV[0]"; shift; next; }
+  if (/^-use-gmake/)       { $MAKECMD = "gmake"; shift; next; }
+  if (/^-compileflags/)    { $MAKEOPTS = "$MAKEOPTS $ARGV[0]"; shift; next; }
+  if (/^-extraflags/)      { $CONFIGUREARGS .= 
+                             " --with-extra-options=\'$ARGV[0]\'"; shift; next;}
+  if (/^-noexternals$/)    { $NOEXTERNALS = 1; next; }
+  if (/^-nodejagnu$/)      { $NODEJAGNU = 1; next; }
+  if (/^-nobuild$/)        { $NOBUILD = 1; next; }
+  print "Unknown option: $_ : ignoring!\n";
 }
 
 if ($ENV{'LLVMGCCDIR'}) {
-    $CONFIGUREARGS .= " --with-llvmgccdir=" . $ENV{'LLVMGCCDIR'};
+  $CONFIGUREARGS .= " --with-llvmgccdir=" . $ENV{'LLVMGCCDIR'};
 }
 if ($CONFIGUREARGS !~ /--disable-jit/) {
-    $CONFIGUREARGS .= " --enable-jit";
+  $CONFIGUREARGS .= " --enable-jit";
 }
 
-
-if (@ARGV != 0 and @ARGV != 3 and $VERBOSE){
-	foreach $x (@ARGV){
-		print "$x\n";
-	}
-	print "Must specify 0 or 3 options!";
+if (@ARGV != 0 and @ARGV != 3 and $VERBOSE) {
+  foreach $x (@ARGV) {
+    print "$x\n";
+  }
+  print "Must specify 0 or 3 options!";
 }
 
 if (@ARGV == 3) {
-    $CVSRootDir = $ARGV[0];
-    $BuildDir   = $ARGV[1];
-    $WebDir     = $ARGV[2];
+  $CVSRootDir = $ARGV[0];
+  $BuildDir   = $ARGV[1];
+  $WebDir     = $ARGV[2];
 }
 
-if($CVSRootDir eq "" or
-   $BuildDir   eq "" or
-   $WebDir     eq ""){
-   die("please specify a cvs root directory, a build directory, and a ".
+if ($CVSRootDir eq "" or
+    $BuildDir   eq "" or
+    $WebDir     eq "") {
+  die("please specify a cvs root directory, a build directory, and a ".
        "web directory");
  }
  
-if($nickname eq ""){
-	die ("Please invoke NewNightlyTest.pl with command line option \"-nickname <nickname>\"");
+if ($nickname eq "") {
+  die ("Please invoke NewNightlyTest.pl with command line option " . 
+       "\"-nickname <nickname>\"");
 }
 
-if($BUILDTYPE ne "release"){
-	$BUILDTYPE = "debug";
+if ($BUILDTYPE ne "release") {
+  $BUILDTYPE = "debug";
 }
 
 ##############################################################
@@ -249,18 +226,18 @@
 my $DejagnuSum = "$Prefix-Dejagnu-testrun.sum";
 my $DejagnuTestsLog = "$Prefix-DejagnuTests-Log.txt";
 if (! -d $WebDir) {
-    mkdir $WebDir, 0777;
-    warn "$WebDir did not exist; creating it.\n";
+  mkdir $WebDir, 0777;
+  warn "$WebDir did not exist; creating it.\n";
 }
 
 if ($VERBOSE) {
-    print "INITIALIZED\n";
-    print "CVS Root = $CVSRootDir\n";
-    print "BuildDir = $BuildDir\n";
-    print "WebDir   = $WebDir\n";
-    print "Prefix   = $Prefix\n";
-    print "CVSLog   = $CVSLog\n";
-    print "BuildLog = $BuildLog\n";
+  print "INITIALIZED\n";
+  print "CVS Root = $CVSRootDir\n";
+  print "BuildDir = $BuildDir\n";
+  print "WebDir   = $WebDir\n";
+  print "Prefix   = $Prefix\n";
+  print "CVSLog   = $CVSLog\n";
+  print "BuildLog = $BuildLog\n";
 }
 
 ##############################################################
@@ -269,11 +246,11 @@
 #
 ##############################################################
 sub GetDir {
-    my $Suffix = shift;
-    opendir DH, $WebDir;
-    my @Result = reverse sort grep !/$DATE/, grep /[-0-9]+$Suffix/, readdir DH;
-    closedir DH;
-    return @Result;
+  my $Suffix = shift;
+  opendir DH, $WebDir;
+  my @Result = reverse sort grep !/$DATE/, grep /[-0-9]+$Suffix/, readdir DH;
+  closedir DH;
+  return @Result;
 }
 
 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -284,95 +261,94 @@
 #
 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 sub DiffFiles {
-    my $Suffix = shift;
-    my @Others = GetDir $Suffix;
-    if (@Others == 0) {  # No other files?  We added all entries...
-	return (`cat $WebDir/$DATE$Suffix`, "");
-    }
-  # Diff the files now...
-    my @Diffs = split "\n", `diff $WebDir/$DATE$Suffix $WebDir/$Others[0]`;
-    my $Added   = join "\n", grep /^</, @Diffs;
-    my $Removed = join "\n", grep /^>/, @Diffs;
-    $Added =~ s/^< //gm;
-    $Removed =~ s/^> //gm;
-    return ($Added, $Removed);
+  my $Suffix = shift;
+  my @Others = GetDir $Suffix;
+  if (@Others == 0) {  # No other files?  We added all entries...
+    return (`cat $WebDir/$DATE$Suffix`, "");
+  }
+# Diff the files now...
+  my @Diffs = split "\n", `diff $WebDir/$DATE$Suffix $WebDir/$Others[0]`;
+  my $Added   = join "\n", grep /^</, @Diffs;
+  my $Removed = join "\n", grep /^>/, @Diffs;
+  $Added =~ s/^< //gm;
+  $Removed =~ s/^> //gm;
+  return ($Added, $Removed);
 }
 
 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 sub GetRegex {   # (Regex with ()'s, value)
-    $_[1] =~ /$_[0]/m;
-    if (defined($1)) {
-	return $1;
-    }
-    return "0";
+  $_[1] =~ /$_[0]/m;
+  return $1 
+    if (defined($1));
+  return "0";
 }
 
 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 sub GetRegexNum {
-    my ($Regex, $Num, $Regex2, $File) = @_;
-    my @Items = split "\n", `grep '$Regex' $File`;
-    return GetRegex $Regex2, $Items[$Num];
+  my ($Regex, $Num, $Regex2, $File) = @_;
+  my @Items = split "\n", `grep '$Regex' $File`;
+  return GetRegex $Regex2, $Items[$Num];
 }
 
 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 sub ChangeDir { # directory, logical name
-    my ($dir,$name) = @_;
-    chomp($dir);
-    if ( $VERBOSE ) { print "Changing To: $name ($dir)\n"; }
-    $result = chdir($dir);
-    if(!$result){
-    	print "ERROR!!! Cannot change directory to: $name ($dir) because $!"; 
-    	return false;
-    }
-    return true;
+  my ($dir,$name) = @_;
+  chomp($dir);
+  if ( $VERBOSE ) { print "Changing To: $name ($dir)\n"; }
+  $result = chdir($dir);
+  if (!$result) {
+    print "ERROR!!! Cannot change directory to: $name ($dir) because $!"; 
+    return false;
+  }
+  return true;
 }
 
 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 sub ReadFile {
-    if (open (FILE, $_[0])) {
-	undef $/;
-	my $Ret = <FILE>;
-	close FILE;
-	$/ = '\n';
-	return $Ret;
-    } else {
-	print "Could not open file '$_[0]' for reading!\n";
-	return "";
-    }
+  if (open (FILE, $_[0])) {
+    undef $/;
+    my $Ret = <FILE>;
+    close FILE;
+    $/ = '\n';
+    return $Ret;
+  } else {
+    print "Could not open file '$_[0]' for reading!\n";
+    return "";
+  }
 }
 
 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 sub WriteFile {  # (filename, contents)
-    open (FILE, ">$_[0]") or die "Could not open file '$_[0]' for writing!\n";
-    print FILE $_[1];
-    close FILE;
+  open (FILE, ">$_[0]") or die "Could not open file '$_[0]' for writing!\n";
+  print FILE $_[1];
+  close FILE;
 }
 
 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 sub CopyFile { #filename, newfile
-    my ($file, $newfile) = @_;
-    chomp($file);
-    if ($VERBOSE) { print "Copying $file to $newfile\n"; }
-    copy($file, $newfile);
+  my ($file, $newfile) = @_;
+  chomp($file);
+  if ($VERBOSE) { print "Copying $file to $newfile\n"; }
+  copy($file, $newfile);
 }
 
 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 sub AddRecord {
-    my ($Val, $Filename,$WebDir) = @_;
-    my @Records;
-    if (open FILE, "$WebDir/$Filename") {
-	@Records = grep !/$DATE/, split "\n", <FILE>;
-	close FILE;
-    }
-    push @Records, "$DATE: $Val";
-    WriteFile "$WebDir/$Filename", (join "\n", @Records) . "\n";
+  my ($Val, $Filename,$WebDir) = @_;
+  my @Records;
+  if (open FILE, "$WebDir/$Filename") {
+    @Records = grep !/$DATE/, split "\n", <FILE>;
+    close FILE;
+  }
+  push @Records, "$DATE: $Val";
+  WriteFile "$WebDir/$Filename", (join "\n", @Records) . "\n";
 }
 
 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -381,69 +357,69 @@
 #
 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 sub FormatTime {
-    my $Time = shift;
-    if ($Time =~ m/([0-9]+)m([0-9.]+)/) {
-	$Time = sprintf("%7.4f", $1*60.0+$2);
-    }
-    return $Time;
+  my $Time = shift;
+  if ($Time =~ m/([0-9]+)m([0-9.]+)/) {
+    $Time = sprintf("%7.4f", $1*60.0+$2);
+  }
+  return $Time;
 }
 
 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 sub GetDejagnuTestResults { # (filename, log)
-    my ($filename, $DejagnuLog) = @_;
-    my @lines;
-    my $firstline;
-    $/ = "\n"; #Make sure we're going line at a time.
-
-    if( $VERBOSE) { print "DEJAGNU TEST RESULTS:\n"; }
-
-    if (open SRCHFILE, $filename) {
-    # Process test results
-	my $first_list = 1;
-	my $should_break = 1;
-	my $nocopy = 0;
-	my $readingsum = 0;
-	while ( <SRCHFILE> ) {
-	    if ( length($_) > 1 ) {
-		chomp($_);
-		if ( m/^XPASS:/ || m/^FAIL:/ ) {
-		    $nocopy = 0;
-		    if ( $first_list ) {
-			push(@lines, "UNEXPECTED TEST RESULTS\n");
-			$first_list = 0;
-			$should_break = 1;
-			push(@lines, "$_\n");
-			if( $VERBOSE) { print "  $_\n"; }
-		    } else {
-			push(@lines, "$_\n");
-			if( $VERBOSE) { print "  $_\n"; }
-		    }
-		} #elsif ( m/Summary/ ) {
-		#    if ( $first_list ) {
-		#	push(@lines, "PERFECT!");
-		#	print "  PERFECT!\n";
-		#    } else {
-		#	push(@lines, "</li></ol>\n");
-		#    }
-		#    push(@lines, "STATISTICS\n");
-		#    print "\nDEJAGNU STATISTICS:\n";
-		#    $should_break = 0;
-		#    $nocopy = 0;
-		#    $readingsum = 1;
-		#} 
-		elsif ( $readingsum ) {
-		    push(@lines,"$_\n");
-		    if( $VERBOSE) { print "  $_\n"; }
-		}
+  my ($filename, $DejagnuLog) = @_;
+  my @lines;
+  my $firstline;
+  $/ = "\n"; #Make sure we're going line at a time.
+
+  if( $VERBOSE) { print "DEJAGNU TEST RESULTS:\n"; }
+
+  if (open SRCHFILE, $filename) {
+# Process test results
+    my $first_list = 1;
+    my $should_break = 1;
+    my $nocopy = 0;
+    my $readingsum = 0;
+    while ( <SRCHFILE> ) {
+        if ( length($_) > 1 ) {
+            chomp($_);
+            if ( m/^XPASS:/ || m/^FAIL:/ ) {
+                $nocopy = 0;
+                if ( $first_list ) {
+                    push(@lines, "UNEXPECTED TEST RESULTS\n");
+                    $first_list = 0;
+                    $should_break = 1;
+                    push(@lines, "$_\n");
+                    if( $VERBOSE) { print "  $_\n"; }
+                } else {
+                    push(@lines, "$_\n");
+                    if( $VERBOSE) { print "  $_\n"; }
+                }
+            } #elsif ( m/Summary/ ) {
+            #    if ( $first_list ) {
+            #   push(@lines, "PERFECT!");
+            #   print "  PERFECT!\n";
+            #    } else {
+            #   push(@lines, "</li></ol>\n");
+            #    }
+            #    push(@lines, "STATISTICS\n");
+            #    print "\nDEJAGNU STATISTICS:\n";
+            #    $should_break = 0;
+            #    $nocopy = 0;
+            #    $readingsum = 1;
+            #} 
+            elsif ( $readingsum ) {
+                push(@lines,"$_\n");
+                if( $VERBOSE) { print "  $_\n"; }
+            }
 
-	    }
-	}
+        }
     }
-    close SRCHFILE;
+  }
+  close SRCHFILE;
 
-    my $content = join("", @lines);
-    return $content;
+  my $content = join("", @lines);
+  return $content;
 }
 
 
@@ -461,7 +437,7 @@
     $port=80;
     $socketaddr= sockaddr_in $port, inet_aton $host or die "Bad hostname\n";
     socket SOCK, PF_INET, SOCK_STREAM, getprotobyname('tcp') or 
-    			 die "Bad socket\n";
+      die "Bad socket\n";
     connect SOCK, $socketaddr or die "Bad connection\n";
     select((select(SOCK), $| = 1)[0]);
 
@@ -511,17 +487,17 @@
 #
 ##############################################################
 if (!$NOCHECKOUT) {
-    if (-d $BuildDir) {
-	if (!$NOREMOVE) {
-		if ( $VERBOSE ){
-			print "Build directory exists! Removing it\n";
-		}
-	    system "rm -rf $BuildDir";
-	} else {
-	    die "CVS checkout directory $BuildDir already exists!";
-	}
+  if (-d $BuildDir) {
+    if (!$NOREMOVE) {
+      if ( $VERBOSE ) {
+        print "Build directory exists! Removing it\n";
+      }
+      system "rm -rf $BuildDir";
+    } else {
+       die "CVS checkout directory $BuildDir already exists!";
     }
-    mkdir $BuildDir or die "Could not create CVS checkout directory $BuildDir!";
+  }
+  mkdir $BuildDir or die "Could not create CVS checkout directory $BuildDir!";
 }
 ChangeDir( $BuildDir, "CVS checkout directory" );
 
@@ -533,22 +509,23 @@
 ##############################################################
 my $CVSOPT = "";
 # Use compression if going over ssh.
-$CVSOPT = "-z3" if $CVSRootDir =~ /^:ext:/;
+$CVSOPT = "-z3" 
+  if $CVSRootDir =~ /^:ext:/;
 my $CVSCMD = "$NICE cvs $CVSOPT -d $CVSRootDir co $CVSCOOPT";
 if (!$NOCHECKOUT) {
-    if ( $VERBOSE ) 
-    { 
-	print "CHECKOUT STAGE:\n"; 
-	print "( time -p $CVSCMD llvm; cd llvm/projects ; $CVSCMD llvm-test ) > $CVSLog 2>&1\n";
-    }
-    system "( time -p $CVSCMD llvm; cd llvm/projects ; " .
-	"$CVSCMD llvm-test ) > $CVSLog 2>&1";
-    ChangeDir( $BuildDir , "CVS Checkout directory") ;
+  if ( $VERBOSE ) { 
+    print "CHECKOUT STAGE:\n"; 
+    print "( time -p $CVSCMD llvm; cd llvm/projects ; $CVSCMD llvm-test ) " .
+          "> $CVSLog 2>&1\n";
+  }
+  system "( time -p $CVSCMD llvm; cd llvm/projects ; " .
+      "$CVSCMD llvm-test ) > $CVSLog 2>&1";
+  ChangeDir( $BuildDir , "CVS Checkout directory") ;
 }
 ChangeDir( "llvm" , "llvm source directory") ;
 if (!$NOCHECKOUT) {
-    if ( $VERBOSE ) { print "UPDATE STAGE\n"; }
-    system "$NICE cvs update -PdRA >> $CVSLog 2>&1" ;
+  if ( $VERBOSE ) { print "UPDATE STAGE\n"; }
+  system "$NICE cvs update -PdRA >> $CVSLog 2>&1" ;
 }
 
 ##############################################################
@@ -564,14 +541,14 @@
 my $CVSCheckoutTime_CPU = $CVSCheckoutTime_User + $CVSCheckoutTime_Sys;
 
 my $NumFilesInCVS = `egrep '^U' $CVSLog | wc -l` + 0;
-my $NumDirsInCVS  = `egrep '^cvs (checkout|server|update):' $CVSLog | wc -l` + 0;
-my $LOC = `utils/countloc.sh`;
+my $NumDirsInCVS  = 
+   `egrep '^cvs (checkout|server|update):' $CVSLog | wc -l` + 0;
 
 ##############################################################
 #
 # Extract some information from the CVS history... use a hash so no duplicate
 # stuff is stored. This gets the history from the previous days worth
-# of cvs activit and parses it.
+# of cvs activity and parses it.
 #
 ##############################################################
 
@@ -579,44 +556,44 @@
 
 if(!$NOCVSSTATS){
 
-if ($VERBOSE) { print "CVS HISTORY ANALYSIS STAGE\n"; }
- at CVSHistory = split "\n", `cvs history -D '1 day ago' -a -xAMROCGUW`;
+  if ($VERBOSE) { print "CVS HISTORY ANALYSIS STAGE\n"; }
+  @CVSHistory = split "\n", `cvs history -D '1 day ago' -a -xAMROCGUW`;
 #print join "\n", @CVSHistory; print "\n";
 
-my $DateRE = '[-/:0-9 ]+\+[0-9]+';
+  my $DateRE = '[-/:0-9 ]+\+[0-9]+';
 
 # Loop over every record from the CVS history, filling in the hashes.
-foreach $File (@CVSHistory) {
-    my ($Type, $Date, $UID, $Rev, $Filename);
-    if ($File =~ /([AMRUGC]) ($DateRE) ([^ ]+) +([^ ]+) +([^ ]+) +([^ ]+)/) {
-	($Type, $Date, $UID, $Rev, $Filename) = ($1, $2, $3, $4, "$6/$5");
-    } elsif ($File =~ /([W]) ($DateRE) ([^ ]+)/) {
-	($Type, $Date, $UID, $Rev, $Filename) = ($1, $2, $3, "", "");
-    } elsif ($File =~ /([O]) ($DateRE) ([^ ]+) +([^ ]+)/) {
-	($Type, $Date, $UID, $Rev, $Filename) = ($1, $2, $3, "", "$4/");
-    } else {
-	print "UNMATCHABLE: $File\n";
-	next;
-    }
-    # print "$File\nTy = $Type Date = '$Date' UID=$UID Rev=$Rev File = '$Filename'\n";
-    
-    if ($Filename =~ /^llvm/) {
-	if ($Type eq 'M') {        # Modified
-	    $ModifiedFiles{$Filename} = 1;
-	    $UsersCommitted{$UID} = 1;
-	} elsif ($Type eq 'A') {   # Added
-	    $AddedFiles{$Filename} = 1;
-	    $UsersCommitted{$UID} = 1;
-	} elsif ($Type eq 'R') {   # Removed
-	    $RemovedFiles{$Filename} = 1;
-	    $UsersCommitted{$UID} = 1;
-	} else {
-	    $UsersUpdated{$UID} = 1;
-	}
-    }
-}
+  foreach $File (@CVSHistory) {
+      my ($Type, $Date, $UID, $Rev, $Filename);
+      if ($File =~ /([AMRUGC]) ($DateRE) ([^ ]+) +([^ ]+) +([^ ]+) +([^ ]+)/) {
+          ($Type, $Date, $UID, $Rev, $Filename) = ($1, $2, $3, $4, "$6/$5");
+      } elsif ($File =~ /([W]) ($DateRE) ([^ ]+)/) {
+          ($Type, $Date, $UID, $Rev, $Filename) = ($1, $2, $3, "", "");
+      } elsif ($File =~ /([O]) ($DateRE) ([^ ]+) +([^ ]+)/) {
+          ($Type, $Date, $UID, $Rev, $Filename) = ($1, $2, $3, "", "$4/");
+      } else {
+          print "UNMATCHABLE: $File\n";
+          next;
+      }
+      # print "$File\nTy = $Type Date = '$Date' UID=$UID Rev=$Rev File = '$Filename'\n";
+      
+      if ($Filename =~ /^llvm/) {
+          if ($Type eq 'M') {        # Modified
+              $ModifiedFiles{$Filename} = 1;
+              $UsersCommitted{$UID} = 1;
+          } elsif ($Type eq 'A') {   # Added
+              $AddedFiles{$Filename} = 1;
+              $UsersCommitted{$UID} = 1;
+          } elsif ($Type eq 'R') {   # Removed
+              $RemovedFiles{$Filename} = 1;
+              $UsersCommitted{$UID} = 1;
+          } else {
+              $UsersUpdated{$UID} = 1;
+          }
+      }
+  }
 
-my $TestError = 1;
+  my $TestError = 1;
 
 }#!NOCVSSTATS
 
@@ -632,22 +609,22 @@
 #
 ##############################################################
 if (!$NOCHECKOUT && !$NOBUILD) {
-    my $EXTRAFLAGS = "--enable-spec --with-objroot=.";
-    if ( $VERBOSE ){
-        print "CONFIGURE STAGE:\n";
-        print "(time -p $NICE ./configure $CONFIGUREARGS $EXTRAFLAGS) > $BuildLog 2>&1\n";
-    }
-    system "(time -p $NICE ./configure $CONFIGUREARGS $EXTRAFLAGS) > $BuildLog 2>&1";
-    if ( $VERBOSE ) 
-    { 
-			print "BUILD STAGE:\n";
-			print "(time -p $NICE $MAKECMD $MAKEOPTS) >> $BuildLog 2>&1\n";
-    }
-    # Build the entire tree, capturing the output into $BuildLog
-    system "(time -p $NICE $MAKECMD $MAKEOPTS) >> $BuildLog 2>&1";
+  my $EXTRAFLAGS = "--enable-spec --with-objroot=.";
+  if ( $VERBOSE ) {
+    print "CONFIGURE STAGE:\n";
+    print "(time -p $NICE ./configure $CONFIGUREARGS $EXTRAFLAGS) " . 
+          "> $BuildLog 2>&1\n";
+  }
+  system "(time -p $NICE ./configure $CONFIGUREARGS $EXTRAFLAGS) " . 
+         "> $BuildLog 2>&1";
+  if ( $VERBOSE ) { 
+    print "BUILD STAGE:\n";
+    print "(time -p $NICE $MAKECMD $MAKEOPTS) >> $BuildLog 2>&1\n";
+  }
+  # Build the entire tree, capturing the output into $BuildLog
+  system "(time -p $NICE $MAKECMD $MAKEOPTS) >> $BuildLog 2>&1";
 }
 
-
 ##############################################################
 #
 # Get some statistics about the build...
@@ -660,6 +637,11 @@
 #my $NumObjects     = `grep ']\: Compiling ' $BuildLog | wc -l` + 0;
 
 
+# Get the number of lines of source code. Must be here after the build is done
+# because countloc.sh uses the llvm-config script which must be built.
+my $LOC = `utils/countloc.sh`;
+
+# Get the time taken by the configure script
 my $ConfigTimeU = GetRegexNum "^user", 0, "([0-9.]+)", "$BuildLog";
 my $ConfigTimeS = GetRegexNum "^sys", 0, "([0-9.]+)", "$BuildLog";
 my $ConfigTime  = $ConfigTimeU+$ConfigTimeS;  # ConfigTime = User+System
@@ -677,65 +659,59 @@
 $BuildWallTime=-1 unless $BuildWallTime;
 
 my $BuildError = 0, $BuildStatus = "OK";
-if($NOBUILD){
-    $BuildStatus = "Skipped by user";
-    $BuildError = 1;
+if ($NOBUILD) {
+  $BuildStatus = "Skipped by user";
+  $BuildError = 1;
 }
 elsif (`grep '^$MAKECMD\[^:]*: .*Error' $BuildLog | wc -l` + 0 ||
-    `grep '^$MAKECMD: \*\*\*.*Stop.' $BuildLog | wc -l`+0) {
-    $BuildStatus = "Error: compilation aborted";
-    $BuildError = 1;
-    if( $VERBOSE) { print  "\n***ERROR BUILDING TREE\n\n"; }
+  `grep '^$MAKECMD: \*\*\*.*Stop.' $BuildLog | wc -l`+0) {
+  $BuildStatus = "Error: compilation aborted";
+  $BuildError = 1;
+  if( $VERBOSE) { print  "\n***ERROR BUILDING TREE\n\n"; }
 }
 if ($BuildError) { $NODEJAGNU=1; }
 
 my $a_file_sizes="";
 my $o_file_sizes="";
-if(!$BuildError){
-	if ( $VERBOSE ){
-        print "Organizing size of .o and .a files\n";
-    }
-	ChangeDir( "$BuildDir/llvm", "Build Directory" );
-	$afiles.= `find utils/ -iname '*.a' -ls`;
-	$afiles.= `find lib/ -iname '*.a' -ls`;
-	$afiles.= `find tools/ -iname '*.a' -ls`;
-	if($BUILDTYPE eq "release"){
-		$afiles.= `find Release/ -iname '*.a' -ls`;
-	}
-	else{
-		$afiles.= `find Debug/ -iname '*.a' -ls`;
-	}
-	
-	
-	$ofiles.= `find utils/ -iname '*.o' -ls`;
-	$ofiles.= `find lib/ -iname '*.o' -ls`;
-	$ofiles.= `find tools/ -iname '*.o' -ls`;
-	if($BUILDTYPE eq "release"){
-		$ofiles.= `find Release/ -iname '*.o' -ls`;
-	}
-	else{
-		$ofiles.= `find Debug/ -iname '*.o' -ls`;
-	}
-	
-	@AFILES = split "\n", $afiles;
-	$a_file_sizes="";
-	foreach $x (@AFILES){
-	  $x =~ m/.+\s+.+\s+.+\s+.+\s+.+\s+.+\s+(.+)\s+.+\s+.+\s+.+\s+(.+)/;
-	  $a_file_sizes.="$1 $2 $BUILDTYPE\n";
-	}	
-	@OFILES = split "\n", $ofiles;
-	$o_file_sizes="";
-	foreach $x (@OFILES){
-	  $x =~ m/.+\s+.+\s+.+\s+.+\s+.+\s+.+\s+(.+)\s+.+\s+.+\s+.+\s+(.+)/;
-	  $o_file_sizes.="$1 $2 $BUILDTYPE\n";
-	}
-}
-else{
-	$a_file_sizes="No data due to a bad build.";
-	$o_file_sizes="No data due to a bad build.";
+if (!$BuildError) {
+  print "Organizing size of .o and .a files\n" 
+    if ( $VERBOSE );
+  ChangeDir( "$BuildDir/llvm", "Build Directory" );
+  $afiles.= `find utils/ -iname '*.a' -ls`;
+  $afiles.= `find lib/ -iname '*.a' -ls`;
+  $afiles.= `find tools/ -iname '*.a' -ls`;
+  if($BUILDTYPE eq "release"){
+    $afiles.= `find Release/ -iname '*.a' -ls`;
+  } else {
+   $afiles.= `find Debug/ -iname '*.a' -ls`;
+  }
+  
+  $ofiles.= `find utils/ -iname '*.o' -ls`;
+  $ofiles.= `find lib/ -iname '*.o' -ls`;
+  $ofiles.= `find tools/ -iname '*.o' -ls`;
+  if($BUILDTYPE eq "release"){
+    $ofiles.= `find Release/ -iname '*.o' -ls`;
+  } else {
+    $ofiles.= `find Debug/ -iname '*.o' -ls`;
+  }
+  
+  @AFILES = split "\n", $afiles;
+  $a_file_sizes="";
+  foreach $x (@AFILES){
+    $x =~ m/.+\s+.+\s+.+\s+.+\s+.+\s+.+\s+(.+)\s+.+\s+.+\s+.+\s+(.+)/;
+    $a_file_sizes.="$1 $2 $BUILDTYPE\n";
+  }
+  @OFILES = split "\n", $ofiles;
+  $o_file_sizes="";
+  foreach $x (@OFILES){
+    $x =~ m/.+\s+.+\s+.+\s+.+\s+.+\s+.+\s+(.+)\s+.+\s+.+\s+.+\s+(.+)/;
+    $o_file_sizes.="$1 $2 $BUILDTYPE\n";
+  }
+} else {
+  $a_file_sizes="No data due to a bad build.";
+  $o_file_sizes="No data due to a bad build.";
 }
 
-
 ##############################################################
 #
 # Running dejagnu tests
@@ -743,30 +719,31 @@
 ##############################################################
 my $DejangnuTestResults; # String containing the results of the dejagnu
 my $dejagnu_output = "$DejagnuTestsLog";
-if(!$NODEJAGNU) {
-    if($VERBOSE) 
-    { 
-			print "DEJAGNU FEATURE/REGRESSION TEST STAGE:\n"; 
-			print "(time -p $MAKECMD $MAKEOPTS check) > $dejagnu_output 2>&1\n";
-    }
+if (!$NODEJAGNU) {
+  if($VERBOSE) { 
+    print "DEJAGNU FEATURE/REGRESSION TEST STAGE:\n"; 
+    print "(time -p $MAKECMD $MAKEOPTS check) > $dejagnu_output 2>&1\n";
+  }
 
-    #Run the feature and regression tests, results are put into testrun.sum
-    #Full log in testrun.log
-    system "(time -p $MAKECMD $MAKEOPTS check) > $dejagnu_output 2>&1";
-    
-    #Copy the testrun.log and testrun.sum to our webdir
-    CopyFile("test/testrun.log", $DejagnuLog);
-    CopyFile("test/testrun.sum", $DejagnuSum);
-    #can be done on server
-    $DejagnuTestResults = GetDejagnuTestResults($DejagnuSum, $DejagnuLog);
-    $unexpfail_tests = $DejagnuTestResults;
+  #Run the feature and regression tests, results are put into testrun.sum
+  #Full log in testrun.log
+  system "(time -p $MAKECMD $MAKEOPTS check) > $dejagnu_output 2>&1";
+  
+  #Copy the testrun.log and testrun.sum to our webdir
+  CopyFile("test/testrun.log", $DejagnuLog);
+  CopyFile("test/testrun.sum", $DejagnuSum);
+  #can be done on server
+  $DejagnuTestResults = GetDejagnuTestResults($DejagnuSum, $DejagnuLog);
+  $unexpfail_tests = $DejagnuTestResults;
 }
+
 #Extract time of dejagnu tests
 my $DejagnuTimeU = GetRegexNum "^user", 0, "([0-9.]+)", "$dejagnu_output";
 my $DejagnuTimeS = GetRegexNum "^sys", 0, "([0-9.]+)", "$dejagnu_output";
 $DejagnuTime  = $DejagnuTimeU+$DejagnuTimeS;  # DejagnuTime = User+System
 $DejagnuWallTime = GetRegexNum "^real", 0,"([0-9.]+)","$dejagnu_output"; 
-$DejagnuTestResults = "Dejagnu skipped by user choice." unless $DejagnuTestResults;
+$DejagnuTestResults = 
+  "Dejagnu skipped by user choice." unless $DejagnuTestResults;
 $DejagnuTime     = "0.0" unless $DejagnuTime;
 $DejagnuWallTime = "0.0" unless $DejagnuWallTime;
 
@@ -775,36 +752,34 @@
 # Get warnings from the build
 #
 ##############################################################
-if(!$NODEJAGNU){
-
-if ( $VERBOSE ) { print "BUILD INFORMATION COLLECTION STAGE\n"; }
-my @Warn = split "\n", `egrep 'warning:|Entering dir' $BuildLog`;
-my @Warnings;
-my $CurDir = "";
+if (!$NODEJAGNU) {
+  if ( $VERBOSE ) { print "BUILD INFORMATION COLLECTION STAGE\n"; }
+  my @Warn = split "\n", `egrep 'warning:|Entering dir' $BuildLog`;
+  my @Warnings;
+  my $CurDir = "";
 
-foreach $Warning (@Warn) {
+  foreach $Warning (@Warn) {
     if ($Warning =~ m/Entering directory \`([^\`]+)\'/) {
-	$CurDir = $1;                 # Keep track of directory warning is in...
-	if ($CurDir =~ m#$BuildDir/llvm/(.*)#) { # Remove buildir prefix if included
-	    $CurDir = $1;
-	}
+      $CurDir = $1;                 # Keep track of directory warning is in...
+      # Remove buildir prefix if included
+      if ($CurDir =~ m#$BuildDir/llvm/(.*)#) { $CurDir = $1; }
     } else {
-	push @Warnings, "$CurDir/$Warning";     # Add directory to warning...
+      push @Warnings, "$CurDir/$Warning";     # Add directory to warning...
     }
-}
-my $WarningsFile =  join "\n", @Warnings;
-$WarningsFile =~ s/:[0-9]+:/::/g;
+  }
+  my $WarningsFile =  join "\n", @Warnings;
+  $WarningsFile =~ s/:[0-9]+:/::/g;
 
-# Emit the warnings file, so we can diff...
-WriteFile "$WebDir/$DATE-Warnings.txt", $WarningsFile . "\n";
-my ($WarningsAdded, $WarningsRemoved) = DiffFiles "-Warnings.txt";
-
-# Output something to stdout if something has changed
-#print "ADDED   WARNINGS:\n$WarningsAdded\n\n" if (length $WarningsAdded);
-#print "REMOVED WARNINGS:\n$WarningsRemoved\n\n" if (length $WarningsRemoved);
+  # Emit the warnings file, so we can diff...
+  WriteFile "$WebDir/$DATE-Warnings.txt", $WarningsFile . "\n";
+  my ($WarningsAdded, $WarningsRemoved) = DiffFiles "-Warnings.txt";
+
+  # Output something to stdout if something has changed
+  #print "ADDED   WARNINGS:\n$WarningsAdded\n\n" if (length $WarningsAdded);
+  #print "REMOVED WARNINGS:\n$WarningsRemoved\n\n" if (length $WarningsRemoved);
 
-#my @TmpWarningsAdded = split "\n", $WarningsAdded; ~PJ on upgrade
-#my @TmpWarningsRemoved = split "\n", $WarningsRemoved; ~PJ on upgrade
+  #my @TmpWarningsAdded = split "\n", $WarningsAdded; ~PJ on upgrade
+  #my @TmpWarningsRemoved = split "\n", $WarningsRemoved; ~PJ on upgrade
 
 } #endif !NODEGAGNU
 
@@ -812,29 +787,31 @@
 #
 # If we built the tree successfully, run the nightly programs tests...
 #
-# A set of tests to run is passed in (i.e. "SingleSource" "MultiSource" "External")
+# A set of tests to run is passed in (i.e. "SingleSource" "MultiSource" 
+# "External")
 #
 ##############################################################
 sub TestDirectory {
-	my $SubDir = shift;
-	
-	ChangeDir( "$BuildDir/llvm/projects/llvm-test/$SubDir", "Programs Test Subdirectory" ) || return ("", "");
-	
-	my $ProgramTestLog = "$Prefix-$SubDir-ProgramTest.txt";
-	
-	# Run the programs tests... creating a report.nightly.csv file
-	if (!$NOTEST) {
-		if( $VERBOSE) { 
-		  print "$MAKECMD -k $MAKEOPTS $PROGTESTOPTS report.nightly.csv ".
-                "TEST=nightly > $ProgramTestLog 2>&1\n"; 
-        }
-		system "$MAKECMD -k $MAKEOPTS $PROGTESTOPTS report.nightly.csv ".
+  my $SubDir = shift;
+  
+  ChangeDir( "$BuildDir/llvm/projects/llvm-test/$SubDir", 
+             "Programs Test Subdirectory" ) || return ("", "");
+  
+  my $ProgramTestLog = "$Prefix-$SubDir-ProgramTest.txt";
+  
+  # Run the programs tests... creating a report.nightly.csv file
+  if (!$NOTEST) {
+    if( $VERBOSE) { 
+      print "$MAKECMD -k $MAKEOPTS $PROGTESTOPTS report.nightly.csv ".
+            "TEST=nightly > $ProgramTestLog 2>&1\n"; 
+    }
+    system "$MAKECMD -k $MAKEOPTS $PROGTESTOPTS report.nightly.csv ".
            "TEST=nightly > $ProgramTestLog 2>&1";
-	  $llcbeta_options=`$MAKECMD print-llcbeta-option`;
-	} 
-    
+    $llcbeta_options=`$MAKECMD print-llcbeta-option`;
+  } 
+
   my $ProgramsTable;
-  if (`grep '^$MAKECMD\[^:]: .*Error' $ProgramTestLog | wc -l` + 0){
+  if (`grep '^$MAKECMD\[^:]: .*Error' $ProgramTestLog | wc -l` + 0) {
     $TestError = 1;
     $ProgramsTable="Error running test $SubDir\n";
     print "ERROR TESTING\n";
@@ -844,11 +821,11 @@
     print "ERROR TESTING\n";
   } else {
     $TestError = 0;
-    #
-    # Create a list of the tests which were run...
-    #
-    system "egrep 'TEST-(PASS|FAIL)' < $ProgramTestLog ".
-           "| sort > $Prefix-multisourceprogramstable.txt";
+  #
+  # Create a list of the tests which were run...
+  #
+  system "egrep 'TEST-(PASS|FAIL)' < $ProgramTestLog ".
+         "| sort > $Prefix-multisourceprogramstable.txt";
   }
   $ProgramsTable = ReadFile "report.nightly.csv";
 
@@ -857,33 +834,36 @@
 }
 
 if (!$BuildError) {
-	if ( $VERBOSE ) {
+  if ( $VERBOSE ) {
      print "SingleSource TEST STAGE\n";
-	}
-	($SingleSourceProgramsTable, $llcbeta_options) = TestDirectory("SingleSource");
-	WriteFile "$Prefix-singlesourceprogramstable.txt", $SingleSourceProgramsTable;
+  }
+  ($SingleSourceProgramsTable, $llcbeta_options) = 
+    TestDirectory("SingleSource");
+  WriteFile "$Prefix-singlesourceprogramstable.txt", $SingleSourceProgramsTable;
   if ( $VERBOSE ) {
      print "MultiSource TEST STAGE\n";
-	}
-	($MultiSourceProgramsTable, $llcbeta_options) = TestDirectory("MultiSource");
-	WriteFile "$Prefix-multisourceprogramstable.txt", $MultiSourceProgramsTable;
-	if ( ! $NOEXTERNALS ) {
-	  if ( $VERBOSE ) {
-		  print "External TEST STAGE\n";
-	  }
-	  ($ExternalProgramsTable, $llcbeta_options) = TestDirectory("External");
-	  WriteFile "$Prefix-externalprogramstable.txt", $ExternalProgramsTable;
-	  system "cat $Prefix-singlesourceprogramstable.txt $Prefix-multisourceprogramstable.txt ".
-		     " $Prefix-externalprogramstable.txt | sort > $Prefix-Tests.txt";
-	} else {
-	  $ExternalProgramsTable = "External TEST STAGE SKIPPED\n";
-	  if ( $VERBOSE ) {
-		  print "External TEST STAGE SKIPPED\n";
-	  }
-	  system "cat $Prefix-singlesourceprogramstable.txt $Prefix-multisourceprogramstable.txt ".
-		     " | sort > $Prefix-Tests.txt";
-	}
-	WriteFile "$Prefix-externalprogramstable.txt", $ExternalProgramsTable;
+  }
+  ($MultiSourceProgramsTable, $llcbeta_options) = TestDirectory("MultiSource");
+  WriteFile "$Prefix-multisourceprogramstable.txt", $MultiSourceProgramsTable;
+  if ( ! $NOEXTERNALS ) {
+    if ( $VERBOSE ) {
+      print "External TEST STAGE\n";
+    }
+    ($ExternalProgramsTable, $llcbeta_options) = TestDirectory("External");
+    WriteFile "$Prefix-externalprogramstable.txt", $ExternalProgramsTable;
+    system "cat $Prefix-singlesourceprogramstable.txt " . 
+               "$Prefix-multisourceprogramstable.txt ".
+               "$Prefix-externalprogramstable.txt | sort > $Prefix-Tests.txt";
+  } else {
+    $ExternalProgramsTable = "External TEST STAGE SKIPPED\n";
+    if ( $VERBOSE ) {
+      print "External TEST STAGE SKIPPED\n";
+    }
+    system "cat $Prefix-singlesourceprogramstable.txt " . 
+               "$Prefix-multisourceprogramstable.txt ".
+               " | sort > $Prefix-Tests.txt";
+  }
+  WriteFile "$Prefix-externalprogramstable.txt", $ExternalProgramsTable;
 }
 
 ##############################################################
@@ -902,20 +882,20 @@
 my $xfails="";
 
 if(!$NODEJAGNU) {
-	for($x=0; $x<@DEJAGNU; $x++){
-		if($DEJAGNU[$x] =~ m/^PASS:/){
-			$passes.="$DEJAGNU[$x]\n";
-			$dejagnu_test_list.="$DEJAGNU[$x]\n";
-		}
-		elsif($DEJAGNU[$x] =~ m/^FAIL:/){
-			$fails.="$DEJAGNU[$x]\n";
-			$dejagnu_test_list.="$DEJAGNU[$x]\n";
-		}
-		elsif($DEJAGNU[$x] =~ m/^XFAIL:/){
-			$xfails.="$DEJAGNU[$x]\n";
-			$dejagnu_test_list.="$DEJAGNU[$x]\n";
-		}
-	}
+  for ($x=0; $x<@DEJAGNU; $x++) {
+    if ($DEJAGNU[$x] =~ m/^PASS:/) {
+      $passes.="$DEJAGNU[$x]\n";
+      $dejagnu_test_list.="$DEJAGNU[$x]\n";
+    }
+    elsif ($DEJAGNU[$x] =~ m/^FAIL:/) {
+      $fails.="$DEJAGNU[$x]\n";
+      $dejagnu_test_list.="$DEJAGNU[$x]\n";
+    }
+    elsif ($DEJAGNU[$x] =~ m/^XFAIL:/) {
+      $xfails.="$DEJAGNU[$x]\n";
+      $dejagnu_test_list.="$DEJAGNU[$x]\n";
+    }
+  }
 }
 
 ##############################################################
@@ -930,18 +910,22 @@
   $MachCodeSize) = ("","","","","","","");
   if (!$NORUNNINGTESTS) {
     ChangeDir( "$BuildDir/llvm/projects/llvm-test/MultiSource/Benchmarks/Olden",
-		   "Olden Test Directory");
+                "Olden Test Directory");
 
     # Clean out previous results...
     system "$NICE $MAKECMD $MAKEOPTS clean > /dev/null 2>&1";
-	
+
     # Run the nightly test in this directory, with LARGE_PROBLEM_SIZE and
     # GET_STABLE_NUMBERS enabled!
-    if( $VERBOSE ) { print "$MAKECMD -k $MAKEOPTS $PROGTESTOPTS report.nightly.csv.out TEST=nightly " .
-			     " LARGE_PROBLEM_SIZE=1 GET_STABLE_NUMBERS=1 > /dev/null 2>&1\n"; }
-	system "$MAKECMD -k $MAKEOPTS $PROGTESTOPTS report.nightly.csv.out TEST=nightly " .
-	    " LARGE_PROBLEM_SIZE=1 GET_STABLE_NUMBERS=1 > /dev/null 2>&1";
-	system "cp report.nightly.csv $OldenTestsLog";
+    if( $VERBOSE ) { 
+      print "$MAKECMD -k $MAKEOPTS $PROGTESTOPTS report.nightly.csv.out " .
+            "TEST=nightly  LARGE_PROBLEM_SIZE=1 GET_STABLE_NUMBERS=1 " .
+            "> /dev/null 2>&1\n"; 
+    }
+    system "$MAKECMD -k $MAKEOPTS $PROGTESTOPTS report.nightly.csv.out " .
+           "TEST=nightly LARGE_PROBLEM_SIZE=1 GET_STABLE_NUMBERS=1 " .
+           "> /dev/null 2>&1";
+    system "cp report.nightly.csv $OldenTestsLog";
   }  
 }
 
@@ -958,7 +942,6 @@
 # Place all the logs neatly into one humungous file
 #
 ##############################################################
-
 if ( $VERBOSE ) { print "PREPARING LOGS TO BE SENT TO SERVER\n"; }
 
 $machine_data = "uname: ".`uname -a`. 
@@ -993,10 +976,9 @@
 $dejagnulog_full = join("\n", @DEJAGNULOG_FULL);
 
 my $gcc_version_long="";
-if($GCCPATH ne ""){
+if ($GCCPATH ne "") {
   $gcc_version_long = `$GCCPATH/gcc --version`;
-}
-else{
+} else {
   $gcc_version_long = `gcc --version`;
 }
 @GCC_VERSION = split '\n', $gcc_version_long;
@@ -1012,58 +994,59 @@
 
 if ( $VERBOSE ) { print "SEND THE DATA VIA THE POST REQUEST\n"; }
 
-my %hash_of_data = ('machine_data' => $machine_data,
-	'build_data' => $build_data,
-	'gcc_version' => $gcc_version,
-	'nickname' => $nickname,
-	'dejagnutime_wall' => $DejagnuWallTime,
-	'dejagnutime_cpu' => $DejagnuTime,
-	'cvscheckouttime_wall' => $CVSCheckoutTime_Wall,
-	'cvscheckouttime_cpu' => $CVSCheckoutTime_CPU,
-	'configtime_wall' => $ConfigWallTime,
-	'configtime_cpu'=> $ConfigTime,
-	'buildtime_wall' => $BuildWallTime,
-	'buildtime_cpu' => $BuildTime,
-	'warnings' => $WarningsFile,
-	'cvsusercommitlist' => $UserCommitList,
-	'cvsuserupdatelist' => $UserUpdateList,
-	'cvsaddedfiles' => $CVSAddedFiles,
-	'cvsmodifiedfiles' => $CVSModifiedFiles,
-	'cvsremovedfiles' => $CVSRemovedFiles,
-	'lines_of_code' => $LOC,
-	'cvs_file_count' => $NumFilesInCVS,
-	'cvs_dir_count' => $NumDirsInCVS,
-	'buildstatus' => $BuildStatus,
-	'singlesource_programstable' => $SingleSourceProgramsTable,
-	'multisource_programstable' => $MultiSourceProgramsTable,
-	'externalsource_programstable' => $ExternalProgramsTable,
-	'llcbeta_options' => $multisource_llcbeta_options,
-	'warnings_removed' => $WarningsRemoved,
-	'warnings_added' => $WarningsAdded,
-	'passing_tests' => $passes,
-	'expfail_tests' => $xfails,
-	'unexpfail_tests' => $fails,
-	'all_tests' => $dejagnu_test_list,
-	'new_tests' => "",
-	'removed_tests' => "",
-	'dejagnutests_log' => $dejagnutests_log,
-	'dejagnutests_sum' => $dejagnutests_sum,
-	'starttime' => $starttime,
-	'endtime' => $endtime,
-	'o_file_sizes' => $o_file_sizes,
-	'a_file_sizes' => $a_file_sizes);
+my %hash_of_data = (
+  'machine_data' => $machine_data,
+  'build_data' => $build_data,
+  'gcc_version' => $gcc_version,
+  'nickname' => $nickname,
+  'dejagnutime_wall' => $DejagnuWallTime,
+  'dejagnutime_cpu' => $DejagnuTime,
+  'cvscheckouttime_wall' => $CVSCheckoutTime_Wall,
+  'cvscheckouttime_cpu' => $CVSCheckoutTime_CPU,
+  'configtime_wall' => $ConfigWallTime,
+  'configtime_cpu'=> $ConfigTime,
+  'buildtime_wall' => $BuildWallTime,
+  'buildtime_cpu' => $BuildTime,
+  'warnings' => $WarningsFile,
+  'cvsusercommitlist' => $UserCommitList,
+  'cvsuserupdatelist' => $UserUpdateList,
+  'cvsaddedfiles' => $CVSAddedFiles,
+  'cvsmodifiedfiles' => $CVSModifiedFiles,
+  'cvsremovedfiles' => $CVSRemovedFiles,
+  'lines_of_code' => $LOC,
+  'cvs_file_count' => $NumFilesInCVS,
+  'cvs_dir_count' => $NumDirsInCVS,
+  'buildstatus' => $BuildStatus,
+  'singlesource_programstable' => $SingleSourceProgramsTable,
+  'multisource_programstable' => $MultiSourceProgramsTable,
+  'externalsource_programstable' => $ExternalProgramsTable,
+  'llcbeta_options' => $multisource_llcbeta_options,
+  'warnings_removed' => $WarningsRemoved,
+  'warnings_added' => $WarningsAdded,
+  'passing_tests' => $passes,
+  'expfail_tests' => $xfails,
+  'unexpfail_tests' => $fails,
+  'all_tests' => $dejagnu_test_list,
+  'new_tests' => "",
+  'removed_tests' => "",
+  'dejagnutests_log' => $dejagnutests_log,
+  'dejagnutests_sum' => $dejagnutests_sum,
+  'starttime' => $starttime,
+  'endtime' => $endtime,
+  'o_file_sizes' => $o_file_sizes,
+  'a_file_sizes' => $a_file_sizes
+);
 
 $TESTING = 0;
 
-if($TESTING){
-    print "============================\n";
-    foreach $x(keys %hash_of_data){
-        print "$x  => $hash_of_data{$x}\n";
-    }
-}
-else{
-    my $response = SendData $SUBMITSERVER,$SUBMITSCRIPT,\%hash_of_data;
-    if( $VERBOSE) { print "============================\n$response"; }
+if ($TESTING) {
+  print "============================\n";
+  foreach $x(keys %hash_of_data){
+      print "$x  => $hash_of_data{$x}\n";
+  }
+} else {
+  my $response = SendData $SUBMITSERVER,$SUBMITSCRIPT,\%hash_of_data;
+  if( $VERBOSE) { print "============================\n$response"; }
 }
 
 ##############################################################
@@ -1071,7 +1054,7 @@
 # Remove the cvs tree...
 #
 ##############################################################
-system ( "$NICE rm -rf $BuildDir") if (!$NOCHECKOUT and !$NOREMOVE);
-system ( "$NICE rm -rf $WebDir") if (!$NOCHECKOUT and !$NOREMOVE and !$NOREMOVERESULTS);
-
-
+system ( "$NICE rm -rf $BuildDir") 
+  if (!$NOCHECKOUT and !$NOREMOVE);
+system ( "$NICE rm -rf $WebDir") 
+  if (!$NOCHECKOUT and !$NOREMOVE and !$NOREMOVERESULTS);






More information about the llvm-commits mailing list