Skip to content

Commit

Permalink
Only test SEH handling with MSVC
Browse files Browse the repository at this point in the history
MinGW doesn't support `__try` and friends at all, while Clang
only supports it partially, and the test would require some
changes to make it work there. Since this is only a test, we can
afford to keep it MSVC-only.

Closes catchorg#2447
  • Loading branch information
horenmar authored and nicramage committed Jan 30, 2024
1 parent a7cfbfc commit 05ae994
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions projects/SelfTest/UsageTests/Misc.tests.cpp
Expand Up @@ -490,7 +490,8 @@ TEMPLATE_TEST_CASE_SIG("#1954 - 7 arg template test case sig compiles", "[regres
SUCCEED();
}

#if defined(CATCH_PLATFORM_WINDOWS)
// MinGW doesn't support __try, and Clang has only very partial support
#if defined(_MSC_VER)
#include <Windows.h>

void throw_and_catch()
Expand Down Expand Up @@ -521,6 +522,6 @@ TEST_CASE("Validate SEH behavior - unhandled", "[.approvals][FatalConditionHandl
// Validate that Catch2 framework correctly handles tests raising and not handling SEH exceptions.
throw_no_catch();
}
#endif
#endif // _MSC_VER

}} // namespace MiscTests

0 comments on commit 05ae994

Please sign in to comment.