Changeset 27969

Show
Ignore:
Timestamp:
05.08.2013 15:28:32 (6 years ago)
Author:
ak19
Message:

When test-running diffcol on the Enhanced-PDF tutorial, it would choke on intermediate ~ files, the cached directory (see previous commit), and the FileSize? metadata could differ slightly between OS. Further, the XSLT processing of the report would break if error messages were truncated at an incomplete entity (& symbol) since it becomes invalid xml.

Location:
other-projects/nightly-tasks/diffcol/trunk/diffcol
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • other-projects/nightly-tasks/diffcol/trunk/diffcol/diffcol.pl

    r27767 r27969  
    576576        # Files to be skipped because they get generated on one OS but not the other 
    577577        # On windows, files of the form col.invf.state.\d\d\d\d get generated (e.g. Small-HTML.invf.state.1228) that aren't there on linux 
    578         my $skipfiles_re = qr/\.invf\.state\.\d+$/; # Create a regex of all files to be skipped, see http://perldoc.perl.org/perlop.html 
     578        my $skipfiles_re = qr/(\.invf\.state\.\d+$)|~$/; # Create a regex of all files to be skipped, see http://perldoc.perl.org/perlop.html 
    579579        @aryInModel = grep { $_ !~ m/$skipfiles_re/ } @aryInModel; # http://stackoverflow.com/questions/174292/what-is-the-best-way-to-delete-a-value-from-an-array-in-perl 
    580580        @aryInTest = grep { $_ !~ m/$skipfiles_re/ } @aryInTest; 
     
    592592                my $strNewTest = &FileUtils::filenameConcatenate($strTest,$strEachFile); 
    593593                # now additionally ignoring the earliestDatestamp file and the index/idx/*.idh binary file when diffing file  
    594                 if(!($strEachFile eq "log" || $strEachFile eq "earliestDatestamp" || $strEachFile =~ m/\.cfg$/g || $strEachFile =~ m/\.((g|j|l|b)db|idh|i.*|wa|td|tsd|ti|t|tl|w|jpe?g|gif|png|wmf)$/g)) # wmf = windows meta file 
     594                if(!($strEachFile eq "log" || $strEachFile eq "earliestDatestamp" || $strEachFile =~ m/\.cfg$/g || $strEachFile =~ m/collect\.bak$/g || $strEachFile =~ m/\.((g|j|l|b)db|idh|i.*|wa|td|tsd|ti|t|tl|w|jpe?g|gif|png|wmf)$/g)) # wmf = windows meta file #  || $strEachFile =~ m/\~$/g to get rid of ~ files 
    595595                { 
    596596                    push(@Errors,TestEach($strNewModel,$strNewTest,$intLevel,$strColName)); 
     
    612612                my $strNewModel = &FileUtils::filenameConcatenate($strModel,$strEachFile); 
    613613                my $strNewTest = &FileUtils::filenameConcatenate($strTest,$strEachFile); 
    614                 if(!($strEachFile eq "log" || $strEachFile eq "earliestDatestamp" || $strEachFile =~ m/\.cfg$/g || $strEachFile =~ m/\.((g|j|l|b)db|idh|i.*|wa|td|tsd|ti|t|tl|w|jpe?g|gif|png|wmf)$/g)) 
     614                if(!($strEachFile eq "log" || $strEachFile eq "earliestDatestamp" || $strEachFile =~ m/\.cfg$/g || $strEachFile =~ m/collect\.bak$/g || $strEachFile =~ m/\.((g|j|l|b)db|idh|i.*|wa|td|tsd|ti|t|tl|w|jpe?g|gif|png|wmf)$/g)) #  || $strEachFile =~ m/\~$/g to get rid of ~ files 
    615615                { 
    616616                    push(@Errors,TestEach($strNewModel,$strNewTest,$intLevel,$strColName)); 
     
    626626    else 
    627627    { 
    628         my $ignore_line_re = "<Metadata name=\"(lastmodified|lastmodifieddate|oailastmodified|oailastmodifieddate|ex.File.FileModifyDate|ex.File.FilePermissions|ImageSize)\">.*</Metadata>\\s*\\n*";     
     628        my $ignore_line_re = "<Metadata name=\"(lastmodified|lastmodifieddate|oailastmodified|oailastmodifieddate|ex.File.FileModifyDate|ex.File.FilePermissions|ImageSize)\">.*</Metadata>\\s*\\n*"; 
    629629         
    630630        my $strResult; 
     
    859859 
    860860      if ( length( $strOutput ) > 1000 ) { 
    861             $strOutput = substr( $strOutput, 0, 978) . "... (output truncated)"; 
     861            $strOutput = substr( $strOutput, 0, 978); 
     862 
     863        # make sure there are no stray ampersands/partial ampersands that need to be completed as &lt; or &gt; 
     864        if($strOutput =~ m/&(.{1,2})?$/) { # &lt => &lt; or &g => &gt; 
     865        if(defined $1 && $1) { 
     866            my $rest = $1; 
     867            if($rest eq "g" || $rest eq "l") { 
     868            $strOutput .= "t;"; # close the known tag 
     869            } 
     870            elsif($1 eq "gt" || $1 eq "lt") { 
     871            $strOutput .= ";"; 
     872            } 
     873        } else { # & on its own 
     874            #$strOutput = substr( $strOutput, 0, 977); # lop off the & 
     875            $strOutput .= "gt;"; # 50% chance the closing tag is what was missing (else can make this &amp;) 
     876            # but even so, when the xslt is applied to report it doesn't break as long as & is not left dangling 
     877        } 
     878        } 
     879        $strOutput .= "... (output truncated)"; 
    862880      } 
    863881 
  • other-projects/nightly-tasks/diffcol/trunk/diffcol/gdbdiff.pm

    r27767 r27969  
    6666    # The total_numbytes field can vary depending on how many backslashes exist in the urls in the main body text, as each 
    6767    # of these windows slashes get escaped with another backslash, and the resulting string is used as key into rel link db 
    68     my $ignore_line_re = "\n<(lastmodified|lastmodifieddate|oailastmodified|oailastmodifieddate|ex.File.FileModifyDate|ex.File.FilePermissions|total_numbytes)>([^\n])*"; 
     68    my $ignore_line_re = "\n<(FileSize|lastmodified|lastmodifieddate|oailastmodified|oailastmodifieddate|ex.File.FileModifyDate|ex.File.FilePermissions|total_numbytes)>([^\n])*"; 
    6969    $model_text =~ s/$ignore_line_re//g; 
    7070    $test_text =~ s/$ignore_line_re//g;