Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/tests/TestScripts/testSectionFiltering.py
diff options
context:
space:
mode:
authorMartin Hořeňovský2025-07-16 20:43:34 +0200
committerMartin Hořeňovský2025-07-17 11:27:03 +0200
commit0e8112a7625bc415ec20aac9a5a62243c7fbfb36 (patch)
tree684c4bab02c2714f196f33575b9bbdf4766323ce /tests/TestScripts/testSectionFiltering.py
parent9be81c0e05aedabbf1224ccb424ef0a628bcb9c8 (diff)
downloadcatch3-0e8112a7625bc415ec20aac9a5a62243c7fbfb36.tar.gz
Only track the last line info in RunContext
There were only two places where we used the full `AssertionInfo` instance in `m_lastAssertionInfo`: 1) when reporting unexpected exception from running a test case 2) when reporting fatal error because in those two places we do not have access to a real instance of `AssertionInfo`, but we still need to send one to the reporters. As a bonus, in both of these places we were already constructing a fake-ish assertion info, by using the last encountered source location, but dummying out the other information. Instead, we only keep track of the last encountered source location, and construct the dummy `AssertionInfo` on-demand. This finishes the set of refactoring around `m_lastAssertionInfo` in `RunContext` and improves the performance of running assertions by ~5% in both Debug and Release mode. -------------- Note that this change also causes small difference in output. It could be avoided by having an invalidation flag and tracking where the information would be invalidated before, but the difference includes more precise line location for unexpected errors (both exceptions and fatals), so I prefer the new output.
Diffstat (limited to 'tests/TestScripts/testSectionFiltering.py')
0 files changed, 0 insertions, 0 deletions