NNT: Sink code for running nightly test into subroutine.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84492 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Daniel Dunbar 2009-10-19 13:20:25 +00:00
parent 3431123f36
commit 4a338bf227

View File

@ -649,50 +649,57 @@ sub TestDirectory {
# Calling sub TestDirectory
#
##############################################################
if (!$BuildError) {
($SingleSourceProgramsTable, $llcbeta_options) = TestDirectory("SingleSource");
WriteFile "$Prefix-SingleSource-Performance.txt", $SingleSourceProgramsTable;
($MultiSourceProgramsTable, $llcbeta_options) = TestDirectory("MultiSource");
WriteFile "$Prefix-MultiSource-Performance.txt", $MultiSourceProgramsTable;
if ( ! $NOEXTERNALS ) {
($ExternalProgramsTable, $llcbeta_options) = TestDirectory("External");
WriteFile "$Prefix-External-Performance.txt", $ExternalProgramsTable;
system "cat $Prefix-SingleSource-Tests.txt " .
"$Prefix-MultiSource-Tests.txt ".
"$Prefix-External-Tests.txt | sort > $Prefix-Tests.txt";
system "cat $Prefix-SingleSource-Performance.txt " .
"$Prefix-MultiSource-Performance.txt ".
"$Prefix-External-Performance.txt | sort > $Prefix-Performance.txt";
} else {
$ExternalProgramsTable = "External TEST STAGE SKIPPED\n";
if ( $VERBOSE ) {
print "External TEST STAGE SKIPPED\n";
sub RunNightlyTest() {
if (!$BuildError) {
($SSProgs, $llcbeta_options) = TestDirectory("SingleSource");
WriteFile "$Prefix-SingleSource-Performance.txt", $SSProgs;
($MSProgs, $llcbeta_options) = TestDirectory("MultiSource");
WriteFile "$Prefix-MultiSource-Performance.txt", $MSProgs;
if ( ! $NOEXTERNALS ) {
($ExtProgs, $llcbeta_options) = TestDirectory("External");
WriteFile "$Prefix-External-Performance.txt", $ExtProgs;
system "cat $Prefix-SingleSource-Tests.txt " .
"$Prefix-MultiSource-Tests.txt ".
"$Prefix-External-Tests.txt | sort > $Prefix-Tests.txt";
system "cat $Prefix-SingleSource-Performance.txt " .
"$Prefix-MultiSource-Performance.txt ".
"$Prefix-External-Performance.txt | sort > $Prefix-Performance.txt";
} else {
$ExtProgs = "External TEST STAGE SKIPPED\n";
if ( $VERBOSE ) {
print "External TEST STAGE SKIPPED\n";
}
system "cat $Prefix-SingleSource-Tests.txt " .
"$Prefix-MultiSource-Tests.txt ".
" | sort > $Prefix-Tests.txt";
system "cat $Prefix-SingleSource-Performance.txt " .
"$Prefix-MultiSource-Performance.txt ".
" | sort > $Prefix-Performance.txt";
}
# Compile passes, fails, xfails.
my @TestSuiteResultLines = split "\n", (ReadFile "$Prefix-Tests.txt");
my ($Passes, $Fails, $XFails) = "";
for ($x=0; $x < @TestSuiteResultLines; $x++) {
if (@TestSuiteResultLines[$x] =~ m/^PASS:/) {
$Passes .= "$TestSuiteResultLines[$x]\n";
}
elsif (@TestSuiteResultLines[$x] =~ m/^FAIL:/) {
$Fails .= "$TestSuiteResultLines[$x]\n";
}
elsif (@TestSuiteResultLines[$x] =~ m/^XFAIL:/) {
$XFails .= "$TestSuiteResultLines[$x]\n";
}
}
system "cat $Prefix-SingleSource-Tests.txt " .
"$Prefix-MultiSource-Tests.txt ".
" | sort > $Prefix-Tests.txt";
system "cat $Prefix-SingleSource-Performance.txt " .
"$Prefix-MultiSource-Performance.txt ".
" | sort > $Prefix-Performance.txt";
}
# Compile passes, fails, xfails.
my @TestSuiteResultLines = split "\n", (ReadFile "$Prefix-Tests.txt");
my ($passes, $fails, $xfails) = "";
for ($x=0; $x < @TestSuiteResultLines; $x++) {
if (@TestSuiteResultLines[$x] =~ m/^PASS:/) {
$passes .= "$TestSuiteResultLines[$x]\n";
}
elsif (@TestSuiteResultLines[$x] =~ m/^FAIL:/) {
$fails .= "$TestSuiteResultLines[$x]\n";
}
elsif (@TestSuiteResultLines[$x] =~ m/^XFAIL:/) {
$xfails .= "$TestSuiteResultLines[$x]\n";
}
}
return ($SSProgs, $MSProgs, $ExtProgs, $Passes, $Fails, $XFails)
}
my ($SingleSourceProgramsTable, $MultiSourceProgramsTable, $ExternalProgramsTable,
$passes, $fails, $xfails) = RunNightlyTest();
##############################################################
#
# Getting end timestamp