<feed xmlns='http://www.w3.org/2005/Atom'>
<title>catch3/src/catch2/internal/catch_template_test_registry.hpp, 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>Further reduce stamped out types for each templated test case</title>
<updated>2026-08-23T18:46:39+00:00</updated>
<author>
<name>Martin Hořeňovský</name>
</author>
<published>2026-08-23T13:05:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=499442d7ef9242ce1bb329d69ea13ee6d340421c'/>
<id>499442d7ef9242ce1bb329d69ea13ee6d340421c</id>
<content type='text'>
This provides further speed-ups for TUs with many test cases templated
over the same set of types. For especially test-heavy (but still
realistic) TUs, the speed up is up to 20%.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This provides further speed-ups for TUs with many test cases templated
over the same set of types. For especially test-heavy (but still
realistic) TUs, the speed up is up to 20%.
</pre>
</div>
</content>
</entry>
<entry>
<title>Tiny formatting fix in catch_template_test_registry.hpp</title>
<updated>2026-08-22T18:41:59+00:00</updated>
<author>
<name>Martin Hořeňovský</name>
</author>
<published>2026-08-20T18:39:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=f9dfb1031565f61bccabf7d95f91a7606eb74f45'/>
<id>f9dfb1031565f61bccabf7d95f91a7606eb74f45</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>fix: work around clang 20/21 + libc++ compile failure in TEMPLATE_PRODUCT_TEST_CASE with differing arities (#3173)</title>
<updated>2026-08-20T15:39:01+00:00</updated>
<author>
<name>Matt Van Horn</name>
</author>
<published>2026-08-20T15:39:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=fdfc07e571eb7f046013052a9fa57db51c6a2cb9'/>
<id>fdfc07e571eb7f046013052a9fa57db51c6a2cb9</id>
<content type='text'>
* fix: work around clang 20/21 + libc++ compile failure in TEMPLATE_PRODUCT_TEST_CASE with differing arities

Fixes #3115

* docs: reference llvm/llvm-project#130778 in the clang 20/21 workaround comment

---------

Co-authored-by: Matt Van Horn &lt;455140+mvanhorn@users.noreply.github.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* fix: work around clang 20/21 + libc++ compile failure in TEMPLATE_PRODUCT_TEST_CASE with differing arities

Fixes #3115

* docs: reference llvm/llvm-project#130778 in the clang 20/21 workaround comment

---------

Co-authored-by: Matt Van Horn &lt;455140+mvanhorn@users.noreply.github.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>fix: move struct TestName of INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_2 into the anonymous namespace</title>
<updated>2026-06-09T17:17:14+00:00</updated>
<author>
<name>Dominic Koepke</name>
</author>
<published>2026-06-08T07:22:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=b7e0310fbe42d209630b262a1c76733a04e90e13'/>
<id>b7e0310fbe42d209630b262a1c76733a04e90e13</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>fix: move struct TestName of INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE_METHOD_2 into the anonymous namespace</title>
<updated>2026-06-09T17:17:14+00:00</updated>
<author>
<name>Dominic Koepke</name>
</author>
<published>2026-06-08T07:21:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=6d4ea62200151ee50b795bf11a75f3eca53861c8'/>
<id>6d4ea62200151ee50b795bf11a75f3eca53861c8</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</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>
<entry>
<title>Avoid needless string temporary in template product test registration</title>
<updated>2025-07-09T10:29:36+00:00</updated>
<author>
<name>Martin Hořeňovský</name>
</author>
<published>2025-07-09T10:27:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=39c32b966257ccbc77f6827f359821ee453b1876'/>
<id>39c32b966257ccbc77f6827f359821ee453b1876</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Allow using only types in `TEMPLATE_TEST_CASE_SIG`. (#2995)</title>
<updated>2025-07-08T12:26:25+00:00</updated>
<author>
<name>Clement Courbet</name>
</author>
<published>2025-07-08T12:26:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=2de12cb05f1e54fc2a8f7a894f2a435297295efa'/>
<id>2de12cb05f1e54fc2a8f7a894f2a435297295efa</id>
<content type='text'>
Right now `TEMPLATE_TEST_CASE_SIG` fails to compile when the signature contains only types:

```
TEMPLATE_TEST_CASE_SIG(
  "TemplateTestSig: compiles with two type parameters",
  "[template][onlytypes]",
  ((typename U, typename V), U, V), (int,int)) {}
```

The trick is to resolve the ambiguity between the two overloads of
`get_wrapper` (`TypeList` and `Nttp`) by making one match more strongly.
We also need to allow `reg_test` to register more than one type.

Add unit tests.

Fixes #2680

---------

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>
Right now `TEMPLATE_TEST_CASE_SIG` fails to compile when the signature contains only types:

```
TEMPLATE_TEST_CASE_SIG(
  "TemplateTestSig: compiles with two type parameters",
  "[template][onlytypes]",
  ((typename U, typename V), U, V), (int,int)) {}
```

The trick is to resolve the ambiguity between the two overloads of
`get_wrapper` (`TypeList` and `Nttp`) by making one match more strongly.
We also need to allow `reg_test` to register more than one type.

Add unit tests.

Fixes #2680

---------

Co-authored-by: Martin Hořeňovský &lt;martin.horenovsky@gmail.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>Simplify test name creation for list-templated test cases</title>
<updated>2023-02-23T14:12:14+00:00</updated>
<author>
<name>Martin Hořeňovský</name>
</author>
<published>2023-02-23T14:12:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=9ff3cde87b1d8c61d2d97c34bdc71f0ec0a34a9c'/>
<id>9ff3cde87b1d8c61d2d97c34bdc71f0ec0a34a9c</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
