Improve option support & tests for key-value trees
authorTeemu Murtola <teemu.murtola@gmail.com>
Sat, 11 Mar 2017 13:14:30 +0000 (15:14 +0200)
committerDavid van der Spoel <davidvanderspoel@gmail.com>
Mon, 13 Mar 2017 08:45:27 +0000 (09:45 +0100)
commita6d9b79c30848065328d7c7a688e80b244035817
tree68df3c9a1c1f0fec7247dc4e5d9254ec6310a8d2
parentcccc2a2d935f5bb0ee7782bc781bc1b6acb1a6c1
Improve option support & tests for key-value trees

Add basic tests for the behavior of different option types with
key-value tree handling.  For now, the test covers only the "adjust"
function.  Make enum options serialize as strings instead of integers,
which improves behavior of gmx dump and gmx check, and can also be more
robust for backward/forward compatibility.

Improve the way the key-value tree serialization tests are done: use the
in-memory serializer to test roundtrips, instead of relying on the
reference data.  There is less code this way, and the tests behave
better in the absence of reference data.

Change-Id: I5e52265333f397bd6e058636691cbfd21092df0d
14 files changed:
src/gromacs/options/basicoptions.cpp
src/gromacs/options/basicoptionstorage.h
src/gromacs/options/optionstoragetemplate.h
src/gromacs/options/tests/refdata/TreeValueSupportTest_SupportsBooleanOption.xml [new file with mode: 0644]
src/gromacs/options/tests/refdata/TreeValueSupportTest_SupportsDoubleOption.xml [new file with mode: 0644]
src/gromacs/options/tests/refdata/TreeValueSupportTest_SupportsEnumIntOption.xml [new file with mode: 0644]
src/gromacs/options/tests/refdata/TreeValueSupportTest_SupportsEnumOption.xml [new file with mode: 0644]
src/gromacs/options/tests/refdata/TreeValueSupportTest_SupportsFloatOption.xml [new file with mode: 0644]
src/gromacs/options/tests/refdata/TreeValueSupportTest_SupportsInt64Option.xml [new file with mode: 0644]
src/gromacs/options/tests/refdata/TreeValueSupportTest_SupportsIntegerOption.xml [new file with mode: 0644]
src/gromacs/options/tests/refdata/TreeValueSupportTest_SupportsStringOption.xml [new file with mode: 0644]
src/gromacs/options/tests/treesupport.cpp
src/gromacs/utility/tests/keyvaluetreeserializer.cpp
src/testutils/refdata.cpp