2020-08-30 15:43:45 +02:00
|
|
|
|
|
|
|
|
// Copyright Catch2 Authors
|
|
|
|
|
// Distributed under the Boost Software License, Version 1.0.
|
|
|
|
|
// (See accompanying file LICENSE_1_0.txt or copy at
|
|
|
|
|
// https://www.boost.org/LICENSE_1_0.txt)
|
|
|
|
|
|
|
|
|
|
// SPDX-License-Identifier: BSL-1.0
|
2020-05-07 16:24:05 +02:00
|
|
|
#include <catch2/catch_session.hpp>
|
|
|
|
|
#include <catch2/internal/catch_compiler_capabilities.hpp>
|
2020-12-28 20:29:05 +01:00
|
|
|
#include <catch2/internal/catch_config_wchar.hpp>
|
2020-05-07 16:24:05 +02:00
|
|
|
#include <catch2/internal/catch_leak_detector.hpp>
|
|
|
|
|
#include <catch2/internal/catch_platform.hpp>
|
|
|
|
|
|
|
|
|
|
namespace Catch {
|
|
|
|
|
CATCH_INTERNAL_START_WARNINGS_SUPPRESSION
|
|
|
|
|
CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS
|
|
|
|
|
LeakDetector leakDetector;
|
|
|
|
|
CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION
|
|
|
|
|
}
|
|
|
|
|
|
2021-12-02 13:49:16 +01:00
|
|
|
// Allow users of amalgamated .cpp file to remove our main and provide their own.
|
|
|
|
|
#if !defined(CATCH_AMALGAMATED_CUSTOM_MAIN)
|
|
|
|
|
|
2020-05-07 16:24:05 +02:00
|
|
|
#if defined(CATCH_CONFIG_WCHAR) && defined(CATCH_PLATFORM_WINDOWS) && defined(_UNICODE) && !defined(DO_NOT_USE_WMAIN)
|
|
|
|
|
// Standard C/C++ Win32 Unicode wmain entry point
|
2021-08-26 23:13:27 +02:00
|
|
|
extern "C" int __cdecl wmain (int argc, wchar_t * argv[], wchar_t * []) {
|
2020-05-07 16:24:05 +02:00
|
|
|
#else
|
|
|
|
|
// Standard C/C++ main entry point
|
|
|
|
|
int main (int argc, char * argv[]) {
|
|
|
|
|
#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 );
|
|
|
|
|
}
|
2021-12-02 13:49:16 +01:00
|
|
|
|
|
|
|
|
#endif // !defined(CATCH_AMALGAMATED_CUSTOM_MAIN
|