-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle active Sections for fatal errors #2855
Conversation
I am not familiar with the internals of Catch2, so there might be a nicer way of doing this. For example, I am not sure whether it is possible to properly construct |
Closes catchorg#1210 When a signal is caught, the destructors of Sections will not be called. Thus, we must call `sectionEndedEarly` manually for those Sections. Example test case: ``` TEST_CASE("broken") { SECTION("section") { /// Use illegal cpu instruction __asm__ __volatile__("ud2" : : : "memory"); } } ```
Additionally, it might be safe to do:
instead of a copy, but I took the "safe" route (allocating memory might also not be the best idea within a signal handler). |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## devel #2855 +/- ##
==========================================
- Coverage 91.09% 91.04% -0.05%
==========================================
Files 197 198 +1
Lines 8382 8391 +9
==========================================
+ Hits 7635 7639 +4
- Misses 747 752 +5 |
The function |
Thanks, this has been around for a while. |
Closes #1210
When a signal is caught, the destructors of Sections will not be called. Thus, we must call
sectionEndedEarly
manually for those Sections.Example test case: