# override the default.
# -ldflags Next argument specifies that linker options that override
# the default.
+# -test-cflags Next argument specifies that C compilation options that
+# override the default when running the testsuite.
+# -test-cxxflags Next argument specifies that C++ compilation options that
+# override the default when running the testsuite.
# -compileflags Next argument specifies extra options passed to make when
# building LLVM.
# -use-gmake Use gmake instead of the default make command to build
my $SVNURL = $ENV{"SVNURL"};
$SVNURL = 'http://llvm.org/svn/llvm-project' unless $SVNURL;
my $TestSVNURL = $ENV{"TestSVNURL"};
-$TestSVNURL = 'https://llvm.org/svn/llvm-project' unless $TestSVNURL;
+$TestSVNURL = 'http://llvm.org/svn/llvm-project' unless $TestSVNURL;
my $CVSRootDir = $ENV{'CVSROOT'};
$CVSRootDir = "/home/vadve/shared/PublicCVS" unless $CVSRootDir;
my $BuildDir = $ENV{'BUILDDIR'};
#
##############################################################
@TIME = localtime;
-my $DATE = sprintf "%4d-%02d-%02d", $TIME[5]+1900, $TIME[4]+1, $TIME[3];
-my $DateString = strftime "%B %d, %Y", localtime;
-my $TestStartTime = gmtime() . "GMT<br>" . localtime() . " (local)";
+my $DATE = sprintf "%4d-%02d-%02d_%02d-%02d", $TIME[5]+1900, $TIME[4]+1, $TIME[3], $TIME[1], $TIME[0];
##############################################################
#
$SUBMITAUX="";
$SUBMIT = 1;
$PARALLELJOBS = "2";
+my $TESTFLAGS="";
while (scalar(@ARGV) and ($_ = $ARGV[0], /^[-+]/)) {
shift;
if (/^-nocheckout$/) { $NOCHECKOUT = 1; next; }
if (/^-nocvsstats$/) { $NOCVSSTATS = 1; next; }
if (/^-noremove$/) { $NOREMOVE = 1; next; }
+ if (/^-noremoveatend$/) { $NOREMOVEATEND = 1; next; }
if (/^-noremoveresults$/){ $NOREMOVERESULTS = 1; next; }
if (/^-notest$/) { $NOTEST = 1; next; }
if (/^-norunningtests$/) { next; } # Backward compatibility, ignored.
shift; next; }
if (/^-with-externals$/) { $CONFIGUREARGS .= " --with-externals=$ARGV[0]";
shift; next; }
+ if (/^-configure-args$/) { $CONFIGUREARGS .= " $ARGV[0]";
+ shift; next; }
if (/^-submit-server/) { $SUBMITSERVER = "$ARGV[0]"; shift; next; }
if (/^-submit-script/) { $SUBMITSCRIPT = "$ARGV[0]"; shift; next; }
if (/^-submit-aux/) { $SUBMITAUX = "$ARGV[0]"; shift; next; }
shift; next; }
if (/^-ldflags/) { $MAKEOPTS = "$MAKEOPTS LD.Flags=\'$ARGV[0]\'";
shift; next; }
+ if (/^-test-cflags/) { $TESTFLAGS = "$TESTFLAGS CFLAGS=\'$ARGV[0]\'";
+ shift; next; }
+ if (/^-test-cxxflags/) { $TESTFLAGS = "$TESTFLAGS CXXFLAGS=\'$ARGV[0]\'";
+ shift; next; }
if (/^-compileflags/) { $MAKEOPTS = "$MAKEOPTS $ARGV[0]"; shift; next; }
if (/^-use-gmake/) { $MAKECMD = "gmake"; shift; next; }
if (/^-extraflags/) { $CONFIGUREARGS .=
sub RunLoggedCommand {
my $Command = shift;
my $Log = shift;
+ my $Title = shift;
if ($TEELOGS) {
+ if ($VERBOSE) {
+ print "$Title\n";
+ print "$Command 2>&1 | tee $Log\n";
+ }
system "$Command 2>&1 | tee $Log";
} else {
+ if ($VERBOSE) {
+ print "$Title\n";
+ print "$Command 2>&1 > $Log\n";
+ }
system "$Command 2>&1 > $Log";
}
}
sub RunAppendingLoggedCommand {
my $Command = shift;
my $Log = shift;
+ my $Title = shift;
if ($TEELOGS) {
+ if ($VERBOSE) {
+ print "$Title\n";
+ print "$Command 2>&1 | tee -a $Log\n";
+ }
system "$Command 2>&1 | tee -a $Log";
} else {
- system "$Command 2>&1 > $Log";
+ if ($VERBOSE) {
+ print "$Title\n";
+ print "$Command 2>&1 > $Log\n";
+ }
+ system "$Command 2>&1 >> $Log";
}
}
WriteFile "$Prefix-sentdata.txt", $sentdata;
if (!($SUBMITAUX eq "")) {
- system "$SUBMITAUX \"$Prefix-sentdata.txt\"";
+ system "$SUBMITAUX \"$Prefix-sentdata.txt\"";
+ }
+
+ if (!$SUBMIT) {
+ return "Skipped standard submit.\n";
}
# Create the content to send to the server.
##############################################################
if (!$NOCHECKOUT) {
ChangeDir( $BuildDir, "checkout directory" );
- if ( $VERBOSE ) { print "CHECKOUT STAGE:\n"; }
if ($USESVN) {
my $SVNCMD = "$NICE svn co --non-interactive $SVNURL";
my $SVNCMD2 = "$NICE svn co --non-interactive $TestSVNURL";
- if ($VERBOSE) {
- print "( time -p $SVNCMD/llvm/trunk llvm; cd llvm/projects ; " .
- "$SVNCMD2/test-suite/trunk llvm-test ) > $COLog 2>&1\n";
- }
RunLoggedCommand("( time -p $SVNCMD/llvm/trunk llvm; cd llvm/projects ; " .
- "$SVNCMD2/test-suite/trunk llvm-test )", $COLog);
+ "$SVNCMD2/test-suite/trunk llvm-test )", $COLog,
+ "CHECKOUT LLVM");
if ($WITHCLANG) {
my $SVNCMD = "$NICE svn co --non-interactive $SVNURL/cfe/trunk";
- if ($VERBOSE) {
- print "( time -p cd llvm/tools ; $SVNCMD clang ) > $COLog 2>&1\n";
- }
- RunLoggedCommand("( time -p cd llvm/tools ; $SVNCMD clang )", $COLog);
+ RunLoggedCommand("( time -p cd llvm/tools ; $SVNCMD clang )", $COLog,
+ "CHECKOUT CLANG");
}
} 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";
- }
RunLoggedCommand("( time -p $CVSCMD llvm; cd llvm/projects ; " .
- "$CVSCMD llvm-test )", $COLog);
+ "$CVSCMD llvm-test )", $COLog,
+ "CHECKOUT LLVM-TEST");
}
}
ChangeDir( $LLVMSrcDir , "llvm source directory") ;
##############################################################
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";
- }
RunLoggedCommand("(time -p $NICE ./configure $CONFIGUREARGS $EXTRAFLAGS) ",
- $BuildLog);
- if ( $VERBOSE ) {
- print "BUILD STAGE:\n";
- print "(time -p $NICE $MAKECMD clean) >> $BuildLog 2>&1\n";
- print "(time -p $NICE $MAKECMD $MAKEOPTS) >> $BuildLog 2>&1\n";
- }
+ $BuildLog, "CONFIGURE");
# Build the entire tree, capturing the output into $BuildLog
- RunAppendingLoggedCommand("(time -p $NICE $MAKECMD clean)", $BuildLog);
- RunAppendingLoggedCommand("(time -p $NICE $MAKECMD $MAKEOPTS)", $BuildLog);
+ RunAppendingLoggedCommand("(time -p $NICE $MAKECMD clean)", $BuildLog, "BUILD CLEAN");
+ RunAppendingLoggedCommand("(time -p $NICE $MAKECMD $MAKEOPTS)", $BuildLog, "BUILD");
}
##############################################################
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";
- }
-
#Run the feature and regression tests, results are put into testrun.sum
#Full log in testrun.log
- RunLoggedCommand("(time -p $MAKECMD $MAKEOPTS check)", $dejagnu_output);
+ RunLoggedCommand("(time -p $MAKECMD $MAKEOPTS check)", $dejagnu_output, "DEJAGNU");
#Copy the testrun.log and testrun.sum to our webdir
CopyFile("test/testrun.log", $DejagnuLog);
if (!$NOTEST) {
if( $VERBOSE) {
print "$MAKECMD -k $MAKEOPTS $PROGTESTOPTS report.nightly.csv ".
- "TEST=nightly > $ProgramTestLog 2>&1\n";
+ "$TESTFLAGS TEST=nightly > $ProgramTestLog 2>&1\n";
}
RunLoggedCommand("$MAKECMD -k $MAKEOPTS $PROGTESTOPTS report.nightly.csv ".
- "TEST=nightly", $ProgramTestLog);
+ "$TESTFLAGS TEST=nightly",
+ $ProgramTestLog, "TEST DIRECTORY $SubDir");
$llcbeta_options=`$MAKECMD print-llcbeta-option`;
}
#
##############################################################
if (!$BuildError) {
- if ( $VERBOSE ) {
- print "SingleSource TEST STAGE\n";
- }
($SingleSourceProgramsTable, $llcbeta_options) =
TestDirectory("SingleSource");
WriteFile "$Prefix-SingleSource-Performance.txt", $SingleSourceProgramsTable;
- if ( $VERBOSE ) {
- print "MultiSource TEST STAGE\n";
- }
($MultiSourceProgramsTable, $llcbeta_options) = TestDirectory("MultiSource");
WriteFile "$Prefix-MultiSource-Performance.txt", $MultiSourceProgramsTable;
if ( ! $NOEXTERNALS ) {
- if ( $VERBOSE ) {
- print "External TEST STAGE\n";
- }
($ExternalProgramsTable, $llcbeta_options) = TestDirectory("External");
WriteFile "$Prefix-External-Performance.txt", $ExternalProgramsTable;
system "cat $Prefix-SingleSource-Tests.txt " .
'target_triple' => $targetTriple
);
-if ($SUBMIT) {
+if ($SUBMIT || !($SUBMITAUX eq "")) {
my $response = SendData $SUBMITSERVER,$SUBMITSCRIPT,\%hash_of_data;
if( $VERBOSE) { print "============================\n$response"; }
} else {
#
##############################################################
system ( "$NICE rm -rf $BuildDir")
- if (!$NOCHECKOUT and !$NOREMOVE);
+ if (!$NOCHECKOUT and !$NOREMOVE and !$NOREMOVEATEND);
system ( "$NICE rm -rf $WebDir")
if (!$NOCHECKOUT and !$NOREMOVE and !$NOREMOVERESULTS);