[llvm-commits] [llvm] r84493 - /llvm/trunk/utils/NewNightlyTest.pl

Daniel Dunbar daniel at zuster.org
Mon Oct 19 06:20:32 PDT 2009


Author: ddunbar
Date: Mon Oct 19 08:20:31 2009
New Revision: 84493

URL: http://llvm.org/viewvc/llvm-project?rev=84493&view=rev
Log:
NNT: Now that build & test steps are factored out, coalesce all the logic together.

Modified:
    llvm/trunk/utils/NewNightlyTest.pl

Modified: llvm/trunk/utils/NewNightlyTest.pl
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/NewNightlyTest.pl?rev=84493&r1=84492&r2=84493&view=diff

==============================================================================
--- llvm/trunk/utils/NewNightlyTest.pl (original)
+++ llvm/trunk/utils/NewNightlyTest.pl Mon Oct 19 08:20:31 2009
@@ -493,16 +493,11 @@
 
 ##############################################################
 #
-# Getting Start timestamp
+# Individual Build & Test Functions
 #
 ##############################################################
-$starttime = `date "+20%y-%m-%d %H:%M:%S"`;
 
-##############################################################
-#
-# Create the source repository directory
-#
-##############################################################
+# Create the source repository directory.
 sub CheckoutSource {
   if (!$NOCHECKOUT) {
     if (-d $BuildDir) {
@@ -533,14 +528,8 @@
     }
   }
 }
-CheckoutSource();
-ChangeDir( $LLVMSrcDir , "llvm source directory") ;
 
-##############################################################
-#
-# Build the entire tree, saving build messages to the build log
-#
-##############################################################
+# Build the entire tree, saving build messages to the build log.
 sub BuildLLVM {
   if (!$NOCHECKOUT && !$NOBUILD) {
     my $EXTRAFLAGS = "--enable-spec --with-objroot=.";
@@ -564,43 +553,27 @@
 
   return ($HadError, $Status);
 }
-($BuildError, $BuildStatus) = BuildLLVM();
-
-if ($BuildError) {
-    if( $VERBOSE) { print  "\n***ERROR BUILDING TREE\n\n"; }
-    $NODEJAGNU=1;
-}
 
-##############################################################
-#
-# Running dejagnu tests
-#
-##############################################################
+# Running dejagnu tests and save results to log.
+sub RunDejaGNUTests {
+  my $Res = "Dejagnu skipped by user choice.";
+
+  if (!$NODEJAGNU) {
+    #Run the feature and regression tests, results are put into testrun.sum
+    #Full log in testrun.log
+    RunLoggedCommand("(time -p $MAKECMD $MAKEOPTS check)", $DejagnuLog, "DEJAGNU");
+
+    #Copy the testrun.log and testrun.sum to our webdir
+    CopyFile("test/testrun.log", $DejagnuLog);
+    CopyFile("test/testrun.sum", $DejagnuSum);
 
-# String containing the results of the dejagnu
-my $DejagnuTestResults="Dejagnu skipped by user choice.";
+    $Res = GetDejagnuTestResults($DejagnuSum, $DejagnuLog);
+  }
 
-if (!$NODEJAGNU) {
-  #Run the feature and regression tests, results are put into testrun.sum
-  #Full log in testrun.log
-  RunLoggedCommand("(time -p $MAKECMD $MAKEOPTS check)", $DejagnuLog, "DEJAGNU");
-
-  #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);
+  return $Res;
 }
 
-##############################################################
-#
-# 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")
-#
-##############################################################
-
+# Run the named tests (i.e. "SingleSource" "MultiSource" "External")
 sub TestDirectory {
   my $SubDir = shift;
   ChangeDir( "$LLVMTestDir/$SubDir",
@@ -644,11 +617,8 @@
   return ($ProgramsTable, $LLCBetaOpts);
 }
 
-##############################################################
-#
-# Calling sub TestDirectory
-#
-##############################################################
+# Run all the nightly tests and return the program tables and the number of
+# passes, fails, and xfails.
 sub RunNightlyTest() {
   if (!$BuildError) {
     ($SSProgs, $llcbeta_options) = TestDirectory("SingleSource");
@@ -694,25 +664,36 @@
     }
   }
 
-  return ($SSProgs, $MSProgs, $ExtProgs, $Passes, $Fails, $XFails)
+  return ($SSProgs, $MSProgs, $ExtProgs, $Passes, $Fails, $XFails);
 }
 
-my ($SingleSourceProgramsTable, $MultiSourceProgramsTable, $ExternalProgramsTable,
-    $passes, $fails, $xfails) = RunNightlyTest();
-
 ##############################################################
 #
-# Getting end timestamp
+# The actual NewNightlyTest logic.
 #
 ##############################################################
-$endtime = `date "+20%y-%m-%d %H:%M:%S"`;
 
+$starttime = `date "+20%y-%m-%d %H:%M:%S"`;
+
+CheckoutSource();
+ChangeDir( $LLVMSrcDir , "llvm source directory") ;
+($BuildError, $BuildStatus) = BuildLLVM();
+if ($BuildError) {
+    if( $VERBOSE) { print  "\n***ERROR BUILDING TREE\n\n"; }
+    $NODEJAGNU=1;
+}
+my $DejagnuTestResults = RunDejaGNUTests();
+my ($SingleSourceProgramsTable, $MultiSourceProgramsTable, $ExternalProgramsTable,
+    $passes, $fails, $xfails) = RunNightlyTest();
+
+$endtime = `date "+20%y-%m-%d %H:%M:%S"`;
 
 ##############################################################
 #
-# Place all the logs neatly into one humungous file
+# Accumulate the information to send to the server.
 #
 ##############################################################
+
 if ( $VERBOSE ) { print "PREPARING LOGS TO BE SENT TO SERVER\n"; }
 
 $machine_data = "uname: ".`uname -a`.
@@ -722,6 +703,7 @@
                 "date: ".`date \"+20%y-%m-%d\"`.
                 "time: ".`date +\"%H:%M:%S\"`;
 
+# Get gcc version.
 my $gcc_version_long = "";
 if ($GCCPATH ne "") {
   $gcc_version_long = `$GCCPATH/gcc --version`;
@@ -732,6 +714,7 @@
 }
 my $gcc_version = (split '\n', $gcc_version_long)[0];
 
+# Get llvm-gcc target triple.
 my $llvmgcc_version_long = "";
 if ($LLVMGCCPATH ne "") {
   $llvmgcc_version_long = `$LLVMGCCPATH/llvm-gcc -v 2>&1`;
@@ -741,12 +724,6 @@
 (split '\n', $llvmgcc_version_long)[1] =~ /Target: (.+)/;
 my $targetTriple = $1;
 
-##############################################################
-#
-# Send data via a post request
-#
-##############################################################
-
 if ( $VERBOSE ) { print "SEND THE DATA VIA THE POST REQUEST\n"; }
 
 # Logs.





More information about the llvm-commits mailing list