Gromacs
2025.0-dev-20241014-f673b97
|
#include <testutils/include/testutils/textblockmatchers.h>
Use an exact text match after scrubbing lines of the text that match the supplied regular expressions.
This suits comparing files in tests that are intended to be localized by reporting usage, time, date, user, or file-system stamps. The latter won't be reproducible in tests until the tools that emit them can be mocked suitably.
Constructor arguments are available to signal whether the text that is read in should have leading or trailing white space removed. This can be particularly useful when the regex needs to work on multiple OS, such as in CI testing.
Public Member Functions | |
FilteringExactTextMatch (std::vector< std::string > linesToSkip, bool trimLeadingWhiteSpace, bool trimTrailingWhiteSpace) | |
Constructor. | |
TextBlockMatcherPointer | createMatcher () const override |
Factory method. | |
void | addRegexToSkip (const std::string &lineToSkip) |
Add a regular expression for which a matching line should be skipped. | |