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

summaryrefslogtreecommitdiffhomepage
path: root/src/catch2/internal/catch_run_context.cpp
diff options
context:
space:
mode:
authorMartin Hořeňovský2020-04-25 14:07:50 +0200
committerMartin Hořeňovský2020-04-25 14:07:50 +0200
commit517839fb3f7f0fd7823dadce69ab791628d1bc27 (patch)
tree5eb9c504103aa4c566a52d282e78b9fe8d6a48f8 /src/catch2/internal/catch_run_context.cpp
parentb955355ec4e887da6a02e7649af85c594ec73c93 (diff)
downloadcatch3-517839fb3f7f0fd7823dadce69ab791628d1bc27.tar.gz
Small cleanup of fatal condition handler
Diffstat (limited to 'src/catch2/internal/catch_run_context.cpp')
-rw-r--r--src/catch2/internal/catch_run_context.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/catch2/internal/catch_run_context.cpp b/src/catch2/internal/catch_run_context.cpp
index d4b6bdac..5ea1c515 100644
--- a/src/catch2/internal/catch_run_context.cpp
+++ b/src/catch2/internal/catch_run_context.cpp
@@ -2,7 +2,7 @@
#include <catch2/internal/catch_compiler_capabilities.hpp>
#include <catch2/internal/catch_context.hpp>
#include <catch2/internal/catch_enforce.hpp>
-#include <catch2/internal/catch_fatal_condition.hpp>
+#include <catch2/internal/catch_fatal_condition_handler.hpp>
#include <catch2/internal/catch_random_number_generator.hpp>
#include <catch2/internal/catch_stream.hpp>
#include <catch2/catch_timer.hpp>
@@ -377,9 +377,11 @@ namespace Catch {
}
void RunContext::invokeActiveTestCase() {
- FatalConditionHandler fatalConditionHandler; // Handle signals
+ // We need to register a handler for signals/structured exceptions
+ // before running the tests themselves, or the binary can crash
+ // without failed test being reported.
+ FatalConditionHandler _;
m_activeTestCase->invoke();
- fatalConditionHandler.reset();
}
void RunContext::handleUnfinishedSections() {