[vtk-developers] Comparing ascii files with kwsys::FilesDiffer

David Cole dlrdave at aol.com
Fri Feb 8 15:35:07 EST 2013


Before writing a bunch of code.... verify that the git auto-convert setting for pulling files into the working tree is the same for both VTK and VTKData on the machines in question.

Looks like the VTKData file is the one missing the CRs (has fewer bytes) -- makes me think the git setting is wrong for the VTKData checkout.

 

 

 

-----Original Message-----
From: Brad King <brad.king at kitware.com>
To: Bill Lorensen <bill.lorensen at gmail.com>
Cc: VTK Developers <vtk-developers at vtk.org>
Sent: Fri, Feb 8, 2013 3:31 pm
Subject: Re: [vtk-developers] Comparing ascii files with kwsys::FilesDiffer


On 02/08/2013 03:26 PM, Bill Lorensen wrote:
> The test compares two ASCII files. The difference is because (some,
> but not all) windows systems handle newline differently than linux and
> mac os.

The SystemTools::FilesDiffer method was originally added for CMake's
configure_file command to decide whether to replace a file with a new
version or to not replace it because the configured result is the same.
In this use case both files are produced the same way so newlines match.
That's why we haven't covered this before.

> In the link you can see that the contents of the two files "look" the
> same, but the lengths of the two files is different and
> vtksys::FilesDiffer reports they are different. That's because some
> windows systems use a CR/LF character for newline while the linux
> systems use LF.
> 
> How to solve this? I could add a FileDiff program to the test that
> uses getline to compare the two files.

We don't use FilesDiffer to compare test images to baselines because
there can be pixel-fuzz differences and such.  Text file comparison
may have various tolerances other than just newlines and we will not
be able to cover them all in FilesDiffer.  Therefore I think VTK
should have its own comparison tool for text files just like it does
for images.

-Brad
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtk-developers


 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20130208/316097a6/attachment.html>


More information about the vtk-developers mailing list