Gromacs
2025.0-dev-20241009-5c23d5f
|
#include <testutils/include/testutils/naming.h>
Functor to name a refdata filename for this test.
We sometimes want the same reference data to apply to multiple test cases, e.g. because we implement multiple ways to do the same thing and want to check that all implementations match the same reference data.
That means we need to store the reference data in a file whose name relates only to the test parameters that change the values, and not those that describe different implementations. In such cases, we cannot simple re-use the name provided by NameOfTestFromTuple
.
By default, the reference data filename is set via a call to gmx::TestFileManager::getTestSpecificFileName() that queries GoogleTest and gets a string that includes the return value for NameOfTestFromTuple::operator(). This code works similarly, but generally the user passes different formatters for some parameters, so that some of the test parameters do not contribute to the name produced.
Public Types | |
using | Formatters = typename detail::ParamsToFormatterVariants< ParametersTuple >::type |
Public Member Functions | |
RefDataFilenameMaker (Formatters formatters) | |
Constructor. | |
std::filesystem::path | operator() (const ParametersTuple ¶ms) const |
Functor to make the reference-data filename requested. | |