diff options
| author | Martin Hořeňovský | 2026-08-22 23:28:11 +0200 |
|---|---|---|
| committer | Martin Hořeňovský | 2026-08-22 23:28:11 +0200 |
| commit | ef3a728265292e6a1dbec727b0099d3d8b3f6420 (patch) | |
| tree | 7c2ddb997a6a1fdbd1ad25edc18966ee63ebd4dd /src/catch2/catch_registry_hub.cpp | |
| parent | 69da66ee7370d7c249ba6f2a322a78dcdd623761 (diff) | |
| download | catch3-ef3a728265292e6a1dbec727b0099d3d8b3f6420.tar.gz | |
Don't store extra copy of all `TestCaseInfo*` in `TestRegistry`
We used to store a full vector of "views" of the registered test infos,
so that it can be retrieved externally. However, the only user of that
interface left was `Session`, specifically `Session::applyFilenameAsTags`.
By moving the adding of the filename tags into the `ITestCaseRegistry`
interface, we avoid storing the vector and make the initial test registration
faster.
The new code is ugly and shows a design/layering issue, but no worse than
the previous approach did.
Diffstat (limited to 'src/catch2/catch_registry_hub.cpp')
| -rw-r--r-- | src/catch2/catch_registry_hub.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/catch2/catch_registry_hub.cpp b/src/catch2/catch_registry_hub.cpp index 25aecdde..165d74a2 100644 --- a/src/catch2/catch_registry_hub.cpp +++ b/src/catch2/catch_registry_hub.cpp @@ -72,6 +72,10 @@ namespace Catch { #endif } + ITestCaseRegistry& getMutableTestCaseRegistry() override { + return m_testCaseRegistry; + } + private: TestRegistry m_testCaseRegistry; ReporterRegistry m_reporterRegistry; |