mirror of
https://github.com/catchorg/Catch2.git
synced 2025-11-15 14:59:38 +01:00
There are two reasons for this: 1) It is highly unlikely that someone has use for this header, which has no customization points and only provides simplest possible main, and cannot link the static library which also provides a default main implementation. 2) It being a header was causing extra complications with the convenience headers, and our checking script. This would either require special handling in the checking script, or would break user's of the main convenience header. All in all, it is simpler and better in the long term to remove it, than to fix its problems.
32 lines
1.1 KiB
C++
32 lines
1.1 KiB
C++
/*
|
|
* Distributed under the Boost Software License, Version 1.0. (See accompanying
|
|
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
*/
|
|
|
|
#include <catch2/catch_session.hpp>
|
|
#include <catch2/internal/catch_compiler_capabilities.hpp>
|
|
#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
|
|
}
|
|
|
|
#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 wmain (int argc, wchar_t * argv[], wchar_t * []) {
|
|
#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 );
|
|
}
|