File tree 3 files changed +45
-1
lines changed
3 files changed +45
-1
lines changed Original file line number Diff line number Diff line change @@ -467,6 +467,18 @@ set_tests_properties(
467
467
PASS_REGULAR_EXPRESSION "Errors occurred during startup!"
468
468
)
469
469
470
+ add_executable (ReportingCrashWithJunitReporter ${TESTS_DIR} /X36-ReportingCrashWithJunitReporter.cpp)
471
+ target_link_libraries (ReportingCrashWithJunitReporter PRIVATE Catch2::Catch2WithMain)
472
+ add_test (
473
+ NAME Reporters::CrashInJunitReporter
474
+ COMMAND ${CMAKE_COMMAND} -E env $<TARGET_FILE:ReportingCrashWithJunitReporter> --reporter JUnit
475
+ )
476
+ set_tests_properties (
477
+ Reporters::CrashInJunitReporter
478
+ PROPERTIES
479
+ PASS_REGULAR_EXPRESSION "</testsuites>"
480
+ LABELS "uses-signals"
481
+ )
470
482
471
483
add_executable (AssertionStartingEventGoesBeforeAssertionIsEvaluated
472
484
X20-AssertionStartingEventGoesBeforeAssertionIsEvaluated.cpp
Original file line number Diff line number Diff line change
1
+
2
+ // Copyright Catch2 Authors
3
+ // Distributed under the Boost Software License, Version 1.0.
4
+ // (See accompanying file LICENSE.txt or copy at
5
+ // https://www.boost.org/LICENSE_1_0.txt)
6
+
7
+ // SPDX-License-Identifier: BSL-1.0
8
+
9
+ /* *\file
10
+ * Checks that signals/SEH within open section does not hard crash JUnit
11
+ * (or similar reporter) while we are trying to report fatal error.
12
+ */
13
+
14
+ #include < catch2/catch_test_macros.hpp>
15
+
16
+ #include < csignal>
17
+
18
+ // On Windows we need to send SEH and not signal to test the
19
+ // RunContext::handleFatalErrorCondition code path
20
+ #if defined( _MSC_VER )
21
+ # include < windows.h>
22
+ #endif
23
+
24
+ TEST_CASE ( " raises signal" ) {
25
+ SECTION ( " section" ) {
26
+ #if defined( _MSC_VER )
27
+ RaiseException ( 0xC0000005 , 0 , 0 , NULL );
28
+ #else
29
+ std::raise ( SIGILL );
30
+ #endif
31
+ }
32
+ }
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug\AutoExclusion
5
5
cd Build
6
6
if " %CONFIGURATION% " == " Debug" (
7
7
if " %coverage% " == " 1" (
8
- ctest -j 2 -C %CONFIGURATION% -D ExperimentalMemCheck || exit /b !ERRORLEVEL!
8
+ ctest -j 2 -C %CONFIGURATION% -D ExperimentalMemCheck -LE uses-signals || exit /b !ERRORLEVEL!
9
9
python ..\tools\misc\appveyorMergeCoverageScript.py || exit /b !ERRORLEVEL!
10
10
codecov --root .. --no-color --disable gcov -f cobertura.xml -t %CODECOV_TOKEN% || exit /b !ERRORLEVEL!
11
11
) else (
You can’t perform that action at this time.
0 commit comments