<feed xmlns='http://www.w3.org/2005/Atom'>
<title>catch3/tests, branch v3.15.3</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 quadratic JSON array parse behaviour in `catch_discover_tests`</title>
<updated>2026-07-26T17:51:58+00:00</updated>
<author>
<name>Martin Hořeňovský</name>
</author>
<published>2026-07-26T11:15:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=1079da4c5f5fea2a31d795bba95eacaa2f622849'/>
<id>1079da4c5f5fea2a31d795bba95eacaa2f622849</id>
<content type='text'>
Using CMake's `string(JSON` to parse JSON array leads to quadratic
running time in number of tests, see https://gitlab.kitware.com/cmake/cmake/-/work_items/27985

This leads to _terrible_ runtime for `catch_discover_tests` when called
on binaries with lot of tests (1k+). To get reasonable runtimes, we have
to avoid using `string(JSON` to parse out the individual test objects
from the array with all tests.

This commit replaces the sane approach of using real JSON parser with
a set of terrible hacks, where we use CMake's string APIs to split the
JSON array on what looks like object boundary (`}&lt;ws&gt;*,&lt;ws&gt;*{`), and then
checking whether the resulting thing can be parsed as JSON object. If not,
we append the next piece and check again. And again, and again, until we
get a proper JSON object.

This is all around a hilariously terrible idea, however:

1) It works in practice for all tested inputs.
2) It improves the time it takes to run `catch_discover_tests` on binary
   with 1k tests from 4.2s to 1.1s and 2k tests from 16s to 3.9s.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Using CMake's `string(JSON` to parse JSON array leads to quadratic
running time in number of tests, see https://gitlab.kitware.com/cmake/cmake/-/work_items/27985

This leads to _terrible_ runtime for `catch_discover_tests` when called
on binaries with lot of tests (1k+). To get reasonable runtimes, we have
to avoid using `string(JSON` to parse out the individual test objects
from the array with all tests.

This commit replaces the sane approach of using real JSON parser with
a set of terrible hacks, where we use CMake's string APIs to split the
JSON array on what looks like object boundary (`}&lt;ws&gt;*,&lt;ws&gt;*{`), and then
checking whether the resulting thing can be parsed as JSON object. If not,
we append the next piece and check again. And again, and again, until we
get a proper JSON object.

This is all around a hilariously terrible idea, however:

1) It works in practice for all tested inputs.
2) It improves the time it takes to run `catch_discover_tests` on binary
   with 1k tests from 4.2s to 1.1s and 2k tests from 16s to 3.9s.
</pre>
</div>
</content>
</entry>
<entry>
<title>Optimize adding test commands in catch_discover_tests</title>
<updated>2026-07-26T13:50:31+00:00</updated>
<author>
<name>Martin Hořeňovský</name>
</author>
<published>2026-07-24T10:22:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=64a551e2e7edb85e4f2cd99e5737a587eb06c35b'/>
<id>64a551e2e7edb85e4f2cd99e5737a587eb06c35b</id>
<content type='text'>
The previous approach was for `add_command` to behave as append function
via concatenating the command string internally and then saving it into
`PARENT_SCOPE`. Because this in practice ended up meaning concatenating
a copy of the string inside the function and then overwriting the string
outside the function, the performance was lacking.

The new approach is for `prepare_command` to only escape &amp; return the
command from single call, and the caller is responsible for concatenating
the result. Since the actual concatenation no longer crosses function
scope boundaries, the performance is much better, even though the scaling
is still quadratic.

The new approach only takes 1/4-1/5 of the time, saving ~1s at 1k tests,
4.5s at 2k tests and 19s at 4k tests.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The previous approach was for `add_command` to behave as append function
via concatenating the command string internally and then saving it into
`PARENT_SCOPE`. Because this in practice ended up meaning concatenating
a copy of the string inside the function and then overwriting the string
outside the function, the performance was lacking.

The new approach is for `prepare_command` to only escape &amp; return the
command from single call, and the caller is responsible for concatenating
the result. Since the actual concatenation no longer crosses function
scope boundaries, the performance is much better, even though the scaling
is still quadratic.

The new approach only takes 1/4-1/5 of the time, saving ~1s at 1k tests,
4.5s at 2k tests and 19s at 4k tests.
</pre>
</div>
</content>
</entry>
<entry>
<title>Better support for infs and NaNs in JSON writer</title>
<updated>2026-07-23T12:26:26+00:00</updated>
<author>
<name>Martin Hořeňovský</name>
</author>
<published>2026-07-23T12:26:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=c267251e709c52cda421e9490c5cbaf62914fa52'/>
<id>c267251e709c52cda421e9490c5cbaf62914fa52</id>
<content type='text'>
As the types and values sent into the writer are determined by Catch2,
I do not expect to actually need this support, but it is better to have
it and not be surprised in the future.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
As the types and values sent into the writer are determined by Catch2,
I do not expect to actually need this support, but it is better to have
it and not be surprised in the future.
</pre>
</div>
</content>
</entry>
<entry>
<title>Make JSONWriter's number handling locale-independent</title>
<updated>2026-07-22T22:10:28+00:00</updated>
<author>
<name>Martin Hořeňovský</name>
</author>
<published>2026-07-22T22:10:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=0cc833ea95bb7136c99be1b5b105780cae5766ff'/>
<id>0cc833ea95bb7136c99be1b5b105780cae5766ff</id>
<content type='text'>
Closes #3176
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Closes #3176
</pre>
</div>
</content>
</entry>
<entry>
<title>Add TEST_CASE with newlines &amp; stuff to the catch_discover_tests's tests</title>
<updated>2026-07-22T19:11:58+00:00</updated>
<author>
<name>Martin Hořeňovský</name>
</author>
<published>2026-07-22T19:11:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=8494e2dce47d944d52f497722272256dc8b2e626'/>
<id>8494e2dce47d944d52f497722272256dc8b2e626</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix --warn InfiniteGenerators firing even if the generator was filtered</title>
<updated>2026-07-07T12:09:11+00:00</updated>
<author>
<name>Martin Hořeňovský</name>
</author>
<published>2026-07-07T12:09:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=dd94b9a780e66651ff686083a66722386c540228'/>
<id>dd94b9a780e66651ff686083a66722386c540228</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Add extra test binary &amp; test for CATCH_CONFIG_FAST_COMPILE</title>
<updated>2026-07-06T09:03:47+00:00</updated>
<author>
<name>Martin Hořeňovský</name>
</author>
<published>2026-07-06T09:03:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=9f7c9f6872308d4e7c32fff2f1ac6640aa866b6a'/>
<id>9f7c9f6872308d4e7c32fff2f1ac6640aa866b6a</id>
<content type='text'>
Closes #3100
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Closes #3100
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix some test binaries in ExtraTests not having warnings enabled</title>
<updated>2026-07-06T08:22:55+00:00</updated>
<author>
<name>Martin Hořeňovský</name>
</author>
<published>2026-07-06T08:22:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=919385f7046b61ae0960d02977d95674cbe20d85'/>
<id>919385f7046b61ae0960d02977d95674cbe20d85</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>catch_discover_tests uses tempfile to retrieve JSON from the binary</title>
<updated>2026-07-04T14:36:05+00:00</updated>
<author>
<name>Martin Hořeňovský</name>
</author>
<published>2026-07-04T14:35:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=9ec44dd62b1b593e01feaf95eb485d26fcdd50ce'/>
<id>9ec44dd62b1b593e01feaf95eb485d26fcdd50ce</id>
<content type='text'>
This allows it to deal with badly behaved code, where 3rd party
dependencies write into stdout during global construction.

Closes #3162
Closes #3166
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This allows it to deal with badly behaved code, where 3rd party
dependencies write into stdout during global construction.

Closes #3162
Closes #3166
</pre>
</div>
</content>
</entry>
<entry>
<title>Avoid a potential underflow when iterating over invalid inputs</title>
<updated>2026-05-14T08:58:09+00:00</updated>
<author>
<name>Dirk Müller</name>
</author>
<published>2026-05-07T07:39:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=69e0473f6e98d47c93518424c08ee69ee632c0f0'/>
<id>69e0473f6e98d47c93518424c08ee69ee632c0f0</id>
<content type='text'>
The forward iteration logic already bounds-check for m_it != m_string-&gt;end(),
do the same for the backward iteration. The issue with the assert is
that the assert() might not be compiled in, and it is happening after
the dereference, so it was too late.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The forward iteration logic already bounds-check for m_it != m_string-&gt;end(),
do the same for the backward iteration. The issue with the assert is
that the assert() might not be compiled in, and it is happening after
the dereference, so it was too late.
</pre>
</div>
</content>
</entry>
</feed>
