[gmx-developers] Testing whole analysis output files

David van der Spoel spoel at xray.bmc.uu.se
Fri Jul 24 17:44:31 CEST 2015


On 24/07/15 09:53, Teemu Murtola wrote:
> Hi,
>
> There is no "simple" way using existing code to just test such files. It
> would require a complete parser for such files (and then one would also
> want to test, e.g., the legends at the beginning of xvg files), which is
> certainly doable, but will be a lot of code.

I think I made a useful hack now. Testing legends would not be so hard 
except for the bromacs(). So I am testing without legends. At line 68 of
https://gerrit.gromacs.org/#/c/4310/27/src/gromacs/energyanalysis/tests/energyanalysis.cpp
It did require some hacking in tests/cmdlinetest.cpp
>
> The approach used in the trajectoryanalysis tests is to test the data
> only before it is written into a file. If your code used the
> analysisdata classes for producing output (which could be useful
> otherwise as well, including some enforced modularization), then you
> could just reuse this mechanism, but probably that also requires you to
> change your code quite a bit.
That's for the next round of coding.

>
> Best regards,
> Teemu
>
>
> On Fri, Jul 24, 2015, 09:50 David van der Spoel <spoel at xray.bmc.uu.se
> <mailto:spoel at xray.bmc.uu.se>> wrote:
>
>
>     I'm trying to write a test for the output files generated in my energy
>     patch. However, the checkOutputfiles() compares files as blocks of
>     strings, which is not useful for floating point numbers. Is there a
>     simple way of testing such files as a bunch of numbers with a tolerance?
>
>
>     I looked in the trajectoryanalysis/tests but did not find anything
>     helpful there (or did not comprehend what is being done).
>
>
>
>
>


-- 
David van der Spoel, Ph.D., Professor of Biology
Dept. of Cell & Molec. Biol., Uppsala University.
Box 596, 75124 Uppsala, Sweden. Phone:	+46184714205.
spoel at xray.bmc.uu.se    http://folding.bmc.uu.se


More information about the gromacs.org_gmx-developers mailing list