forked from OSchip/llvm-project
NNT: Move source checkout code into subroutine.
llvm-svn: 84489
This commit is contained in:
parent
47d021bc25
commit
98d5036183
|
@ -546,57 +546,39 @@ $starttime = `date "+20%y-%m-%d %H:%M:%S"`;
|
||||||
# Create the source repository directory
|
# Create the source repository directory
|
||||||
#
|
#
|
||||||
##############################################################
|
##############################################################
|
||||||
if (!$NOCHECKOUT) {
|
sub CheckoutSource {
|
||||||
if (-d $BuildDir) {
|
if (!$NOCHECKOUT) {
|
||||||
if (!$NOREMOVE) {
|
if (-d $BuildDir) {
|
||||||
if ( $VERBOSE ) {
|
if (!$NOREMOVE) {
|
||||||
print "Build directory exists! Removing it\n";
|
if ( $VERBOSE ) {
|
||||||
|
print "Build directory exists! Removing it\n";
|
||||||
|
}
|
||||||
|
system "rm -rf $BuildDir";
|
||||||
|
mkdir $BuildDir or die "Could not create checkout directory $BuildDir!";
|
||||||
|
} else {
|
||||||
|
if ( $VERBOSE ) {
|
||||||
|
print "Build directory exists!\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
system "rm -rf $BuildDir";
|
|
||||||
mkdir $BuildDir or die "Could not create checkout directory $BuildDir!";
|
|
||||||
} else {
|
} else {
|
||||||
if ( $VERBOSE ) {
|
mkdir $BuildDir or die "Could not create checkout directory $BuildDir!";
|
||||||
print "Build directory exists!\n";
|
}
|
||||||
}
|
|
||||||
|
ChangeDir( $BuildDir, "checkout directory" );
|
||||||
|
my $SVNCMD = "$NICE svn co --non-interactive";
|
||||||
|
RunLoggedCommand("( time -p $SVNCMD $SVNURL/llvm/trunk llvm; cd llvm/projects ; " .
|
||||||
|
" $SVNCMD $TestSVNURL/test-suite/trunk llvm-test )", $COLog,
|
||||||
|
"CHECKOUT LLVM");
|
||||||
|
if ($WITHCLANG) {
|
||||||
|
RunLoggedCommand("( cd llvm/tools ; " .
|
||||||
|
" $SVNCMD $SVNURL/cfe/trunk clang )", $COLog,
|
||||||
|
"CHECKOUT CLANG");
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
mkdir $BuildDir or die "Could not create checkout directory $BuildDir!";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
##############################################################
|
|
||||||
#
|
|
||||||
# Check out the llvm tree with SVN
|
|
||||||
#
|
|
||||||
##############################################################
|
|
||||||
if (!$NOCHECKOUT) {
|
|
||||||
ChangeDir( $BuildDir, "checkout directory" );
|
|
||||||
my $SVNCMD = "$NICE svn co --non-interactive $SVNURL";
|
|
||||||
my $SVNCMD2 = "$NICE svn co --non-interactive $TestSVNURL";
|
|
||||||
RunLoggedCommand("( time -p $SVNCMD/llvm/trunk llvm; cd llvm/projects ; " .
|
|
||||||
"$SVNCMD2/test-suite/trunk llvm-test )", $COLog,
|
|
||||||
"CHECKOUT LLVM");
|
|
||||||
if ($WITHCLANG) {
|
|
||||||
my $SVNCMD = "$NICE svn co --non-interactive $SVNURL/cfe/trunk";
|
|
||||||
RunLoggedCommand("( time -p cd llvm/tools ; $SVNCMD clang )", $COLog,
|
|
||||||
"CHECKOUT CLANG");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
CheckoutSource();
|
||||||
ChangeDir( $LLVMSrcDir , "llvm source directory") ;
|
ChangeDir( $LLVMSrcDir , "llvm source directory") ;
|
||||||
|
|
||||||
##############################################################
|
|
||||||
#
|
|
||||||
# Get some static statistics about the current source code
|
|
||||||
#
|
|
||||||
# This can probably be put on the server side
|
|
||||||
#
|
|
||||||
##############################################################
|
|
||||||
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;
|
|
||||||
|
|
||||||
##############################################################
|
##############################################################
|
||||||
#
|
#
|
||||||
# Build the entire tree, saving build messages to the build log
|
# Build the entire tree, saving build messages to the build log
|
||||||
|
@ -651,7 +633,7 @@ if ($BuildError) { $NODEJAGNU=1; }
|
||||||
# Running dejagnu tests
|
# Running dejagnu tests
|
||||||
#
|
#
|
||||||
##############################################################
|
##############################################################
|
||||||
my $DejangnuTestResults=""; # String containing the results of the dejagnu
|
my $DejagnuTestResults=""; # String containing the results of the dejagnu
|
||||||
my $dejagnu_output = "$DejagnuTestsLog";
|
my $dejagnu_output = "$DejagnuTestsLog";
|
||||||
if (!$NODEJAGNU) {
|
if (!$NODEJAGNU) {
|
||||||
#Run the feature and regression tests, results are put into testrun.sum
|
#Run the feature and regression tests, results are put into testrun.sum
|
||||||
|
@ -813,11 +795,6 @@ $machine_data = "uname: ".`uname -a`.
|
||||||
"date: ".`date \"+20%y-%m-%d\"`.
|
"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 "$COLog";
|
|
||||||
$cvs_data = join("\n", @CVS_DATA);
|
|
||||||
|
|
||||||
my @BUILD_DATA;
|
my @BUILD_DATA;
|
||||||
my $build_data;
|
my $build_data;
|
||||||
@BUILD_DATA = ReadFile "$BuildLog";
|
@BUILD_DATA = ReadFile "$BuildLog";
|
||||||
|
@ -867,6 +844,11 @@ if(!$BuildError){
|
||||||
|
|
||||||
if ( $VERBOSE ) { print "SEND THE DATA VIA THE POST REQUEST\n"; }
|
if ( $VERBOSE ) { print "SEND THE DATA VIA THE POST REQUEST\n"; }
|
||||||
|
|
||||||
|
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 %hash_of_data = (
|
my %hash_of_data = (
|
||||||
'machine_data' => $machine_data,
|
'machine_data' => $machine_data,
|
||||||
'build_data' => $build_data,
|
'build_data' => $build_data,
|
||||||
|
|
Loading…
Reference in New Issue