<feed xmlns='http://www.w3.org/2005/Atom'>
<title>catch3/src/catch2/internal/catch_test_registry.cpp, branch 0.2.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>Avoid bad compile time scaling of test registration with optimizations</title>
<updated>2026-09-03T18:22:37+00:00</updated>
<author>
<name>Martin Hořeňovský</name>
</author>
<published>2026-09-03T18:16:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=de1330d036168492a04b649a1fa0593faece6f74'/>
<id>de1330d036168492a04b649a1fa0593faece6f74</id>
<content type='text'>
GCC is especially bad, as it had quadratic scaling in the number of
registered test cases in a TU, but Clang also scaled superlinearly, and
this commit fixes both.

AIUI:
1) Each `TEST_CASE` creates a separate global fragment to handle creating
   the `unique_ptr&lt;ITestInvoker&gt;`, moving the instance into AutoReg,
   destroying the old instance, etc, etc.
2) With optimizations enabled, the compiler merges all these global
   fragments into one big global fragment.
3) Then the compiler runs various optimizations passes on this new global
   fragment.
4) Because some of the passes scale superlinearly, the compilation times
   scale superlinearly in the number of `TEST_CASE` in a translation unit.

For bonus point, no optimization actually happens.

This commit fixes the problem (for non-LTO builds) by adding new `AutoReg`
constructor, one that takes the function pointer raw, instead of wrapped
in `ITestInvoker`. By delaying the construction of the `ITestInvoker`
into the outlined constructor, we no longer create big global fragments
for the compiler to optimize.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
GCC is especially bad, as it had quadratic scaling in the number of
registered test cases in a TU, but Clang also scaled superlinearly, and
this commit fixes both.

AIUI:
1) Each `TEST_CASE` creates a separate global fragment to handle creating
   the `unique_ptr&lt;ITestInvoker&gt;`, moving the instance into AutoReg,
   destroying the old instance, etc, etc.
2) With optimizations enabled, the compiler merges all these global
   fragments into one big global fragment.
3) Then the compiler runs various optimizations passes on this new global
   fragment.
4) Because some of the passes scale superlinearly, the compilation times
   scale superlinearly in the number of `TEST_CASE` in a translation unit.

For bonus point, no optimization actually happens.

This commit fixes the problem (for non-LTO builds) by adding new `AutoReg`
constructor, one that takes the function pointer raw, instead of wrapped
in `ITestInvoker`. By delaying the construction of the `ITestInvoker`
into the outlined constructor, we no longer create big global fragments
for the compiler to optimize.
</pre>
</div>
</content>
</entry>
<entry>
<title>Sprinkle some constexpr around to make Jason happy</title>
<updated>2024-09-13T14:40:11+00:00</updated>
<author>
<name>Martin Hořeňovský</name>
</author>
<published>2024-09-13T09:16:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=18df97df00848e91bfe1b63408bba19f8b8237ae'/>
<id>18df97df00848e91bfe1b63408bba19f8b8237ae</id>
<content type='text'>
Most of these will not matter in practice due to C++14 imposing
significant limitations on what else we can make constexpr, and we cannot
have references outliving the constexpr context either way.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Most of these will not matter in practice due to C++14 imposing
significant limitations on what else we can make constexpr, and we cannot
have references outliving the constexpr context either way.
</pre>
</div>
</content>
</entry>
<entry>
<title>TEST_CASE_PERSISTENT_FIXTURE: A new fixture macro for allowing persistent fixtures throughout a TEST_CASE (#2885)</title>
<updated>2024-08-05T15:01:41+00:00</updated>
<author>
<name>Keith Stockdale</name>
</author>
<published>2024-08-05T15:01:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=f7cd0ba0511b61592e70f07533d7ea30a8a5395d'/>
<id>f7cd0ba0511b61592e70f07533d7ea30a8a5395d</id>
<content type='text'>
This PR introduces a new `TEST_CASE` macro called `TEST_CASE_PERSISTENT_FIXTURE`. `TEST_CASE_PERSISTENT_FIXTURE` offers the same functionality as `TEST_CASE_METHOD` except for one difference. The object on which the test method is invoked is only created once for all invocations of the test case. The object is created just after the `testCaseStarting` event is broadcast and the object is destroyed just before the `testCaseEnding` event is broadcast.

The main motivation for this new functionality is to allow `TEST_CASE`s to do expensive setup and teardown once per `TEST_CASE`, without having to resort to abusing event listeners or static function variables with manual initialization.


Implements #1602

---------

Co-authored-by: Martin Hořeňovský &lt;martin.horenovsky@gmail.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This PR introduces a new `TEST_CASE` macro called `TEST_CASE_PERSISTENT_FIXTURE`. `TEST_CASE_PERSISTENT_FIXTURE` offers the same functionality as `TEST_CASE_METHOD` except for one difference. The object on which the test method is invoked is only created once for all invocations of the test case. The object is created just after the `testCaseStarting` event is broadcast and the object is destroyed just before the `testCaseEnding` event is broadcast.

The main motivation for this new functionality is to allow `TEST_CASE`s to do expensive setup and teardown once per `TEST_CASE`, without having to resort to abusing event listeners or static function variables with manual initialization.


Implements #1602

---------

Co-authored-by: Martin Hořeňovský &lt;martin.horenovsky@gmail.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>Split ITestInvoker into its own header</title>
<updated>2023-03-23T15:50:11+00:00</updated>
<author>
<name>Martin Hořeňovský</name>
</author>
<published>2023-03-23T13:02:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=1f881ab4641b866304b818a063164dae976dba5f'/>
<id>1f881ab4641b866304b818a063164dae976dba5f</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Reduce internal includes</title>
<updated>2023-03-20T18:24:52+00:00</updated>
<author>
<name>Martin Hořeňovský</name>
</author>
<published>2023-03-14T22:00:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=62167d756e13d8f053b397c07f1192d8e308f2c5'/>
<id>62167d756e13d8f053b397c07f1192d8e308f2c5</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix references to license file</title>
<updated>2022-10-28T09:30:15+00:00</updated>
<author>
<name>Lars Toenning</name>
</author>
<published>2022-10-28T09:22:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=f1084fb30990fe40c8f5b70034970c7eb4e1da72'/>
<id>f1084fb30990fe40c8f5b70034970c7eb4e1da72</id>
<content type='text'>
The license file was renamed with 6a502cc2f5fedd59b3495b58708f0d6d987ed9e1
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The license file was renamed with 6a502cc2f5fedd59b3495b58708f0d6d987ed9e1
</pre>
</div>
</content>
</entry>
<entry>
<title>Sweep out some Wsign-conversion warnings</title>
<updated>2021-11-23T22:16:08+00:00</updated>
<author>
<name>Martin Hořeňovský</name>
</author>
<published>2021-11-20T22:40:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=8cb8f0b08b0ec35edd346df999f3b854ad05aa41'/>
<id>8cb8f0b08b0ec35edd346df999f3b854ad05aa41</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Use StringRef for className in TestCaseInfo</title>
<updated>2021-09-27T17:07:45+00:00</updated>
<author>
<name>Martin Hořeňovský</name>
</author>
<published>2021-09-27T14:10:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=f02c2678a1a891f9577712fe160c1f6f3baef3a8'/>
<id>f02c2678a1a891f9577712fe160c1f6f3baef3a8</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Replace uses of std::move and std::forward with macros</title>
<updated>2021-08-16T14:22:19+00:00</updated>
<author>
<name>Martin Hořeňovský</name>
</author>
<published>2021-08-13T12:16:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=d2ee7100d26128b3956571cc802f3a52c9b9aea8'/>
<id>d2ee7100d26128b3956571cc802f3a52c9b9aea8</id>
<content type='text'>
This improves the SelfTest build times by about 3% (measured
with Clang 10 on random Linux box I had lying around).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This improves the SelfTest build times by about 3% (measured
with Clang 10 on random Linux box I had lying around).
</pre>
</div>
</content>
</entry>
<entry>
<title>Move extractClassName to the single calling TU and make it static</title>
<updated>2021-06-18T21:39:07+00:00</updated>
<author>
<name>Martin Hořeňovský</name>
</author>
<published>2021-06-18T21:36:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=28a33497be6c6d18d9fc6e2e4cfe6ce7b50680be'/>
<id>28a33497be6c6d18d9fc6e2e4cfe6ce7b50680be</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
