diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-10-19 13:20:25 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-10-19 13:20:25 +0000 |
commit | 2942b0204853452b8236646b01e50cd1d29af9a6 (patch) | |
tree | e94cc16f6b31a2cd94eada1c5aeadddb361e6222 /utils | |
parent | ce25dafc1634a23335e133d77c2d0bff89e7b3a6 (diff) | |
download | external_llvm-2942b0204853452b8236646b01e50cd1d29af9a6.zip external_llvm-2942b0204853452b8236646b01e50cd1d29af9a6.tar.gz external_llvm-2942b0204853452b8236646b01e50cd1d29af9a6.tar.bz2 |
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
Diffstat (limited to 'utils')
-rwxr-xr-x | utils/NewNightlyTest.pl | 81 |
1 files changed, 44 insertions, 37 deletions
diff --git a/utils/NewNightlyTest.pl b/utils/NewNightlyTest.pl index b18232d..49d887d 100755 --- a/utils/NewNightlyTest.pl +++ b/utils/NewNightlyTest.pl @@ -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"; } - 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) = ""; + # 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"; + 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 |