Add unscoped info functionality

This adds UNSCOPED_INFO macro, creating a log message that is stored
until the end of next assertion or the end of test case, whichever comes
first. These messages are not scoped locally, unlike messages created by
INFO macro.
This commit is contained in:
Omer Ozarslan
2019-02-01 09:11:30 -06:00
committed by Martin Hořeňovský
parent 1a03918455
commit 99575b45db
7 changed files with 32 additions and 2 deletions

View File

@@ -88,6 +88,8 @@ namespace Catch {
void pushScopedMessage( MessageInfo const& message ) override;
void popScopedMessage( MessageInfo const& message ) override;
void emplaceUnscopedMessage( MessageBuilder const& builder ) override;
std::string getCurrentTestName() const override;
const AssertionResult* getLastResult() const override;
@@ -135,6 +137,7 @@ namespace Catch {
Totals m_totals;
IStreamingReporterPtr m_reporter;
std::vector<MessageInfo> m_messages;
std::vector<ScopedMessage> m_messageScopes; /* Keeps owners of so-called unscoped messages. */
AssertionInfo m_lastAssertionInfo;
std::vector<SectionEndInfo> m_unfinishedSections;
std::vector<ITracker*> m_activeSections;