Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/src/catch2/internal
diff options
context:
space:
mode:
authorMartin Hořeňovský2026-01-08 14:35:05 +0100
committerMartin Hořeňovský2026-01-11 14:53:08 +0100
commit2580eadc4230eedf1b66841bdd27a8aacc2412a5 (patch)
treeba8508f3ab737c0b9d11a2fd5c33d0bdbfcd457e /src/catch2/internal
parentb59f4f352291a89c4a3fe1488eeccbddeea85625 (diff)
downloadcatch3-2580eadc4230eedf1b66841bdd27a8aacc2412a5.tar.gz
Add UNSCOPED_CAPTURE
Closes #2954 Closes #3010
Diffstat (limited to 'src/catch2/internal')
-rw-r--r--src/catch2/internal/catch_run_context.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/catch2/internal/catch_run_context.cpp b/src/catch2/internal/catch_run_context.cpp
index d63f19ac..5e5f95a4 100644
--- a/src/catch2/internal/catch_run_context.cpp
+++ b/src/catch2/internal/catch_run_context.cpp
@@ -211,13 +211,16 @@ namespace Catch {
// we only keep around the raw msg ids.
~MessageHolder() = default;
+ void addUnscopedMessage( MessageInfo&& info ) {
+ repairUnscopedMessageInvariant();
+ unscoped_ids.push_back( info.sequence );
+ messages.push_back( CATCH_MOVE( info ) );
+ }
void addUnscopedMessage(MessageBuilder&& builder) {
- repairUnscopedMessageInvariant();
MessageInfo info( CATCH_MOVE( builder.m_info ) );
info.message = builder.m_stream.str();
- unscoped_ids.push_back( info.sequence );
- messages.push_back( CATCH_MOVE( info ) );
+ addUnscopedMessage( CATCH_MOVE( info ) );
}
void addScopedMessage(MessageInfo&& info) {
@@ -894,6 +897,10 @@ namespace Catch {
Detail::g_messageHolder().addUnscopedMessage( CATCH_MOVE( builder ) );
}
+ void IResultCapture::addUnscopedMessage( MessageInfo&& message ) {
+ Detail::g_messageHolder().addUnscopedMessage( CATCH_MOVE( message ) );
+ }
+
void seedRng(IConfig const& config) {
sharedRng().seed(config.rngSeed());
}