Gromacs  2025-dev-20240612-66cb22e
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions
gmx::test::FilteringExactTextMatch Class Reference

#include <testutils/include/testutils/textblockmatchers.h>

+ Inheritance diagram for gmx::test::FilteringExactTextMatch:
+ Collaboration diagram for gmx::test::FilteringExactTextMatch:

Description

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.
 

The documentation for this class was generated from the following files: