mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-07-22 09:29:31 +00:00
NNT: Lift conditional logic out of test steps.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84494 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
5381eb72e6
commit
1409c131b6
@ -499,7 +499,6 @@ sub SendData {
|
|||||||
|
|
||||||
# Create the source repository directory.
|
# Create the source repository directory.
|
||||||
sub CheckoutSource {
|
sub CheckoutSource {
|
||||||
if (!$NOCHECKOUT) {
|
|
||||||
if (-d $BuildDir) {
|
if (-d $BuildDir) {
|
||||||
if (!$NOREMOVE) {
|
if (!$NOREMOVE) {
|
||||||
if ( $VERBOSE ) {
|
if ( $VERBOSE ) {
|
||||||
@ -526,51 +525,37 @@ sub CheckoutSource {
|
|||||||
" $SVNCMD $SVNURL/cfe/trunk clang )", $COLog,
|
" $SVNCMD $SVNURL/cfe/trunk clang )", $COLog,
|
||||||
"CHECKOUT CLANG");
|
"CHECKOUT CLANG");
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Build the entire tree, saving build messages to the build log.
|
# Build the entire tree, saving build messages to the build log. Returns false
|
||||||
|
# on build failure.
|
||||||
sub BuildLLVM {
|
sub BuildLLVM {
|
||||||
if (!$NOCHECKOUT && !$NOBUILD) {
|
|
||||||
my $EXTRAFLAGS = "--enable-spec --with-objroot=.";
|
my $EXTRAFLAGS = "--enable-spec --with-objroot=.";
|
||||||
RunLoggedCommand("(time -p $NICE ./configure $CONFIGUREARGS $EXTRAFLAGS) ",
|
RunLoggedCommand("(time -p $NICE ./configure $CONFIGUREARGS $EXTRAFLAGS) ",
|
||||||
$ConfigureLog, "CONFIGURE");
|
$ConfigureLog, "CONFIGURE");
|
||||||
# Build the entire tree, capturing the output into $BuildLog
|
# Build the entire tree, capturing the output into $BuildLog
|
||||||
RunAppendingLoggedCommand("($NICE $MAKECMD clean)", $BuildLog, "BUILD CLEAN");
|
RunAppendingLoggedCommand("($NICE $MAKECMD clean)", $BuildLog, "BUILD CLEAN");
|
||||||
RunAppendingLoggedCommand("(time -p $NICE $MAKECMD $MAKEOPTS)", $BuildLog, "BUILD");
|
RunAppendingLoggedCommand("(time -p $NICE $MAKECMD $MAKEOPTS)", $BuildLog, "BUILD");
|
||||||
|
|
||||||
|
if (`grep '^$MAKECMD\[^:]*: .*Error' $BuildLog | wc -l` + 0 ||
|
||||||
|
`grep '^$MAKECMD: \*\*\*.*Stop.' $BuildLog | wc -l` + 0) {
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Check for build error.
|
return 1;
|
||||||
my $HadError = 0, $Status = "OK";
|
|
||||||
if ($NOBUILD) {
|
|
||||||
$Status = "Skipped by user";
|
|
||||||
}
|
|
||||||
elsif (`grep '^$MAKECMD\[^:]*: .*Error' $BuildLog | wc -l` + 0 ||
|
|
||||||
`grep '^$MAKECMD: \*\*\*.*Stop.' $BuildLog | wc -l`+0) {
|
|
||||||
$Status = "Error: compilation aborted";
|
|
||||||
$HadError = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return ($HadError, $Status);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Running dejagnu tests and save results to log.
|
# Running dejagnu tests and save results to log.
|
||||||
sub RunDejaGNUTests {
|
sub RunDejaGNUTests {
|
||||||
my $Res = "Dejagnu skipped by user choice.";
|
# Run the feature and regression tests, results are put into testrun.sum and
|
||||||
|
# the full log in testrun.log.
|
||||||
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");
|
RunLoggedCommand("(time -p $MAKECMD $MAKEOPTS check)", $DejagnuLog, "DEJAGNU");
|
||||||
|
|
||||||
#Copy the testrun.log and testrun.sum to our webdir
|
# Copy the testrun.log and testrun.sum to our webdir.
|
||||||
CopyFile("test/testrun.log", $DejagnuLog);
|
CopyFile("test/testrun.log", $DejagnuLog);
|
||||||
CopyFile("test/testrun.sum", $DejagnuSum);
|
CopyFile("test/testrun.sum", $DejagnuSum);
|
||||||
|
|
||||||
$Res = GetDejagnuTestResults($DejagnuSum, $DejagnuLog);
|
return GetDejagnuTestResults($DejagnuSum, $DejagnuLog);
|
||||||
}
|
|
||||||
|
|
||||||
return $Res;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Run the named tests (i.e. "SingleSource" "MultiSource" "External")
|
# Run the named tests (i.e. "SingleSource" "MultiSource" "External")
|
||||||
@ -581,9 +566,8 @@ sub TestDirectory {
|
|||||||
|
|
||||||
my $ProgramTestLog = "$Prefix-$SubDir-ProgramTest.txt";
|
my $ProgramTestLog = "$Prefix-$SubDir-ProgramTest.txt";
|
||||||
|
|
||||||
# Run the programs tests... creating a report.nightly.csv file
|
# Run the programs tests... creating a report.nightly.csv file.
|
||||||
my $LLCBetaOpts = "";
|
my $LLCBetaOpts = "";
|
||||||
if (!$NOTEST) {
|
|
||||||
if( $VERBOSE) {
|
if( $VERBOSE) {
|
||||||
print "$MAKECMD -k $MAKEOPTS $PROGTESTOPTS report.nightly.csv ".
|
print "$MAKECMD -k $MAKEOPTS $PROGTESTOPTS report.nightly.csv ".
|
||||||
"$TESTFLAGS TEST=nightly > $ProgramTestLog 2>&1\n";
|
"$TESTFLAGS TEST=nightly > $ProgramTestLog 2>&1\n";
|
||||||
@ -592,22 +576,16 @@ sub TestDirectory {
|
|||||||
"$TESTFLAGS TEST=nightly",
|
"$TESTFLAGS TEST=nightly",
|
||||||
$ProgramTestLog, "TEST DIRECTORY $SubDir");
|
$ProgramTestLog, "TEST DIRECTORY $SubDir");
|
||||||
$LLCBetaOpts = `$MAKECMD print-llcbeta-option`;
|
$LLCBetaOpts = `$MAKECMD print-llcbeta-option`;
|
||||||
}
|
|
||||||
|
|
||||||
my $ProgramsTable;
|
my $ProgramsTable;
|
||||||
if (`grep '^$MAKECMD\[^:]: .*Error' $ProgramTestLog | wc -l` + 0) {
|
if (`grep '^$MAKECMD\[^:]: .*Error' $ProgramTestLog | wc -l` + 0) {
|
||||||
$TestError = 1;
|
|
||||||
$ProgramsTable="Error running test $SubDir\n";
|
$ProgramsTable="Error running test $SubDir\n";
|
||||||
print "ERROR TESTING\n";
|
print "ERROR TESTING\n";
|
||||||
} elsif (`grep '^$MAKECMD\[^:]: .*No rule to make target' $ProgramTestLog | wc -l` + 0) {
|
} elsif (`grep '^$MAKECMD\[^:]: .*No rule to make target' $ProgramTestLog | wc -l` + 0) {
|
||||||
$TestError = 1;
|
|
||||||
$ProgramsTable="Makefile error running tests $SubDir!\n";
|
$ProgramsTable="Makefile error running tests $SubDir!\n";
|
||||||
print "ERROR TESTING\n";
|
print "ERROR TESTING\n";
|
||||||
} else {
|
} else {
|
||||||
$TestError = 0;
|
|
||||||
#
|
|
||||||
# Create a list of the tests which were run...
|
# Create a list of the tests which were run...
|
||||||
#
|
|
||||||
system "egrep 'TEST-(PASS|FAIL)' < $ProgramTestLog ".
|
system "egrep 'TEST-(PASS|FAIL)' < $ProgramTestLog ".
|
||||||
"| sort > $Prefix-$SubDir-Tests.txt";
|
"| sort > $Prefix-$SubDir-Tests.txt";
|
||||||
}
|
}
|
||||||
@ -620,7 +598,6 @@ sub TestDirectory {
|
|||||||
# Run all the nightly tests and return the program tables and the number of
|
# Run all the nightly tests and return the program tables and the number of
|
||||||
# passes, fails, and xfails.
|
# passes, fails, and xfails.
|
||||||
sub RunNightlyTest() {
|
sub RunNightlyTest() {
|
||||||
if (!$BuildError) {
|
|
||||||
($SSProgs, $llcbeta_options) = TestDirectory("SingleSource");
|
($SSProgs, $llcbeta_options) = TestDirectory("SingleSource");
|
||||||
WriteFile "$Prefix-SingleSource-Performance.txt", $SSProgs;
|
WriteFile "$Prefix-SingleSource-Performance.txt", $SSProgs;
|
||||||
($MSProgs, $llcbeta_options) = TestDirectory("MultiSource");
|
($MSProgs, $llcbeta_options) = TestDirectory("MultiSource");
|
||||||
@ -662,7 +639,6 @@ sub RunNightlyTest() {
|
|||||||
$XFails .= "$TestSuiteResultLines[$x]\n";
|
$XFails .= "$TestSuiteResultLines[$x]\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return ($SSProgs, $MSProgs, $ExtProgs, $Passes, $Fails, $XFails);
|
return ($SSProgs, $MSProgs, $ExtProgs, $Passes, $Fails, $XFails);
|
||||||
}
|
}
|
||||||
@ -675,16 +651,37 @@ sub RunNightlyTest() {
|
|||||||
|
|
||||||
$starttime = `date "+20%y-%m-%d %H:%M:%S"`;
|
$starttime = `date "+20%y-%m-%d %H:%M:%S"`;
|
||||||
|
|
||||||
CheckoutSource();
|
if (!$NOCHECKOUT) {
|
||||||
ChangeDir( $LLVMSrcDir , "llvm source directory") ;
|
CheckoutSource();
|
||||||
($BuildError, $BuildStatus) = BuildLLVM();
|
|
||||||
if ($BuildError) {
|
|
||||||
if( $VERBOSE) { print "\n***ERROR BUILDING TREE\n\n"; }
|
|
||||||
$NODEJAGNU=1;
|
|
||||||
}
|
}
|
||||||
my $DejagnuTestResults = RunDejaGNUTests();
|
|
||||||
|
# Build LLVM.
|
||||||
|
my $BuildError = 0, $BuildStatus = "OK";
|
||||||
|
ChangeDir( $LLVMSrcDir , "llvm source directory") ;
|
||||||
|
if ($NOCHECKOUT || $NOBUILD) {
|
||||||
|
$BuildStatus = "Skipped by user";
|
||||||
|
} else {
|
||||||
|
if (!BuildLLVM()) {
|
||||||
|
if( $VERBOSE) { print "\n***ERROR BUILDING TREE\n\n"; }
|
||||||
|
$BuildError = 1;
|
||||||
|
$BuildStatus = "Error: compilation aborted";
|
||||||
|
$NODEJAGNU=1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Run DejaGNU.
|
||||||
|
my $DejagnuTestResults = "Dejagnu skipped by user choice.";
|
||||||
|
if (!$NODEJAGNU && !$BuildError) {
|
||||||
|
$DejagnuTestResults = RunDejaGNUTests();
|
||||||
|
}
|
||||||
|
|
||||||
|
# Run the llvm-test tests.
|
||||||
my ($SingleSourceProgramsTable, $MultiSourceProgramsTable, $ExternalProgramsTable,
|
my ($SingleSourceProgramsTable, $MultiSourceProgramsTable, $ExternalProgramsTable,
|
||||||
|
$passes, $fails, $xfails) = "";
|
||||||
|
if (!$NOTEST && !$BuildError) {
|
||||||
|
($SingleSourceProgramsTable, $MultiSourceProgramsTable, $ExternalProgramsTable,
|
||||||
$passes, $fails, $xfails) = RunNightlyTest();
|
$passes, $fails, $xfails) = RunNightlyTest();
|
||||||
|
}
|
||||||
|
|
||||||
$endtime = `date "+20%y-%m-%d %H:%M:%S"`;
|
$endtime = `date "+20%y-%m-%d %H:%M:%S"`;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user