X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=utils%2FNewNightlyTest.pl;h=8ca7a764a6f3ff12e7149b9350615c3dfa3a11ad;hb=f45a82890e34984ad1e1e259f8fb902caddfb0b1;hp=956a952626e4fa4eaaf1a7e4d2aca00ccd39b1fd;hpb=2bae1f58edc9a2bae81d377fa648f66d21c1b62f;p=oota-llvm.git diff --git a/utils/NewNightlyTest.pl b/utils/NewNightlyTest.pl index 956a952626e..8ca7a764a6f 100755 --- a/utils/NewNightlyTest.pl +++ b/utils/NewNightlyTest.pl @@ -8,7 +8,7 @@ use Socket; # # 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 +# regressions and performance changes. Submits this information # to llvm.org where it is placed into the nightlytestresults database. # # Modified heavily by Patrick Jenkins, July 2006 @@ -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 @@ -45,6 +46,8 @@ use Socket; # -gccpath Path to gcc/g++ used to build LLVM # -cvstag Check out a specific CVS tag to build LLVM (useful for # testing release branches) +# -usecvs Check code out from the (old) CVS Repository instead of from +# the standard Subversion repository. # -target Specify the target triplet # -cflags Next argument specifies that C compilation options that # override the default. @@ -64,13 +67,14 @@ use Socket; # or SPEC are not installed) # -with-externals Specify a directory where the external tests are located. # -submit-server Specifies a server to submit the test results too. If this -# option is not specified it defaults to -# llvm.org. This is basically just the address of the +# option is not specified it defaults to +# llvm.org. This is basically just the address of the # webserver # -submit-script Specifies which script to call on the submit server. If # this option is not specified it defaults to -# /nightlytest/NightlyTestAccept.php. This is basically +# /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 @@ -91,6 +95,8 @@ use Socket; # ############################################################## my $HOME = $ENV{'HOME'}; +my $SVNURL = $ENV{"SVNURL"}; +$SVNURL = 'https://llvm.org/svn/llvm-project' unless $SVNURL; my $CVSRootDir = $ENV{'CVSROOT'}; $CVSRootDir = "/home/vadve/shared/PublicCVS" unless $CVSRootDir; my $BuildDir = $ENV{'BUILDDIR'}; @@ -116,10 +122,12 @@ my $TestStartTime = gmtime() . "GMT
" . localtime() . " (local)"; $CONFIGUREARGS=""; $nickname=""; $NOTEST=0; +$USESVN=1; $NORUNNINGTESTS=0; $MAKECMD="make"; $SUBMITSERVER = "llvm.org"; $SUBMITSCRIPT = "/nightlytest/NightlyTestAccept.php"; +$SUBMIT = 1; while (scalar(@ARGV) and ($_ = $ARGV[0], /^[-+]/)) { shift; @@ -136,45 +144,48 @@ while (scalar(@ARGV) and ($_ = $ARGV[0], /^[-+]/)) { if (/^-release$/) { $MAKEOPTS = "$MAKEOPTS ENABLE_OPTIMIZED=1 ". "OPTIMIZE_OPTION=-O2"; $BUILDTYPE="release"; next;} if (/^-release-asserts$/){ $MAKEOPTS = "$MAKEOPTS ENABLE_OPTIMIZED=1 ". - "DISABLE-ASSERTIONS=1 ". - "OPTIMIZE_OPTION=-O2"; + "DISABLE_ASSERTIONS=1 ". + "OPTIMIZE_OPTION=-O2"; $BUILDTYPE="release-asserts"; next;} if (/^-enable-llcbeta$/) { $PROGTESTOPTS .= " ENABLE_LLCBETA=1"; next; } if (/^-enable-lli$/) { $PROGTESTOPTS .= " ENABLE_LLI=1"; - $CONFIGUREARGS .= " --enable-lli"; next; } + $CONFIGUREARGS .= " --enable-lli"; next; } if (/^-disable-llc$/) { $PROGTESTOPTS .= " DISABLE_LLC=1"; - $CONFIGUREARGS .= " --disable-llc_diffs"; next; } + $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 (/^-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; } - if (/^-f2c$/) { $CONFIGUREARGS .= " --with-f2c=$ARGV[0]"; + if (/^-f2c$/) { $CONFIGUREARGS .= " --with-f2c=$ARGV[0]"; shift; next; } - if (/^-with-externals$/) { $CONFIGUREARGS .= " --with-externals=$ARGV[0]"; + 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++"; + if (/^-nosubmit$/) { $SUBMIT = 0; 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; } + if (/^-cvstag/) { $CVSCOOPT .= " -r $ARGV[0]"; shift; next; } else { $CVSCOOPT="";} - if (/^-target/) { $CONFIGUREARGS .= " --target=$ARGV[0]"; + if (/^-usecvs/) { $USESVN = 0; } + if (/^-target/) { $CONFIGUREARGS .= " --target=$ARGV[0]"; shift; next; } - if (/^-cflags/) { $MAKEOPTS = "$MAKEOPTS C.Flags=\'$ARGV[0]\'"; + if (/^-cflags/) { $MAKEOPTS = "$MAKEOPTS C.Flags=\'$ARGV[0]\'"; shift; next; } - if (/^-cxxflags/) { $MAKEOPTS = "$MAKEOPTS CXX.Flags=\'$ARGV[0]\'"; + if (/^-cxxflags/) { $MAKEOPTS = "$MAKEOPTS CXX.Flags=\'$ARGV[0]\'"; shift; next; } - if (/^-ldflags/) { $MAKEOPTS = "$MAKEOPTS LD.Flags=\'$ARGV[0]\'"; + 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 .= + if (/^-extraflags/) { $CONFIGUREARGS .= " --with-extra-options=\'$ARGV[0]\'"; shift; next;} if (/^-noexternals$/) { $NOEXTERNALS = 1; next; } if (/^-nodejagnu$/) { $NODEJAGNU = 1; next; } @@ -184,7 +195,12 @@ while (scalar(@ARGV) and ($_ = $ARGV[0], /^[-+]/)) { if ($ENV{'LLVMGCCDIR'}) { $CONFIGUREARGS .= " --with-llvmgccdir=" . $ENV{'LLVMGCCDIR'}; + $LLVMGCCPATH = $ENV{'LLVMGCCDIR'}; +} +else { + $LLVMGCCPATH = ""; } + if ($CONFIGUREARGS !~ /--disable-jit/) { $CONFIGUREARGS .= " --enable-jit"; } @@ -208,9 +224,9 @@ if ($CVSRootDir eq "" or 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 " . + die ("Please invoke NewNightlyTest.pl with command line option " . "\"-nickname \""); } @@ -225,7 +241,7 @@ if ($BUILDTYPE ne "release" && $BUILDTYPE ne "release-asserts") { ############################################################## my $Prefix = "$WebDir/$DATE"; my $BuildLog = "$Prefix-Build-Log.txt"; -my $CVSLog = "$Prefix-CVS-Log.txt"; +my $COLog = "$Prefix-CVS-Log.txt"; my $OldenTestsLog = "$Prefix-Olden-tests.txt"; my $SingleSourceLog = "$Prefix-SingleSource-ProgramTest.txt.gz"; my $MultiSourceLog = "$Prefix-MultiSource-ProgramTest.txt.gz"; @@ -242,11 +258,15 @@ if (! -d $WebDir) { if ($VERBOSE) { print "INITIALIZED\n"; - print "CVS Root = $CVSRootDir\n"; + if ($USESVN) { + print "SVN URL = $SVNURL\n"; + } else { + print "CVS Root = $CVSRootDir\n"; + } + print "COLog = $COLog\n"; print "BuildDir = $BuildDir\n"; print "WebDir = $WebDir\n"; print "Prefix = $Prefix\n"; - print "CVSLog = $CVSLog\n"; print "BuildLog = $BuildLog\n"; } @@ -289,7 +309,7 @@ sub DiffFiles { #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sub GetRegex { # (Regex with ()'s, value) $_[1] =~ /$_[0]/m; - return $1 + return $1 if (defined($1)); return "0"; } @@ -310,7 +330,7 @@ sub ChangeDir { # directory, logical name if ( $VERBOSE ) { print "Changing To: $name ($dir)\n"; } $result = chdir($dir); if (!$result) { - print "ERROR!!! Cannot change directory to: $name ($dir) because $!"; + print "ERROR!!! Cannot change directory to: $name ($dir) because $!"; return false; } return true; @@ -376,7 +396,7 @@ sub FormatTime { #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # -# This function is meant to read in the dejagnu sum file and +# This function is meant to read in the dejagnu sum file and # return a string with only the results (i.e. PASS/FAIL/XPASS/ # XFAIL). # @@ -420,7 +440,7 @@ sub SendData{ $port=80; $socketaddr= sockaddr_in $port, inet_aton $host or die "Bad hostname\n"; - socket SOCK, PF_INET, SOCK_STREAM, getprotobyname('tcp') or + socket SOCK, PF_INET, SOCK_STREAM, getprotobyname('tcp') or die "Bad socket\n"; connect SOCK, $socketaddr or die "Bad connection\n"; select((select(SOCK), $| = 1)[0]); @@ -436,6 +456,7 @@ sub SendData{ $length = length($content); my $send= "POST $file HTTP/1.0\n"; + $send.= "Host: $host\n"; $send.= "Content-Type: application/x-www-form-urlencoded\n"; $send.= "Content-length: $length\n\n"; $send.= "$content"; @@ -453,7 +474,7 @@ sub SendData{ $sentdata.= "$x => $value\n"; } WriteFile "$Prefix-sentdata.txt", $sentdata; - + return $result; } @@ -477,39 +498,48 @@ if (!$NOCHECKOUT) { print "Build directory exists! Removing it\n"; } system "rm -rf $BuildDir"; - mkdir $BuildDir or die "Could not create CVS checkout directory $BuildDir!"; + mkdir $BuildDir or die "Could not create checkout directory $BuildDir!"; } else { if ( $VERBOSE ) { print "Build directory exists!\n"; } } } else { - mkdir $BuildDir or die "Could not create CVS checkout directory $BuildDir!"; + mkdir $BuildDir or die "Could not create checkout directory $BuildDir!"; } } -ChangeDir( $BuildDir, "CVS checkout directory" ); +ChangeDir( $BuildDir, "checkout directory" ); ############################################################## # -# Check out the llvm tree, saving CVS messages to the cvs log... +# Check out the llvm tree, using either SVN or CVS # ############################################################## -my $CVSOPT = ""; -# Use compression if going over ssh. -$CVSOPT = "-z3" - if $CVSRootDir =~ /^:ext:/; -my $CVSCMD = "$NICE cvs $CVSOPT -d $CVSRootDir co -P $CVSCOOPT"; if (!$NOCHECKOUT) { - if ( $VERBOSE ) { - print "CHECKOUT STAGE:\n"; - print "( time -p $CVSCMD llvm; cd llvm/projects ; $CVSCMD llvm-test ) " . - "> $CVSLog 2>&1\n"; + if ( $VERBOSE ) { print "CHECKOUT STAGE:\n"; } + if ($USESVN) { + my $SVNCMD = "$NICE svn co $SVNURL"; + if ($VERBOSE) { + print "( time -p $SVNCMD/llvm/trunk llvm; cd llvm/projects ; " . + "$SVNCMD/test-suite/trunk llvm-test ) > $COLog 2>&1\n"; + } + system "( time -p $SVNCMD/llvm/trunk llvm; cd llvm/projects ; " . + "$SVNCMD/test-suite/trunk llvm-test ) > $COLog 2>&1\n"; + } else { + my $CVSOPT = ""; + $CVSOPT = "-z3" # Use compression if going over ssh. + if $CVSRootDir =~ /^:ext:/; + my $CVSCMD = "$NICE cvs $CVSOPT -d $CVSRootDir co -P $CVSCOOPT"; + if ($VERBOSE) { + print "( time -p $CVSCMD llvm; cd llvm/projects ; " . + "$CVSCMD llvm-test ) > $COLog 2>&1\n"; + } + system "( time -p $CVSCMD llvm; cd llvm/projects ; " . + "$CVSCMD llvm-test ) > $COLog 2>&1\n"; } - system "( time -p $CVSCMD llvm; cd llvm/projects ; " . - "$CVSCMD llvm-test ) > $CVSLog 2>&1"; - ChangeDir( $BuildDir , "CVS Checkout directory") ; } +ChangeDir( $BuildDir , "Checkout directory") ; ChangeDir( "llvm" , "llvm source directory") ; ############################################################## @@ -519,14 +549,20 @@ ChangeDir( "llvm" , "llvm source directory") ; # This can probably be put on the server side # ############################################################## -my $CVSCheckoutTime_Wall = GetRegex "([0-9.]+)", `grep '^real' $CVSLog`; -my $CVSCheckoutTime_User = GetRegex "([0-9.]+)", `grep '^user' $CVSLog`; -my $CVSCheckoutTime_Sys = GetRegex "([0-9.]+)", `grep '^sys' $CVSLog`; -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 $CheckoutTime_Wall = GetRegex "([0-9.]+)", `grep '^real' $COLog`; +my $CheckoutTime_User = GetRegex "([0-9.]+)", `grep '^user' $COLog`; +my $CheckoutTime_Sys = GetRegex "([0-9.]+)", `grep '^sys' $COLog`; +my $CheckoutTime_CPU = $CVSCheckoutTime_User + $CVSCheckoutTime_Sys; + +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; +} else { + $NumFilesInCVS = `egrep '^U' $COLog | wc -l` + 0; + $NumDirsInCVS = `egrep '^cvs (checkout|server|update):' $COLog | wc -l` + 0; +} ############################################################## # @@ -536,49 +572,112 @@ my $NumDirsInCVS = # ############################################################## -my (%AddedFiles, %ModifiedFiles, %RemovedFiles, %UsersCommitted, %UsersUpdated); - -if(!$NOCVSSTATS){ - - 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"; +# This just computes a reasonably accurate #of seconds since 2000. It doesn't +# have to be perfect as its only used for comparing date ranges within a couple +# of days. +sub ConvertToSeconds { + my ($sec, $min, $hour, $day, $mon, $yr) = @_; + my $Result = ($yr - 2000) * 12; + $Result += $mon; + $Result *= 31; + $Result += $day; + $Result *= 24; + $Result += $hour; + $Result *= 60; + $Result += $min; + $Result *= 60; + $Result += $sec; + return $Result; +} - my $DateRE = '[-/:0-9 ]+\+[0-9]+'; +my (%AddedFiles, %ModifiedFiles, %RemovedFiles, %UsersCommitted, %UsersUpdated); -# 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; +if (!$NOCVSSTATS) { + if ($VERBOSE) { print "CHANGE HISTORY ANALYSIS STAGE\n"; } + + if ($USESVN) { + @SVNHistory = split /(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})/){ + $Year = $1; $Month = $2; $Day = $3; $Hour = $4; $Min = $5; $Sec = $6; + } + my $Then = ConvertToSeconds($Sec, $Min, $Hour, $Day, $Month, $Year); + # Get the current date and compute when "yesterday" is. + my ($NSec, $NMin, $NHour, $NDay, $NMon, $NYear) = gmtime(); + my $Now = ConvertToSeconds( $NSec, $NMin, $NHour, $NDay, $NMon, $NYear); + if (($Now - 24*60*60) > $Then) { + 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; + if ($Lines[1] =~ / revision="([0-9]*)">/) { + $Revision = $1; + } + if ($Lines[2] =~ /([^<]*)<\/author>/) { + $Author = $1; + } + $UsersCommitted{$Author} = 1; + $Date = $Year . "-" . $Month . "-" . $Day; + $Time = $Hour . ":" . $Min . ":" . $Sec; + print "Rev: $Revision, Author: $Author, Date: $Date, Time: $Time\n"; + for ($i = 6; $i < $#Lines; $i += 2 ) { + if ($Lines[$i] =~ /^ action="(.)">([^<]*) $BuildLog 2>&1\n"; } - system "(time -p $NICE ./configure $CONFIGUREARGS $EXTRAFLAGS) " . + system "(time -p $NICE ./configure $CONFIGUREARGS $EXTRAFLAGS) " . "> $BuildLog 2>&1"; - if ( $VERBOSE ) { + if ( $VERBOSE ) { print "BUILD STAGE:\n"; print "(time -p $NICE $MAKECMD $MAKEOPTS) >> $BuildLog 2>&1\n"; } @@ -644,7 +743,6 @@ $BuildWallTime=-1 unless $BuildWallTime; my $BuildError = 0, $BuildStatus = "OK"; if ($NOBUILD) { $BuildStatus = "Skipped by user"; - $BuildError = 1; } elsif (`grep '^$MAKECMD\[^:]*: .*Error' $BuildLog | wc -l` + 0 || `grep '^$MAKECMD: \*\*\*.*Stop.' $BuildLog | wc -l`+0) { @@ -657,7 +755,7 @@ if ($BuildError) { $NODEJAGNU=1; } my $a_file_sizes=""; my $o_file_sizes=""; if (!$BuildError) { - print "Organizing size of .o and .a files\n" + print "Organizing size of .o and .a files\n" if ( $VERBOSE ); ChangeDir( "$BuildDir/llvm", "Build Directory" ); $afiles.= `find utils/ -iname '*.a' -ls`; @@ -670,7 +768,7 @@ if (!$BuildError) { } 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`; @@ -681,7 +779,7 @@ if (!$BuildError) { } else { $ofiles.= `find Debug/ -iname '*.o' -ls`; } - + @AFILES = split "\n", $afiles; $a_file_sizes=""; foreach $x (@AFILES){ @@ -707,15 +805,15 @@ if (!$BuildError) { my $DejangnuTestResults=""; # String containing the results of the dejagnu my $dejagnu_output = "$DejagnuTestsLog"; if (!$NODEJAGNU) { - if($VERBOSE) { - print "DEJAGNU FEATURE/REGRESSION TEST STAGE:\n"; + 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); @@ -728,8 +826,8 @@ if (!$NODEJAGNU) { 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 = +$DejagnuWallTime = GetRegexNum "^real", 0,"([0-9.]+)","$dejagnu_output"; +$DejagnuTestResults = "Dejagnu skipped by user choice." unless $DejagnuTestResults; $DejagnuTime = "0.0" unless $DejagnuTime; $DejagnuWallTime = "0.0" unless $DejagnuWallTime; @@ -774,27 +872,27 @@ if (!$NODEJAGNU) { # # If we built the tree successfully, run the nightly programs tests... # -# A set of tests to run is passed in (i.e. "SingleSource" "MultiSource" +# 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", + 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) { + if( $VERBOSE) { print "$MAKECMD -k $MAKEOPTS $PROGTESTOPTS report.nightly.csv ". - "TEST=nightly > $ProgramTestLog 2>&1\n"; + "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`; - } + } my $ProgramsTable; if (`grep '^$MAKECMD\[^:]: .*Error' $ProgramTestLog | wc -l` + 0) { @@ -828,7 +926,7 @@ if (!$BuildError) { if ( $VERBOSE ) { print "SingleSource TEST STAGE\n"; } - ($SingleSourceProgramsTable, $llcbeta_options) = + ($SingleSourceProgramsTable, $llcbeta_options) = TestDirectory("SingleSource"); WriteFile "$Prefix-SingleSource-Performance.txt", $SingleSourceProgramsTable; if ( $VERBOSE ) { @@ -842,10 +940,10 @@ if (!$BuildError) { } ($ExternalProgramsTable, $llcbeta_options) = TestDirectory("External"); WriteFile "$Prefix-External-Performance.txt", $ExternalProgramsTable; - system "cat $Prefix-SingleSource-Tests.txt " . + system "cat $Prefix-SingleSource-Tests.txt " . "$Prefix-MultiSource-Tests.txt ". "$Prefix-External-Tests.txt | sort > $Prefix-Tests.txt"; - system "cat $Prefix-SingleSource-Performance.txt " . + system "cat $Prefix-SingleSource-Performance.txt " . "$Prefix-MultiSource-Performance.txt ". "$Prefix-External-Performance.txt | sort > $Prefix-Performance.txt"; } else { @@ -853,18 +951,18 @@ if (!$BuildError) { if ( $VERBOSE ) { print "External TEST STAGE SKIPPED\n"; } - system "cat $Prefix-SingleSource-Tests.txt " . + system "cat $Prefix-SingleSource-Tests.txt " . "$Prefix-MultiSource-Tests.txt ". " | sort > $Prefix-Tests.txt"; - system "cat $Prefix-SingleSource-Performance.txt " . + system "cat $Prefix-SingleSource-Performance.txt " . "$Prefix-MultiSource-Performance.txt ". " | sort > $Prefix-Performance.txt"; } ############################################################## # - # - # gathering tests added removed broken information here + # + # gathering tests added removed broken information here # # ############################################################## @@ -885,7 +983,7 @@ if (!$BuildError) { } } } - + } #end if !$BuildError @@ -908,16 +1006,16 @@ if (!$BuildError) { # Run the nightly test in this directory, with LARGE_PROBLEM_SIZE and # GET_STABLE_NUMBERS enabled! - if( $VERBOSE ) { + 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"; + "> /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"; - } + } } ############################################################## @@ -935,16 +1033,16 @@ $endtime = `date "+20%y-%m-%d %H:%M:%S"`; ############################################################## if ( $VERBOSE ) { print "PREPARING LOGS TO BE SENT TO SERVER\n"; } -$machine_data = "uname: ".`uname -a`. +$machine_data = "uname: ".`uname -a`. "hardware: ".`uname -m`. "os: ".`uname -sr`. "name: ".`uname -n`. "date: ".`date \"+20%y-%m-%d\"`. - "time: ".`date +\"%H:%M:%S\"`; + "time: ".`date +\"%H:%M:%S\"`; my @CVS_DATA; my $cvs_data; -@CVS_DATA = ReadFile "$CVSLog"; +@CVS_DATA = ReadFile "$COLog"; $cvs_data = join("\n", @CVS_DATA); my @BUILD_DATA; @@ -959,12 +1057,25 @@ my ($gcc_version, $gcc_version_long) = ""; $gcc_version_long=""; if ($GCCPATH ne "") { $gcc_version_long = `$GCCPATH/gcc --version`; +} elsif ($ENV{"CC"}) { + $gcc_version_long = `$ENV{"CC"} --version`; } else { $gcc_version_long = `gcc --version`; } @GCC_VERSION = split '\n', $gcc_version_long; $gcc_version = $GCC_VERSION[0]; +$llvmgcc_version_long=""; +if ($LLVMGCCPATH ne "") { + $llvmgcc_version_long = `$LLVMGCCPATH/llvm-gcc -v 2>&1`; +} else { + $llvmgcc_version_long = `llvm-gcc -v 2>&1`; +} +@LLVMGCC_VERSION = split '\n', $llvmgcc_version_long; +$llvmgcc_versionTarget = $LLVMGCC_VERSION[1]; +$llvmgcc_versionTarget =~ /Target: (.+)/; +$targetTriple = $1; + if(!$BuildError){ @DEJAGNU_LOG = ReadFile "$DejagnuLog"; @DEJAGNU_SUM = ReadFile "$DejagnuSum"; @@ -990,8 +1101,8 @@ my %hash_of_data = ( 'nickname' => $nickname, 'dejagnutime_wall' => $DejagnuWallTime, 'dejagnutime_cpu' => $DejagnuTime, - 'cvscheckouttime_wall' => $CVSCheckoutTime_Wall, - 'cvscheckouttime_cpu' => $CVSCheckoutTime_CPU, + 'cvscheckouttime_wall' => $CheckoutTime_Wall, + 'cvscheckouttime_cpu' => $CheckoutTime_CPU, 'configtime_wall' => $ConfigWallTime, 'configtime_cpu'=> $ConfigTime, 'buildtime_wall' => $BuildWallTime, @@ -1023,19 +1134,18 @@ my %hash_of_data = ( 'starttime' => $starttime, 'endtime' => $endtime, 'o_file_sizes' => $o_file_sizes, - 'a_file_sizes' => $a_file_sizes + 'a_file_sizes' => $a_file_sizes, + '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"; } } ############################################################## @@ -1043,7 +1153,7 @@ if ($TESTING) { # Remove the cvs tree... # ############################################################## -system ( "$NICE rm -rf $BuildDir") +system ( "$NICE rm -rf $BuildDir") if (!$NOCHECKOUT and !$NOREMOVE); -system ( "$NICE rm -rf $WebDir") +system ( "$NICE rm -rf $WebDir") if (!$NOCHECKOUT and !$NOREMOVE and !$NOREMOVERESULTS);