Porting r53478 into mainline:
[oota-llvm.git] / utils / NewNightlyTest.pl
index e433ac05fcac0167a149509597c3363f7a687a2d..447165fd613d735cfd92deea23395173e90c67b9 100755 (executable)
@@ -35,6 +35,7 @@ use Socket;
 #  -disable-llc     Disable LLC tests in the nightly tester.
 #  -disable-jit     Disable JIT tests in the nightly tester.
 #  -disable-cbe     Disable C backend tests in the nightly tester.
+#  -disable-lto     Disable link time optimization.
 #  -verbose         Turn on some debug output
 #  -debug           Print information useful only to maintainers of this script.
 #  -nice            Checkout/Configure/Build with "nice" to reduce impact
@@ -73,6 +74,7 @@ use Socket;
 #                   this option is not specified it defaults to
 #                   /nightlytest/NightlyTestAccept.php. This is basically 
 #                   everything after the www.yourserver.org.
+#  -nosubmit        Do not report the test results back to a submit server.
 #
 # CVSROOT is the CVS repository from which the tree will be checked out,
 #  specified either in the full :method:user@host:/dir syntax, or
@@ -125,6 +127,7 @@ $NORUNNINGTESTS=0;
 $MAKECMD="make";
 $SUBMITSERVER = "llvm.org";
 $SUBMITSCRIPT = "/nightlytest/NightlyTestAccept.php";
+$SUBMIT = 1;
 
 while (scalar(@ARGV) and ($_ = $ARGV[0], /^[-+]/)) {
   shift;
@@ -152,7 +155,8 @@ while (scalar(@ARGV) and ($_ = $ARGV[0], /^[-+]/)) {
   if (/^-disable-jit$/)    { $PROGTESTOPTS .= " DISABLE_JIT=1";
                              $CONFIGUREARGS .= " --disable-jit"; next; }
   if (/^-disable-cbe$/)    { $PROGTESTOPTS .= " DISABLE_CBE=1"; next; }
-  if (/^-test-opts$/)      { $PROGTESTOPTS .= "$ARGV[0]"; shift; next; }
+  if (/^-disable-lto$/)    { $PROGTESTOPTS .= " DISABLE_LTO=1"; next; }
+  if (/^-test-opts$/)      { $PROGTESTOPTS .= " $ARGV[0]"; shift; next; }
   if (/^-verbose$/)        { $VERBOSE = 1; next; }
   if (/^-debug$/)          { $DEBUG = 1; next; }
   if (/^-nice$/)           { $NICE = "nice "; next; }
@@ -162,6 +166,7 @@ while (scalar(@ARGV) and ($_ = $ARGV[0], /^[-+]/)) {
                              shift; next; }
   if (/^-submit-server/)   { $SUBMITSERVER = "$ARGV[0]"; shift; next; }
   if (/^-submit-script/)   { $SUBMITSCRIPT = "$ARGV[0]"; shift; next; }
+  if (/^-nosubmit$/)       { $SUBMIT = 0; next; }
   if (/^-nickname$/)       { $nickname = "$ARGV[0]"; shift; next; } 
   if (/^-gccpath/)         { $CONFIGUREARGS .= 
                              " CC=$ARGV[0]/gcc CXX=$ARGV[0]/g++"; 
@@ -553,7 +558,7 @@ my $NumFilesInCVS = 0;
 my $NumDirsInCVS  = 0;
 if ($USESVN) {
   $NumFilesInCVS = `egrep '^A' $COLog | wc -l` + 0;
-  $NumDirsInCVS  = `sed -e 's#/[^/]*$##' $COLog | sort | uniq | wc -l` + 0;
+  $NumDirsInCVS  = `sed -e 's#/[^/]*\$##' $COLog | sort | uniq | wc -l` + 0;
 } else {
   $NumFilesInCVS = `egrep '^U' $COLog | wc -l` + 0;
   $NumDirsInCVS  = `egrep '^cvs (checkout|server|update):' $COLog | wc -l` + 0;
@@ -1133,16 +1138,14 @@ my %hash_of_data = (
   'target_triple' => $targetTriple
 );
 
-$TESTING = 0;
-
-if ($TESTING) {
+if ($SUBMIT) {
+  my $response = SendData $SUBMITSERVER,$SUBMITSCRIPT,\%hash_of_data;
+  if( $VERBOSE) { print "============================\n$response"; }
+} else {
   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"; }
 }
 
 ##############################################################