diff options
| author | Leitwolf | 2026-11-01 21:19:33 +0300 |
|---|---|---|
| committer | GitHub | 2026-11-01 21:19:33 +0300 |
| commit | 5cbd481125b881a4c2eed74050be9899eb3f23a7 (patch) | |
| tree | 496d26ff659e92cdf4e6fe27a4aa47bf52818052 /src/Progmasoft/Catch3/Internal/RunContext.cpp | |
| parent | 26a1588ae3ae183ae5c900caf3c294bdcb3f8855 (diff) | |
| parent | 8603d31fd8c1a72e30cb444f278d7a0592383ba7 (diff) | |
| download | catch3-5cbd481125b881a4c2eed74050be9899eb3f23a7.tar.gz | |
Merge pull request #30 from Progmasoft/feature/mocking
Add mocks that report through the assertion path
Diffstat (limited to 'src/Progmasoft/Catch3/Internal/RunContext.cpp')
| -rw-r--r-- | src/Progmasoft/Catch3/Internal/RunContext.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Progmasoft/Catch3/Internal/RunContext.cpp b/src/Progmasoft/Catch3/Internal/RunContext.cpp index e86be2e4..30af4533 100644 --- a/src/Progmasoft/Catch3/Internal/RunContext.cpp +++ b/src/Progmasoft/Catch3/Internal/RunContext.cpp @@ -356,6 +356,11 @@ namespace Catch { RunContext::~RunContext() { updateTotalsFromAtomics(); m_reporter->testRunEnded(TestRunStats(m_runInfo, m_totals, aborting())); + // What outlives the run, such as a mock of static lifetime, must not + // find a capture that is gone. + if ( getCurrentContext().getResultCapture() == this ) { + getCurrentMutableContext().setResultCapture( nullptr ); + } } Totals RunContext::runTest(TestCaseHandle const& testCase) { |