Gromacs
2025-dev-20241003-bd59e46
|
#include <testutils/include/testutils/loggertest.h>
Helper class for tests to check output written to a logger.
Public Member Functions | |
const MDLogger & | logger () |
Returns the logger to pass to code under test. | |
void | expectEntryMatchingRegex (gmx::MDLogger::LogLevel level, const char *re) |
Expects a log entry at a given level matching a given regex. More... | |
void | expectNoEntries (gmx::MDLogger::LogLevel level) |
Expects that no log entries were made at a given level. More... | |
void gmx::test::LoggerTestHelper::expectEntryMatchingRegex | ( | gmx::MDLogger::LogLevel | level, |
const char * | re | ||
) |
Expects a log entry at a given level matching a given regex.
Currently, the order of the entries is not checked, and if this method is called once for a log level, then it needs to be called for all entries produced by the test.
If not called for a log level, all entries for that level are accepted.
Note that this expectation should be set up before the logger is used in the test.
void gmx::test::LoggerTestHelper::expectNoEntries | ( | gmx::MDLogger::LogLevel | level | ) |
Expects that no log entries were made at a given level.
If not called for a log level, all entries for that level are accepted.
Note that this expectation should be set up before the logger is used in the test.