class TestSuite::LoggingScope

RAII scope for managing expected/ignored logs during a test section.

When the scope exits, expected logs are verified and all registrations are cleaned up.

Public

Constructors

LoggingScope

LoggingScope(TestSuite &suite)

Methods

~LoggingScope

~LoggingScope()

ExpectLog

void ExpectLog(LogVerbosity verbosity, const String &pattern)

Declare that a log with given verbosity and pattern MUST occur.

Test fails if the expected log is not found when scope exits.

ExpectWarning

void ExpectWarning(const String &pattern)

Convenience for expecting warnings, see ExpectLog.

ExpectError

void ExpectError(const String &pattern)

Convenience for expecting errors, see ExpectLog.

IgnoreLog

void IgnoreLog(LogVerbosity verbosity, const String &pattern)

Declare that a log with given verbosity and pattern MAY occur.

Test passes whether or not the log actually occurs.

IgnoreWarning

void IgnoreWarning(const String &pattern)

Convenience for ignoring warnings, see IgnoreLog.

IgnoreError

void IgnoreError(const String &pattern)

Convenience for ignoring errors, see IgnoreLog.

Private

Fields

mSuite

TestSuite & mSuite

mExpected

Vector<ExpectedEntry> mExpected

mIgnored

Vector<IgnoredEntry> mIgnored