From ec0e374ba7ac48a5e720161d22d5c59119e33d6a Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 28 Feb 2003 20:30:20 +0000 Subject: * Don't run tests if compilation failed * Don't summarize tests if testing failed git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5680 91177308-0d34-0410-b5e6-96231b3b80d8 --- utils/NightlyTest.pl | 99 ++++++++++++++++++++++++++++++---------------------- 1 file changed, 58 insertions(+), 41 deletions(-) diff --git a/utils/NightlyTest.pl b/utils/NightlyTest.pl index 12ef6dd..39dca2c 100755 --- a/utils/NightlyTest.pl +++ b/utils/NightlyTest.pl @@ -262,60 +262,77 @@ my $AddedFilesList = AddPreTag join "\n", keys %AddedFiles; my $ModifiedFilesList = AddPreTag join "\n", keys %ModifiedFiles; my $RemovedFilesList = AddPreTag join "\n", keys %RemovedFiles; -# -# Run the nightly programs tests... -# -chdir "test/Programs" or die "Could not change into programs testdir!"; +my $TestError = 1; +my $ProgramsTable; -# Run the programs tests... creating a report.nightly.html file -if (!$NOTEST) { - system "gmake $MAKEOPTS report.nightly.html TEST=nightly " - . "RUNTIMELIMIT=300 > $Prefix-ProgramTest.txt 2>&1"; -} else { - system "gunzip $Prefix-ProgramTest.txt.gz"; -} +# If we build the tree successfully, the nightly programs tests... +if ($BuildError eq "") { + chdir "test/Programs" or die "Could not change into programs testdir!"; -my $ProgramsTable = ReadFile "report.nightly.html"; + # Run the programs tests... creating a report.nightly.html file + if (!$NOTEST) { + system "gmake $MAKEOPTS report.nightly.html TEST=nightly " + . "RUNTIMELIMIT=300 > $Prefix-ProgramTest.txt 2>&1"; + } else { + system "gunzip $Prefix-ProgramTest.txt.gz"; + } -# -# Create a list of the tests which were run... -# -system "grep -E 'TEST-(PASS|FAIL)' < $Prefix-ProgramTest.txt " - . "| sort > $Prefix-Tests.txt"; + if (`grep '^gmake: .*Error' $Prefix-ProgramTest.txt | wc -l` + 0) { + $TestError = 1; + $ProgramsTable = "

Error running tests!

"; + } else { + $TestError = 0; + $ProgramsTable = ReadFile "report.nightly.html"; + + # + # Create a list of the tests which were run... + # + system "grep -E 'TEST-(PASS|FAIL)' < $Prefix-ProgramTest.txt " + . "| sort > $Prefix-Tests.txt"; + } -# Compress the test output -system "gzip $Prefix-ProgramTest.txt"; + # Compress the test output + system "gzip $Prefix-ProgramTest.txt"; +} -my ($RTestsAdded, $RTestsRemoved) = DiffFiles "-Tests.txt"; +my ($TestsAdded, $TestsRemoved, $TestsFixed, $TestsBroken) = ("","","",""); -my @RawTestsAddedArray = split '\n', $RTestsAdded; -my @RawTestsRemovedArray = split '\n', $RTestsRemoved; +if ($TestError) { + $TestsAdded = "error testing
"; + $TestsRemoved = "error testing
"; + $TestsFixed = "error testing
"; + $TestsBroken = "error testing
"; +} else { + my ($RTestsAdded, $RTestsRemoved) = DiffFiles "-Tests.txt"; -my %OldTests = map {GetRegex('TEST-....: (.+)', $_)=>$_} @RawTestsRemovedArray; -my %NewTests = map {GetRegex('TEST-....: (.+)', $_)=>$_} @RawTestsAddedArray; + my @RawTestsAddedArray = split '\n', $RTestsAdded; + my @RawTestsRemovedArray = split '\n', $RTestsRemoved; -my ($TestsAdded, $TestsRemoved, $TestsFixed, $TestsBroken) = ("","","",""); + my %OldTests = map {GetRegex('TEST-....: (.+)', $_)=>$_} + @RawTestsRemovedArray; + my %NewTests = map {GetRegex('TEST-....: (.+)', $_)=>$_} + @RawTestsAddedArray; -foreach $Test (keys %NewTests) { - if (!exists $OldTests{$Test}) { # TestAdded if in New but not old - $TestsAdded = "$TestsAdded$Test\n"; - } else { - if ($OldTests{$Test} =~ /TEST-PASS/) { # Was the old one a pass? - $TestsBroken = "$TestsBroken$Test\n"; # New one must be a failure + foreach $Test (keys %NewTests) { + if (!exists $OldTests{$Test}) { # TestAdded if in New but not old + $TestsAdded = "$TestsAdded$Test\n"; } else { - $TestsFixed = "$TestsFixed$Test\n"; # No, new one is a pass. + if ($OldTests{$Test} =~ /TEST-PASS/) { # Was the old one a pass? + $TestsBroken = "$TestsBroken$Test\n"; # New one must be a failure + } else { + $TestsFixed = "$TestsFixed$Test\n"; # No, new one is a pass. + } } } -} -foreach $Test (keys %OldTests) { # TestRemoved if in Old but not New - $TestsRemoved = "$TestsRemoved$Test\n" if (!exists $NewTests{$Test}); -} - -$TestsAdded = AddPreTag $TestsAdded; -$TestsRemoved = AddPreTag $TestsRemoved; -$TestsFixed = AddPreTag $TestsFixed; -$TestsBroken = AddPreTag $TestsBroken; + foreach $Test (keys %OldTests) { # TestRemoved if in Old but not New + $TestsRemoved = "$TestsRemoved$Test\n" if (!exists $NewTests{$Test}); + } + $TestsAdded = AddPreTag $TestsAdded; + $TestsRemoved = AddPreTag $TestsRemoved; + $TestsFixed = AddPreTag $TestsFixed; + $TestsBroken = AddPreTag $TestsBroken; +} # # Get a list of the previous days that we can link to... -- cgit v1.1