<feed xmlns='http://www.w3.org/2005/Atom'>
<title>catch3/src/catch2/catch_message.cpp, branch v3.16.0</title>
<subtitle>Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.</subtitle>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/'/>
<entry>
<title>Turn IResultCapture::{push,pop}*Message into free functions</title>
<updated>2026-04-07T12:28:11+00:00</updated>
<author>
<name>Martin Hořeňovský</name>
</author>
<published>2026-04-07T11:09:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=3ab0d7cef3313d91e652a89870c89b0c42760f9e'/>
<id>3ab0d7cef3313d91e652a89870c89b0c42760f9e</id>
<content type='text'>
The thread-safety changes in assertions &amp; messages turned the message
stacks into thread-local state, instead of it being member of `RunContext`.
The relevant {push,pop}(Un)ScopedMessage functions were turned from member
functions into static functions, but this left `catch_message.hpp` with
dependency on `IResultCapture`'s definition for the functions, and thus
it still had to include `catch_interfaces_capture.hpp`.

With this change, `catch_message.hpp` no longer needs
`catch_interfaces_capture.hpp`.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The thread-safety changes in assertions &amp; messages turned the message
stacks into thread-local state, instead of it being member of `RunContext`.
The relevant {push,pop}(Un)ScopedMessage functions were turned from member
functions into static functions, but this left `catch_message.hpp` with
dependency on `IResultCapture`'s definition for the functions, and thus
it still had to include `catch_interfaces_capture.hpp`.

With this change, `catch_message.hpp` no longer needs
`catch_interfaces_capture.hpp`.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add UNSCOPED_CAPTURE</title>
<updated>2026-01-11T13:53:08+00:00</updated>
<author>
<name>Martin Hořeňovský</name>
</author>
<published>2026-01-08T13:35:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=2580eadc4230eedf1b66841bdd27a8aacc2412a5'/>
<id>2580eadc4230eedf1b66841bdd27a8aacc2412a5</id>
<content type='text'>
Closes #2954
Closes #3010
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Closes #2954
Closes #3010
</pre>
</div>
</content>
</entry>
<entry>
<title>Make message push/pop static</title>
<updated>2025-09-23T09:46:26+00:00</updated>
<author>
<name>Martin Hořeňovský</name>
</author>
<published>2025-09-23T09:01:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=434bf55d4727ab1d1aef244ef16823a0ed1e6b4a'/>
<id>434bf55d4727ab1d1aef244ef16823a0ed1e6b4a</id>
<content type='text'>
Since the change to make the message macros thread-safe, and thus
thread-local, there is no need to handle messages through instance
of `RunContext`.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Since the change to make the message macros thread-safe, and thus
thread-local, there is no need to handle messages through instance
of `RunContext`.
</pre>
</div>
</content>
</entry>
<entry>
<title>Small refactoring in CAPTURE parsing</title>
<updated>2025-08-26T10:40:13+00:00</updated>
<author>
<name>Martin Hořeňovský</name>
</author>
<published>2025-08-26T10:40:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=cd93d202e047f91370b922f09db2e658653088de'/>
<id>cd93d202e047f91370b922f09db2e658653088de</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Move MessageInfos into the run context</title>
<updated>2025-08-26T10:37:52+00:00</updated>
<author>
<name>Martin Hořeňovský</name>
</author>
<published>2025-08-26T10:36:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=227af796b4ede6258f9b1ff8b69cd1f03d32f662'/>
<id>227af796b4ede6258f9b1ff8b69cd1f03d32f662</id>
<content type='text'>
Together with the previous change, this means that `ScopedMessage`
only needs to keep around a single unsigned int.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Together with the previous change, this means that `ScopedMessage`
only needs to keep around a single unsigned int.
</pre>
</div>
</content>
</entry>
<entry>
<title>Use only the ID of a message when removing it from context</title>
<updated>2025-08-26T10:07:41+00:00</updated>
<author>
<name>Martin Hořeňovský</name>
</author>
<published>2025-08-26T10:07:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=33adb4c779feaa3a98bb45ec1ebaf2864bb110b7'/>
<id>33adb4c779feaa3a98bb45ec1ebaf2864bb110b7</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Make message macros (FAIL, WARN, INFO, etc) thread safe</title>
<updated>2025-08-23T09:08:18+00:00</updated>
<author>
<name>Martin Hořeňovský</name>
</author>
<published>2025-08-22T22:15:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=582200a1f8ddd6f435d1264668c7074121c2636c'/>
<id>582200a1f8ddd6f435d1264668c7074121c2636c</id>
<content type='text'>
This builds on the existing work to make assertion thread safe,
by adding an extra synchronization point in the holder of
`ReusableStringStream`'s stream instances, as those are used to
build the messages, and finishing the move of message scope holders
to be thread-local.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This builds on the existing work to make assertion thread safe,
by adding an extra synchronization point in the holder of
`ReusableStringStream`'s stream instances, as those are used to
build the messages, and finishing the move of message scope holders
to be thread-local.
</pre>
</div>
</content>
</entry>
<entry>
<title>Regularize scoped message lifetime to only consider the object's scope</title>
<updated>2025-07-21T19:50:47+00:00</updated>
<author>
<name>Martin Hořeňovský</name>
</author>
<published>2025-07-21T15:47:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=10aef62f21e52e5cd73bf0dc6ac8be35fbc4a798'/>
<id>10aef62f21e52e5cd73bf0dc6ac8be35fbc4a798</id>
<content type='text'>
This means that:
1) Scoped messages are always removed at the end of their scope,
   even if the scope ended due to an exception.
2) Scoped messages outlive section end, if that section's scope is
   enclosed in their own.

Previously neither of these were true, which has led to a number
of surprising behaviour, where e.g. this:
```cpp
TEST_CASE() {
    try {
        INFO( "some info" );
        throw std::runtime_error( "ex" );
    } catch (std::exception const&amp;) {}

    REQUIRE( false );
}
```
would print "some info" as the message for the assertion, while this:
```cpp
TEST_CASE() {
    INFO("Hello");
    SECTION("dummy") {}
    REQUIRE(false);
}
```
would not print out "Hello" as the message for the assertion.

This had an underlying reason, in that it was trying to helpfully
keep the messages around in case of unexpected exceptions, so that
code like this:
```cpp
TEST_CASE() {
    auto [input, expected] = GENERATE(...);
    CAPTURE(input);
    auto result = transform(input); // throws
    REQUIRE(result == expected);
}
```
would report the value of `input` when `transform` throws. However,
it was surprising in practice and was causing various issues around
handling of messages in other cases.

Closes #1759
Closes #2019
Closes #2959
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This means that:
1) Scoped messages are always removed at the end of their scope,
   even if the scope ended due to an exception.
2) Scoped messages outlive section end, if that section's scope is
   enclosed in their own.

Previously neither of these were true, which has led to a number
of surprising behaviour, where e.g. this:
```cpp
TEST_CASE() {
    try {
        INFO( "some info" );
        throw std::runtime_error( "ex" );
    } catch (std::exception const&amp;) {}

    REQUIRE( false );
}
```
would print "some info" as the message for the assertion, while this:
```cpp
TEST_CASE() {
    INFO("Hello");
    SECTION("dummy") {}
    REQUIRE(false);
}
```
would not print out "Hello" as the message for the assertion.

This had an underlying reason, in that it was trying to helpfully
keep the messages around in case of unexpected exceptions, so that
code like this:
```cpp
TEST_CASE() {
    auto [input, expected] = GENERATE(...);
    CAPTURE(input);
    auto result = transform(input); // throws
    REQUIRE(result == expected);
}
```
would report the value of `input` when `transform` throws. However,
it was surprising in practice and was causing various issues around
handling of messages in other cases.

Closes #1759
Closes #2019
Closes #2959
</pre>
</div>
</content>
</entry>
<entry>
<title>Add missing break to a switch to silence fall-through warning</title>
<updated>2024-07-31T15:38:02+00:00</updated>
<author>
<name>Martin Hořeňovský</name>
</author>
<published>2024-07-31T15:33:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=33e24b14fcf95c1c31c8d6b68f445ebb12e026cc'/>
<id>33e24b14fcf95c1c31c8d6b68f445ebb12e026cc</id>
<content type='text'>
Closes #2891
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Closes #2891
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix various useful clang-tidy warnings</title>
<updated>2024-03-01T20:24:45+00:00</updated>
<author>
<name>Martin Jeřábek</name>
</author>
<published>2024-03-01T10:15:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=cde35096641d55b4aa0f743bb03e04703fbb5e9c'/>
<id>cde35096641d55b4aa0f743bb03e04703fbb5e9c</id>
<content type='text'>
* bugprone-branch-clone
* bugprone-copy-constructor-init
* bugprone-empty-catch
* bugprone-sizeof-expression
* bugprone-switch-missing-default-case
* bugprone-unused-local-non-trivial-variable
* clang-analyzer-core.uninitialized.Assign
* clang-analyzer-cplusplus.Move
* clang-analyzer-optin.cplusplus.VirtualCall
* modernize-loop-convert
* modernize-raw-string-literal
* modernize-use-equals-default
* modernize-use-override
* modernize-use-using
* performance-avoid-endl
* performance-inefficient-string-concatenation
* performance-inefficient-vector-operation
* performance-noexcept-move-constructor
* performance-unnecessary-value-param (and improve generator example)
* readability-duplicate-include
* readability-inconsistent-declaration-parameter-name
* readability-non-const-parameter
* readability-redundant-casting
* readability-redundant-member-init
* readability-redundant-smartptr-get
* readability-static-accessed-through-instance
* unused variable in amalgamted tests
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* bugprone-branch-clone
* bugprone-copy-constructor-init
* bugprone-empty-catch
* bugprone-sizeof-expression
* bugprone-switch-missing-default-case
* bugprone-unused-local-non-trivial-variable
* clang-analyzer-core.uninitialized.Assign
* clang-analyzer-cplusplus.Move
* clang-analyzer-optin.cplusplus.VirtualCall
* modernize-loop-convert
* modernize-raw-string-literal
* modernize-use-equals-default
* modernize-use-override
* modernize-use-using
* performance-avoid-endl
* performance-inefficient-string-concatenation
* performance-inefficient-vector-operation
* performance-noexcept-move-constructor
* performance-unnecessary-value-param (and improve generator example)
* readability-duplicate-include
* readability-inconsistent-declaration-parameter-name
* readability-non-const-parameter
* readability-redundant-casting
* readability-redundant-member-init
* readability-redundant-smartptr-get
* readability-static-accessed-through-instance
* unused variable in amalgamted tests
</pre>
</div>
</content>
</entry>
</feed>
