-
Notifications
You must be signed in to change notification settings - Fork 186
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not show message dialog on debug assertion failures in the standal…
…one tests on Windows CI. (#5306) [SC-55089](https://app.shortcut.com/tiledb-inc/story/55089/do-not-show-message-dialog-on-debug-assertion-failures-in-the-standalone-tests-on-windows-ci) This PR replaces uses of the `Catch2::Catch2WithMain` CMake target with a new `tdb_Catch2WithMain`, that calls `_set_abort_behavior` to suppress showing a message dialog on debug assertion failures on Windows CI, extending what was done in #5305 for `tiledb_unit` to all other test executables. --- TYPE: NO_HISTORY
- Loading branch information
1 parent
5cee0ca
commit 20af8b3
Showing
10 changed files
with
69 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// Copyright Catch2 Authors | ||
// Distributed under the Boost Software License, Version 1.0. | ||
// (See accompanying file LICENSE.txt or copy at | ||
// https://www.boost.org/LICENSE_1_0.txt) | ||
|
||
// SPDX-License-Identifier: BSL-1.0 | ||
#include <catch2/catch_session.hpp> | ||
#include <catch2/internal/catch_compiler_capabilities.hpp> | ||
#include <catch2/internal/catch_config_wchar.hpp> | ||
#include <catch2/internal/catch_leak_detector.hpp> | ||
#include <catch2/internal/catch_platform.hpp> | ||
|
||
#include <cstdlib> | ||
|
||
namespace Catch { | ||
CATCH_INTERNAL_START_WARNINGS_SUPPRESSION | ||
CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS | ||
static LeakDetector leakDetector; | ||
CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION | ||
} // namespace Catch | ||
|
||
// Allow users of amalgamated .cpp file to remove our main and provide their | ||
// own. | ||
#if !defined(CATCH_AMALGAMATED_CUSTOM_MAIN) | ||
|
||
#if defined(CATCH_CONFIG_WCHAR) && defined(CATCH_PLATFORM_WINDOWS) && \ | ||
defined(_UNICODE) && !defined(DO_NOT_USE_WMAIN) | ||
// Standard C/C++ Win32 Unicode wmain entry point | ||
extern "C" int __cdecl wmain(int argc, wchar_t* argv[], wchar_t*[]) { | ||
#else | ||
// Standard C/C++ main entry point | ||
int main(int argc, char* argv[]) { | ||
#endif | ||
#if defined(_MSC_VER) | ||
// We disable the following events on abort in CI environments: | ||
// _WRITE_ABORT_MSG: Display message box with Abort, Retry, Ignore | ||
// _CALL_REPORTFAULT: Send an error report to Microsoft | ||
// The second parameter specifies which flags to change, and the first | ||
// the value of these flags. | ||
if (std::getenv("CI") != nullptr) { | ||
_set_abort_behavior(0, _WRITE_ABORT_MSG | _CALL_REPORTFAULT); | ||
} | ||
#endif | ||
|
||
// We want to force the linker not to discard the global variable | ||
// and its constructor, as it (optionally) registers leak detector | ||
(void)&Catch::leakDetector; | ||
|
||
return Catch::Session().run(argc, argv); | ||
} | ||
|
||
#endif // !defined(CATCH_AMALGAMATED_CUSTOM_MAIN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters