<feed xmlns='http://www.w3.org/2005/Atom'>
<title>catch3/tests/SelfTest, branch v3.9.1</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>Add tests for comparing &amp; stringifying volatile pointers</title>
<updated>2025-08-07T22:02:33+00:00</updated>
<author>
<name>Martin Hořeňovský</name>
</author>
<published>2025-08-07T22:02:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=03c62cdf2ede08ee759008637adf5d8e5581b77b'/>
<id>03c62cdf2ede08ee759008637adf5d8e5581b77b</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Cleanup WIP changes from last commit</title>
<updated>2025-08-02T08:21:41+00:00</updated>
<author>
<name>Martin Hořeňovský</name>
</author>
<published>2025-08-02T08:21:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=9b3f508a1b1579f5366cf83d19822cb395f23528'/>
<id>9b3f508a1b1579f5366cf83d19822cb395f23528</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Catch exceptions from StringMakers inside Detail::stringify</title>
<updated>2025-08-02T08:11:52+00:00</updated>
<author>
<name>Martin Hořeňovský</name>
</author>
<published>2025-08-01T21:23:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=c5e0ef4e67639e6001dc6f24b210ee9b1f0a7c1f'/>
<id>c5e0ef4e67639e6001dc6f24b210ee9b1f0a7c1f</id>
<content type='text'>
This stops tests failing falsely if the assertion passed, but the
stringification itself failed as the assertion was sent to the reporter.

I don't think that stringification should be fallible, but the
overhead in compilation ended up being small enough (&lt;0.5% on `SelfTest`)
that it might be worth implementing, in case there is more users
with weird `StringMaker`s than just MongoDB.

Closes #2980
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This stops tests failing falsely if the assertion passed, but the
stringification itself failed as the assertion was sent to the reporter.

I don't think that stringification should be fallible, but the
overhead in compilation ended up being small enough (&lt;0.5% on `SelfTest`)
that it might be worth implementing, in case there is more users
with weird `StringMaker`s than just MongoDB.

Closes #2980
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix StringMaker for time_point&lt;system_clock&gt; with non-default duration</title>
<updated>2025-08-02T06:31:34+00:00</updated>
<author>
<name>Martin Hořeňovský</name>
</author>
<published>2025-08-01T21:00:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=17fe5eaa5c0c28e7a6a197420f0f16b085a8fa9a'/>
<id>17fe5eaa5c0c28e7a6a197420f0f16b085a8fa9a</id>
<content type='text'>
Fixes #2685
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes #2685
</pre>
</div>
</content>
</entry>
<entry>
<title>Add enum types to what is captured by value by default</title>
<updated>2025-07-30T18:20:38+00:00</updated>
<author>
<name>Martin Hořeňovský</name>
</author>
<published>2025-07-29T21:51:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=ccabd4de891e749f472121497941bb9437b83c2e'/>
<id>ccabd4de891e749f472121497941bb9437b83c2e</id>
<content type='text'>
As it turns out, enums can be used to declare bitfields, and we
cannot form a reference to a bitfield in the cpature. Thus, we add
`std::is_enum` as a criteria to the default for `capture_by_value`,
so that enum-based bitfields are also captured by value and thus
decomposable.

Closes #3001
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
As it turns out, enums can be used to declare bitfields, and we
cannot form a reference to a bitfield in the cpature. Thus, we add
`std::is_enum` as a criteria to the default for `capture_by_value`,
so that enum-based bitfields are also captured by value and thus
decomposable.

Closes #3001
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix bad error reporting for nested exceptions in default configuration</title>
<updated>2025-07-27T19:41:02+00:00</updated>
<author>
<name>Martin Hořeňovský</name>
</author>
<published>2025-07-27T18:28:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=d547cae549f484dda3c6a2b3cc5f71b9db40e842'/>
<id>d547cae549f484dda3c6a2b3cc5f71b9db40e842</id>
<content type='text'>
Bad handling of `TestFailureException` when translating unexpected
exceptions inside assertion macros led to the unexpected exceptions
handling erroring out through throwing the same exception again.

This was then backstopped by the machinery for handling uncaught
exceptions from assertions, which is normally used by the
`CATCH_CONFIG_FAST_COMPILE` machinery, where we assume that it can
only be invoked because the assertion macros are not configured to
catch assertions.

Closes #1292
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Bad handling of `TestFailureException` when translating unexpected
exceptions inside assertion macros led to the unexpected exceptions
handling erroring out through throwing the same exception again.

This was then backstopped by the machinery for handling uncaught
exceptions from assertions, which is normally used by the
`CATCH_CONFIG_FAST_COMPILE` machinery, where we assume that it can
only be invoked because the assertion macros are not configured to
catch assertions.

Closes #1292
</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>Let reporters opt into fast path in RunContext::assertionStarting</title>
<updated>2025-07-17T11:47:44+00:00</updated>
<author>
<name>Martin Hořeňovský</name>
</author>
<published>2025-07-17T11:13:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=c22096846c98211e0bcd23dbbd155698fbd718b3'/>
<id>c22096846c98211e0bcd23dbbd155698fbd718b3</id>
<content type='text'>
The fast path allows `RunContext` to skip disabling output redirect,
and notifying the reporters, turning `RunContext::notifyAssertionStarted`
into a no-op. This improves the overall performance of assertion handling
significantly, and also prepares ground for future changes around
assertion handling and thread safety.

For simple 10M assertion run, this improves the running time by ~30%
in Debug build and ~40% in Release build.

For backwards-compatibility reasons, the fast path is disabled
by default. However, none of the first party reporters use the
`assertionStarting` event, so all first party reporters are opted-in.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The fast path allows `RunContext` to skip disabling output redirect,
and notifying the reporters, turning `RunContext::notifyAssertionStarted`
into a no-op. This improves the overall performance of assertion handling
significantly, and also prepares ground for future changes around
assertion handling and thread safety.

For simple 10M assertion run, this improves the running time by ~30%
in Debug build and ~40% in Release build.

For backwards-compatibility reasons, the fast path is disabled
by default. However, none of the first party reporters use the
`assertionStarting` event, so all first party reporters are opted-in.
</pre>
</div>
</content>
</entry>
<entry>
<title>Only track the last line info in RunContext</title>
<updated>2025-07-17T09:27:03+00:00</updated>
<author>
<name>Martin Hořeňovský</name>
</author>
<published>2025-07-16T18:43:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=0e8112a7625bc415ec20aac9a5a62243c7fbfb36'/>
<id>0e8112a7625bc415ec20aac9a5a62243c7fbfb36</id>
<content type='text'>
There were only two places where we used the full `AssertionInfo`
instance in `m_lastAssertionInfo`:
1) when reporting unexpected exception from running a test case
2) when reporting fatal error

because in those two places we do not have access to a real
instance of `AssertionInfo`, but we still need to send one to the
reporters. As a bonus, in both of these places we were already
constructing a fake-ish assertion info, by using the last encountered
source location, but dummying out the other information.

Instead, we only keep track of the last encountered source location,
and construct the dummy `AssertionInfo` on-demand.

This finishes the set of refactoring around `m_lastAssertionInfo`
in `RunContext` and improves the performance of running assertions
by ~5% in both Debug and Release mode.

--------------

Note that this change also causes small difference in output. It
could be avoided by having an invalidation flag and tracking where
the information would be invalidated before, but the difference
includes more precise line location for unexpected errors (both
exceptions and fatals), so I prefer the new output.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There were only two places where we used the full `AssertionInfo`
instance in `m_lastAssertionInfo`:
1) when reporting unexpected exception from running a test case
2) when reporting fatal error

because in those two places we do not have access to a real
instance of `AssertionInfo`, but we still need to send one to the
reporters. As a bonus, in both of these places we were already
constructing a fake-ish assertion info, by using the last encountered
source location, but dummying out the other information.

Instead, we only keep track of the last encountered source location,
and construct the dummy `AssertionInfo` on-demand.

This finishes the set of refactoring around `m_lastAssertionInfo`
in `RunContext` and improves the performance of running assertions
by ~5% in both Debug and Release mode.

--------------

Note that this change also causes small difference in output. It
could be avoided by having an invalidation flag and tracking where
the information would be invalidated before, but the difference
includes more precise line location for unexpected errors (both
exceptions and fatals), so I prefer the new output.
</pre>
</div>
</content>
</entry>
<entry>
<title>Constify various autoregistry globals to avoid clang-tidy complaints</title>
<updated>2025-07-15T13:23:32+00:00</updated>
<author>
<name>Martin Hořeňovský</name>
</author>
<published>2025-07-15T12:42:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=f7968e96975ed30231d5f5614a159e1baa7ba664'/>
<id>f7968e96975ed30231d5f5614a159e1baa7ba664</id>
<content type='text'>
Closes #2582
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Closes #2582
</pre>
</div>
</content>
</entry>
</feed>
