mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-07-08 18:30:04 +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.
|
||||
sub CheckoutSource {
|
||||
if (!$NOCHECKOUT) {
|
||||
if (-d $BuildDir) {
|
||||
if (!$NOREMOVE) {
|
||||
if ( $VERBOSE ) {
|
||||
@ -527,50 +526,36 @@ sub CheckoutSource {
|
||||
"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 {
|
||||
if (!$NOCHECKOUT && !$NOBUILD) {
|
||||
my $EXTRAFLAGS = "--enable-spec --with-objroot=.";
|
||||
RunLoggedCommand("(time -p $NICE ./configure $CONFIGUREARGS $EXTRAFLAGS) ",
|
||||
$ConfigureLog, "CONFIGURE");
|
||||
# Build the entire tree, capturing the output into $BuildLog
|
||||
RunAppendingLoggedCommand("($NICE $MAKECMD clean)", $BuildLog, "BUILD CLEAN");
|
||||
RunAppendingLoggedCommand("(time -p $NICE $MAKECMD $MAKEOPTS)", $BuildLog, "BUILD");
|
||||
}
|
||||
|
||||
# Check for build error.
|
||||
my $HadError = 0, $Status = "OK";
|
||||
if ($NOBUILD) {
|
||||
$Status = "Skipped by user";
|
||||
}
|
||||
elsif (`grep '^$MAKECMD\[^:]*: .*Error' $BuildLog | wc -l` + 0 ||
|
||||
if (`grep '^$MAKECMD\[^:]*: .*Error' $BuildLog | wc -l` + 0 ||
|
||||
`grep '^$MAKECMD: \*\*\*.*Stop.' $BuildLog | wc -l` + 0) {
|
||||
$Status = "Error: compilation aborted";
|
||||
$HadError = 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return ($HadError, $Status);
|
||||
return 1;
|
||||
}
|
||||
|
||||
# Running dejagnu tests and save results to log.
|
||||
sub RunDejaGNUTests {
|
||||
my $Res = "Dejagnu skipped by user choice.";
|
||||
|
||||
if (!$NODEJAGNU) {
|
||||
#Run the feature and regression tests, results are put into testrun.sum
|
||||
#Full log in testrun.log
|
||||
# Run the feature and regression tests, results are put into testrun.sum and
|
||||
# the full log in testrun.log.
|
||||
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.sum", $DejagnuSum);
|
||||
|
||||
$Res = GetDejagnuTestResults($DejagnuSum, $DejagnuLog);
|
||||
}
|
||||
|
||||
return $Res;
|
||||
return GetDejagnuTestResults($DejagnuSum, $DejagnuLog);
|
||||
}
|
||||
|
||||
# Run the named tests (i.e. "SingleSource" "MultiSource" "External")
|
||||
@ -581,9 +566,8 @@ sub TestDirectory {
|
||||
|
||||
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 = "";
|
||||
if (!$NOTEST) {
|
||||
if( $VERBOSE) {
|
||||
print "$MAKECMD -k $MAKEOPTS $PROGTESTOPTS report.nightly.csv ".
|
||||
"$TESTFLAGS TEST=nightly > $ProgramTestLog 2>&1\n";
|
||||
@ -592,22 +576,16 @@ sub TestDirectory {
|
||||
"$TESTFLAGS TEST=nightly",
|
||||
$ProgramTestLog, "TEST DIRECTORY $SubDir");
|
||||
$LLCBetaOpts = `$MAKECMD print-llcbeta-option`;
|
||||
}
|
||||
|
||||
my $ProgramsTable;
|
||||
if (`grep '^$MAKECMD\[^:]: .*Error' $ProgramTestLog | wc -l` + 0) {
|
||||
$TestError = 1;
|
||||
$ProgramsTable="Error running test $SubDir\n";
|
||||
print "ERROR TESTING\n";
|
||||
} elsif (`grep '^$MAKECMD\[^:]: .*No rule to make target' $ProgramTestLog | wc -l` + 0) {
|
||||
$TestError = 1;
|
||||
$ProgramsTable="Makefile error running tests $SubDir!\n";
|
||||
print "ERROR TESTING\n";
|
||||
} else {
|
||||
$TestError = 0;
|
||||
#
|
||||
# Create a list of the tests which were run...
|
||||
#
|
||||
system "egrep 'TEST-(PASS|FAIL)' < $ProgramTestLog ".
|
||||
"| 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
|
||||
# passes, fails, and xfails.
|
||||
sub RunNightlyTest() {
|
||||
if (!$BuildError) {
|
||||
($SSProgs, $llcbeta_options) = TestDirectory("SingleSource");
|
||||
WriteFile "$Prefix-SingleSource-Performance.txt", $SSProgs;
|
||||
($MSProgs, $llcbeta_options) = TestDirectory("MultiSource");
|
||||
@ -662,7 +639,6 @@ sub RunNightlyTest() {
|
||||
$XFails .= "$TestSuiteResultLines[$x]\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ($SSProgs, $MSProgs, $ExtProgs, $Passes, $Fails, $XFails);
|
||||
}
|
||||
@ -675,16 +651,37 @@ sub RunNightlyTest() {
|
||||
|
||||
$starttime = `date "+20%y-%m-%d %H:%M:%S"`;
|
||||
|
||||
if (!$NOCHECKOUT) {
|
||||
CheckoutSource();
|
||||
}
|
||||
|
||||
# Build LLVM.
|
||||
my $BuildError = 0, $BuildStatus = "OK";
|
||||
ChangeDir( $LLVMSrcDir , "llvm source directory") ;
|
||||
($BuildError, $BuildStatus) = BuildLLVM();
|
||||
if ($BuildError) {
|
||||
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;
|
||||
}
|
||||
my $DejagnuTestResults = RunDejaGNUTests();
|
||||
}
|
||||
|
||||
# Run DejaGNU.
|
||||
my $DejagnuTestResults = "Dejagnu skipped by user choice.";
|
||||
if (!$NODEJAGNU && !$BuildError) {
|
||||
$DejagnuTestResults = RunDejaGNUTests();
|
||||
}
|
||||
|
||||
# Run the llvm-test tests.
|
||||
my ($SingleSourceProgramsTable, $MultiSourceProgramsTable, $ExternalProgramsTable,
|
||||
$passes, $fails, $xfails) = "";
|
||||
if (!$NOTEST && !$BuildError) {
|
||||
($SingleSourceProgramsTable, $MultiSourceProgramsTable, $ExternalProgramsTable,
|
||||
$passes, $fails, $xfails) = RunNightlyTest();
|
||||
}
|
||||
|
||||
$endtime = `date "+20%y-%m-%d %H:%M:%S"`;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user