<feed xmlns='http://www.w3.org/2005/Atom'>
<title>catch3/tests/TestScripts/DiscoverTests/register-tests.cpp, branch chore/cpp17-descriptions</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>Give Catch3 its own build names and headers</title>
<updated>2026-10-24T23:37:35+00:00</updated>
<author>
<name>Leitwolf11</name>
</author>
<published>2026-10-24T23:37:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=126dc333564cb72b5115d9a9242d66694694b6d0'/>
<id>126dc333564cb72b5115d9a9242d66694694b6d0</id>
<content type='text'>
Catch2 compatibility means the API tests are written in: the macros, such
as TEST_CASE and REQUIRE, and the Catch:: namespace. It does not mean
Catch2's build names or header paths. find_package(Catch2) found Catch3,
and a project using both frameworks met two packages, two sets of targets,
two Catch.cmake modules and two catch2/ header trees with the same names.

Build names:
- CMake: project and package Catch3, targets Catch3::Catch3 and
  Catch3::Catch3WithMain, libraries Catch3 and Catch3Main, options
  CATCH3_*, lib/cmake/Catch3 with Catch3Config, and pkg-config catch3 and
  catch3-with-main. The version is Catch3's, 0.3.0, compatible within a
  minor version.
- The CMake scripts are Catch3.cmake (catch3_discover_tests),
  Catch3AddTests.cmake and Catch3ShardTests.cmake
  (catch3_add_sharded_tests); the helpers they define at ctest time have a
  catch3_ prefix. ParseAndAddCatchTests.cmake, deprecated upstream, is gone.
- Bazel //:catch3 and //:catch3_main, Meson catch3 and catch3-with-main
  (with override_dependency), Xmake catch3 and catch3_main, Premake Catch3
  and Catch3WithMain. Visual Studio projects get GUIDs of their own.
- The Progmasoft::Catch3 target and package are gone: property testing
  and snapshots are part of Catch3::Catch3. Their sources now build with
  the library's warning flags, so property failures are built field by
  field (no missing initializers) and the default property name is a
  thread-local pointer to the name its scope owns (no global destructor).

Headers: the engine moved from src/catch2 to src/Progmasoft/Catch3 with
Progmasoft names, so &lt;catch2/catch_test_macros.hpp&gt; is
&lt;Progmasoft/Catch3/TestMacros.hpp&gt;, &lt;catch2/matchers/catch_matchers_string.hpp&gt;
is &lt;Progmasoft/Catch3/Matchers/String.hpp&gt;, and interface headers are named
after their interface, such as Interfaces/IConfig.hpp. Include guards
became #pragma once. The installed headers go to include/Progmasoft.
src/Progmasoft/Context.cpp is StrategyContext.cpp, so no two sources share
a file name.

tools/scripts/upstreamFiles.txt lists the files that come from Catch2.
The license check expects BSL-1.0 on them and Progmasoft's header on the
rest of src/Progmasoft; the convenience-header check, the amalgamation
script and the surrogate tests take the engine's headers from it. The
amalgamated files are regenerated. The header-guard workflow checks for
#pragma once instead of checkguard.

Documents, the README and the release notes describe the new names.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Catch2 compatibility means the API tests are written in: the macros, such
as TEST_CASE and REQUIRE, and the Catch:: namespace. It does not mean
Catch2's build names or header paths. find_package(Catch2) found Catch3,
and a project using both frameworks met two packages, two sets of targets,
two Catch.cmake modules and two catch2/ header trees with the same names.

Build names:
- CMake: project and package Catch3, targets Catch3::Catch3 and
  Catch3::Catch3WithMain, libraries Catch3 and Catch3Main, options
  CATCH3_*, lib/cmake/Catch3 with Catch3Config, and pkg-config catch3 and
  catch3-with-main. The version is Catch3's, 0.3.0, compatible within a
  minor version.
- The CMake scripts are Catch3.cmake (catch3_discover_tests),
  Catch3AddTests.cmake and Catch3ShardTests.cmake
  (catch3_add_sharded_tests); the helpers they define at ctest time have a
  catch3_ prefix. ParseAndAddCatchTests.cmake, deprecated upstream, is gone.
- Bazel //:catch3 and //:catch3_main, Meson catch3 and catch3-with-main
  (with override_dependency), Xmake catch3 and catch3_main, Premake Catch3
  and Catch3WithMain. Visual Studio projects get GUIDs of their own.
- The Progmasoft::Catch3 target and package are gone: property testing
  and snapshots are part of Catch3::Catch3. Their sources now build with
  the library's warning flags, so property failures are built field by
  field (no missing initializers) and the default property name is a
  thread-local pointer to the name its scope owns (no global destructor).

Headers: the engine moved from src/catch2 to src/Progmasoft/Catch3 with
Progmasoft names, so &lt;catch2/catch_test_macros.hpp&gt; is
&lt;Progmasoft/Catch3/TestMacros.hpp&gt;, &lt;catch2/matchers/catch_matchers_string.hpp&gt;
is &lt;Progmasoft/Catch3/Matchers/String.hpp&gt;, and interface headers are named
after their interface, such as Interfaces/IConfig.hpp. Include guards
became #pragma once. The installed headers go to include/Progmasoft.
src/Progmasoft/Context.cpp is StrategyContext.cpp, so no two sources share
a file name.

tools/scripts/upstreamFiles.txt lists the files that come from Catch2.
The license check expects BSL-1.0 on them and Progmasoft's header on the
rest of src/Progmasoft; the convenience-header check, the amalgamation
script and the surrogate tests take the engine's headers from it. The
amalgamated files are regenerated. The header-guard workflow checks for
#pragma once instead of checkguard.

Documents, the README and the release notes describe the new names.
</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>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>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 adding test tags as CTest labels in catch_discover_tests</title>
<updated>2025-01-05T19:02:00+00:00</updated>
<author>
<name>Martin Hořeňovský</name>
</author>
<published>2025-01-03T09:30:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=7d7b2f89f24cbd277f6eb6912705e5e13c68a3c7'/>
<id>7d7b2f89f24cbd277f6eb6912705e5e13c68a3c7</id>
<content type='text'>
We also bump the minimum CMake version to 3.20 as per #2943
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We also bump the minimum CMake version to 3.20 as per #2943
</pre>
</div>
</content>
</entry>
<entry>
<title>2 more TEST_CASEs to DiscoverTests/register-tests.cpp</title>
<updated>2023-07-03T22:06:24+00:00</updated>
<author>
<name>Martin Hořeňovský</name>
</author>
<published>2023-07-03T22:06:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=1b049bdba40582d7c9c8f6e650496f701841b26d'/>
<id>1b049bdba40582d7c9c8f6e650496f701841b26d</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix handling of semicolon and backslash characters in CMake test discovery (#2676)</title>
<updated>2023-06-14T21:40:10+00:00</updated>
<author>
<name>Robin Christ</name>
</author>
<published>2023-06-14T21:40:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=42ee66b5e625b7ed43727e3617af58ca8fad4a12'/>
<id>42ee66b5e625b7ed43727e3617af58ca8fad4a12</id>
<content type='text'>
This PR fixes the handling of semicolon and backslash characters in test names in the CMake test discovery

Closes #2674 </content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This PR fixes the handling of semicolon and backslash characters in test names in the CMake test discovery

Closes #2674 </pre>
</div>
</content>
</entry>
<entry>
<title>Add test scaffolding for catch_discover_tests</title>
<updated>2023-06-14T19:14:33+00:00</updated>
<author>
<name>Martin Hořeňovský</name>
</author>
<published>2023-06-14T14:30:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=c8363143e7caad34520042158468a69aeae59a0d'/>
<id>c8363143e7caad34520042158468a69aeae59a0d</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
