Fix reformat_results() so that that function:

- can no longer enter an infinite loop while reading a file that is not
  in the good format,
  - and can handle cmake test results.
This commit is contained in:
Laurent Rineau 2008-06-19 08:43:44 +00:00
parent e62a22a675
commit 2cc0ec48c7
1 changed files with 16 additions and 3 deletions

View File

@ -34,9 +34,10 @@ sub reformat_results($)
my $platform = $_; my $platform = $_;
# system("dos2unix ${platform}.txt ${platform}.txt"); # system("dos2unix ${platform}.txt ${platform}.txt");
open (PLATFORM_RESULTS,"<${platform}.txt") or return; open (PLATFORM_RESULTS,"<${platform}.txt") or return;
while (/^\s*$/) { my $line;
$_= <PLATFORM_RESULTS>; while ( ($line = <PLATFORM_RESULTS>) && /^\s*$/) {
} }
$_ = $line;
open (PLATFORM_INFO,">${platform}.info") or return; open (PLATFORM_INFO,">${platform}.info") or return;
open (PLATFORM_NEW_RESULTS,">${platform}.new_results") or return; open (PLATFORM_NEW_RESULTS,">${platform}.new_results") or return;
my ($CGAL_VERSION,$LEDA_VERSION,$TESTER,$TESTER_NAME,$TESTER_ADDRESS,$GMP,$MPFR,$ZLIB,$BLAS,$LAPACK,$OPENGL,$TAUCS,$BOOST,$QT) = ("-","-","-","-","-","-","-","-","-","-","-","-","-","-"); my ($CGAL_VERSION,$LEDA_VERSION,$TESTER,$TESTER_NAME,$TESTER_ADDRESS,$GMP,$MPFR,$ZLIB,$BLAS,$LAPACK,$OPENGL,$TAUCS,$BOOST,$QT) = ("-","-","-","-","-","-","-","-","-","-","-","-","-","-");
@ -105,7 +106,19 @@ sub reformat_results($)
if (/CUSTOM_LDFLAGS = '([^']*)'/) { if (/CUSTOM_LDFLAGS = '([^']*)'/) {
$LDFLAGS="$1"; $LDFLAGS="$1";
} }
$_= <PLATFORM_RESULTS>; if(/^CGAL_TEST_PLATFORM /) {
# should be the last one of the header
last;
}
if(! /^[A-Z][A-Z]/ ) {
# the header is finished
print PLATFORM_NEW_RESULTS $_;
last;
}
if(! ($_= <PLATFORM_RESULTS>)) {
# should never happen!!
last;
}
} }
while (<PLATFORM_RESULTS>) { while (<PLATFORM_RESULTS>) {
print PLATFORM_NEW_RESULTS $_; print PLATFORM_NEW_RESULTS $_;