<feed xmlns='http://www.w3.org/2005/Atom'>
<title>catch3/tests/TestScripts, 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>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>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>Support filtering on both sections and generators (#3069)</title>
<updated>2026-02-15T19:27:15+00:00</updated>
<author>
<name>Martin Hořeňovský</name>
</author>
<published>2026-02-15T19:27:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=3a0cf7e75fdc571ff9ed25303fb268665f6260c0'/>
<id>3a0cf7e75fdc571ff9ed25303fb268665f6260c0</id>
<content type='text'>
Not being able to filter generators to specific element has been regularly
causing problems. It was possible to use a dynamic section to run tests
for specific element in a generator, at least if the element had a nice
string representation, but the test case would still run once per element
in the generator.

With this change, it is possible to have the generator return only one
specific element, and do so based on the index, rather than the string
representation of the element. This enables simple debugging of tests
that fail for specific generator element.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Not being able to filter generators to specific element has been regularly
causing problems. It was possible to use a dynamic section to run tests
for specific element in a generator, at least if the element had a nice
string representation, but the test case would still run once per element
in the generator.

With this change, it is possible to have the generator return only one
specific element, and do so based on the index, rather than the string
representation of the element. This enables simple debugging of tests
that fail for specific generator element.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix section filtering to make sense</title>
<updated>2025-10-16T07:16:56+00:00</updated>
<author>
<name>Martin Hořeňovský</name>
</author>
<published>2025-10-14T20:14:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=49d79e9e9c40e644304945dd5a8e4e78d0c61d10'/>
<id>49d79e9e9c40e644304945dd5a8e4e78d0c61d10</id>
<content type='text'>
Specifically, this commit makes the `-c`/`--section` parameter
strictly ordered and hierarchical, unlike how it behaved before,
which was a huge mess -- see #3038 for details.

Closes #3038
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Specifically, this commit makes the `-c`/`--section` parameter
strictly ordered and hierarchical, unlike how it behaved before,
which was a huge mess -- see #3038 for details.

Closes #3038
</pre>
</div>
</content>
</entry>
<entry>
<title>Support Bazel's TEST_PREMATURE_EXIT_FILE and add it to CLI as well</title>
<updated>2025-09-22T12:02:45+00:00</updated>
<author>
<name>Martin Hořeňovský</name>
</author>
<published>2025-09-21T09:19:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=8ed8c431c601c7b303dbfe7eb412a63f1641b812'/>
<id>8ed8c431c601c7b303dbfe7eb412a63f1641b812</id>
<content type='text'>
This tells Catch2 to create an empty file at specified path before
the tests start, and delete it after the tests finish. This allows
callers to catch cases where the test binary silently exits before
finishing (e.g. via call to `exit(0)` inside the code under test),
by looking whether the file still exists.

Closes #3020
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This tells Catch2 to create an empty file at specified path before
the tests start, and delete it after the tests finish. This allows
callers to catch cases where the test binary silently exits before
finishing (e.g. via call to `exit(0)` inside the code under test),
by looking whether the file still exists.

Closes #3020
</pre>
</div>
</content>
</entry>
<entry>
<title>Default to randomized test case order</title>
<updated>2025-07-15T10:10:40+00:00</updated>
<author>
<name>Martin Hořeňovský</name>
</author>
<published>2025-04-29T15:00:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=a483b6d7d36457b0931eca85fda1a30a2b56eb4e'/>
<id>a483b6d7d36457b0931eca85fda1a30a2b56eb4e</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>fix(python): fix invalid escape sequences</title>
<updated>2025-06-24T21:32:27+00:00</updated>
<author>
<name>Eisuke Kawashima</name>
</author>
<published>2025-06-09T01:10:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=ceed26842b3b3f93523998f7adb672672c7c2d8f'/>
<id>ceed26842b3b3f93523998f7adb672672c7c2d8f</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Use more modern `-S` for specifying CMake source dir</title>
<updated>2025-04-26T16:59:42+00:00</updated>
<author>
<name>Chris Thrasher</name>
</author>
<published>2025-04-26T16:59:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=5c97a8583dd40db40d79e9752cee7060081bdec8'/>
<id>5c97a8583dd40db40d79e9752cee7060081bdec8</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
