<feed xmlns='http://www.w3.org/2005/Atom'>
<title>catch3/tests/TestScripts, branch feature/native-property-engine</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>Harden Catch3 exit guards and pin build workflows</title>
<updated>2026-09-27T22:10:14+00:00</updated>
<author>
<name>Leitwolf11</name>
</author>
<published>2026-09-27T22:10:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=97328fefe9650c84b594f1cea212c48562e1745b'/>
<id>97328fefe9650c84b594f1cea212c48562e1745b</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Pass the parent toolchain to CMake configuration tests</title>
<updated>2026-09-14T12:08:28+00:00</updated>
<author>
<name>宁岑</name>
</author>
<published>2026-09-08T09:37:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=02f8b5593a15cdec8558256e6f40a0c7fb5862d6'/>
<id>02f8b5593a15cdec8558256e6f40a0c7fb5862d6</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 registers tests with --order decl</title>
<updated>2026-09-11T11:13:15+00:00</updated>
<author>
<name>Martin Hořeňovský</name>
</author>
<published>2026-09-11T11:13:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=6534dbc3ef3a162111830d9b5d8a9092d378336d'/>
<id>6534dbc3ef3a162111830d9b5d8a9092d378336d</id>
<content type='text'>
Catch2 defaults to random test execution order, which has to process
all tests present in the binary, even if they will be filtered down
to just 1 later. For the `SelfTest` binary, the overhead from this is
about 20% in Debug configuration and 5% in Release.

By registering the CTest tests with `--order decl`, we avoid this
overhead.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Catch2 defaults to random test execution order, which has to process
all tests present in the binary, even if they will be filtered down
to just 1 later. For the `SelfTest` binary, the overhead from this is
about 20% in Debug configuration and 5% in Release.

By registering the CTest tests with `--order decl`, we avoid this
overhead.
</pre>
</div>
</content>
</entry>
<entry>
<title>Support TEST_{PREFIX,SUFFIX} with leading/trailing whitespace</title>
<updated>2026-08-20T14:24:18+00:00</updated>
<author>
<name>Martin Hořeňovský</name>
</author>
<published>2026-08-20T12:45:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=8582805f548e3e091d8d35188f4c3a690f989b0f'/>
<id>8582805f548e3e091d8d35188f4c3a690f989b0f</id>
<content type='text'>
Closes #2149
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Closes #2149
</pre>
</div>
</content>
</entry>
<entry>
<title>catch_discover_tests: Escape test-invariant parts of CTest script only once</title>
<updated>2026-08-10T09:53:22+00:00</updated>
<author>
<name>Martin Hořeňovský</name>
</author>
<published>2026-08-10T09:45:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=97ec4e8e2e4a86719701746d1cb2426f16292ff8'/>
<id>97ec4e8e2e4a86719701746d1cb2426f16292ff8</id>
<content type='text'>
Previously, the `catch_discover_tests` would prepare the entire CTest
command (e.g. `add_test(...)` or `set_tests_properties(...)`) first, and
then escape it when finished. However, this caused lot of the command args
to be escaped over and over again (e.g. executable name or Catch2's reporter
args), for no reason, as they were always the same, and thus their escaping
was always the same.

Until recently, the performance overhead didn't matter as there were many
spots which had quadratic runtime in number of tests. However, the recent
refactorings fixed these, and this commit now improves the throughput by
10-20%.

Also extended the benchmarked COUNTS in `benchmark_discovery.py`,
because the performance is now good enough that it is reasonable
to benchmark 16k tests.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, the `catch_discover_tests` would prepare the entire CTest
command (e.g. `add_test(...)` or `set_tests_properties(...)`) first, and
then escape it when finished. However, this caused lot of the command args
to be escaped over and over again (e.g. executable name or Catch2's reporter
args), for no reason, as they were always the same, and thus their escaping
was always the same.

Until recently, the performance overhead didn't matter as there were many
spots which had quadratic runtime in number of tests. However, the recent
refactorings fixed these, and this commit now improves the throughput by
10-20%.

Also extended the benchmarked COUNTS in `benchmark_discovery.py`,
because the performance is now good enough that it is reasonable
to benchmark 16k tests.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix &lt;target&gt;_TESTS variable generated by `catch_discover_tests`</title>
<updated>2026-08-09T22:17:26+00:00</updated>
<author>
<name>Martin Hořeňovský</name>
</author>
<published>2026-08-08T12:59:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=630840c5000ec9f5e169c8a2f5fd163d3b0c54ca'/>
<id>630840c5000ec9f5e169c8a2f5fd163d3b0c54ca</id>
<content type='text'>
There were 2 separate bugs, one recently added and one ancient
(since roughly the first version of the registration script).

1) The recent refactoring of how the JSON output from Catch2 is
   parsed caused shadowing between the variable containing the
   per-test JSON fragments and the accumulator of test names for
   &lt;target&gt;_TESTS variable. This led to the variable containing
   both the names and the JSON fragments, and thus being completely
   wrong.

2) The test name accumulation has never accounted for characters
   that need escaping to be present in a CMake list. This means
   that e.g. test names with semicolon in them would end up with
   two elements in the test list.

Both of these are now fixed, at the cost of extra complexity and
my sanity as I had to learn more about CMake escaping rules.

(CMake escaping rules are dumb)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There were 2 separate bugs, one recently added and one ancient
(since roughly the first version of the registration script).

1) The recent refactoring of how the JSON output from Catch2 is
   parsed caused shadowing between the variable containing the
   per-test JSON fragments and the accumulator of test names for
   &lt;target&gt;_TESTS variable. This led to the variable containing
   both the names and the JSON fragments, and thus being completely
   wrong.

2) The test name accumulation has never accounted for characters
   that need escaping to be present in a CMake list. This means
   that e.g. test names with semicolon in them would end up with
   two elements in the test list.

Both of these are now fixed, at the cost of extra complexity and
my sanity as I had to learn more about CMake escaping rules.

(CMake escaping rules are dumb)
</pre>
</div>
</content>
</entry>
<entry>
<title>JSONReporter's listTests only lists class-name if it is non-empty</title>
<updated>2026-08-07T21:07:46+00:00</updated>
<author>
<name>Martin Hořeňovský</name>
</author>
<published>2026-07-29T08:05:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=0b4d7a5a1696dbdfb23fccad8c50db9dc9a417ea'/>
<id>0b4d7a5a1696dbdfb23fccad8c50db9dc9a417ea</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<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>
</feed>
