From 5f3d6509e1fe61bffd877d5400a2db6dd7e11edd Mon Sep 17 00:00:00 2001 From: klugier Date: Sat, 5 Sep 2020 19:30:05 +0000 Subject: [PATCH] Bazaar: TEST_GUI_APP_MAIN GoogleTest Windows implementation. git-svn-id: svn://ultimatepp.org/upp/trunk@14991 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- bazaar/plugin/gtest/gtest-upp.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/bazaar/plugin/gtest/gtest-upp.h b/bazaar/plugin/gtest/gtest-upp.h index 86883fdad..2893a9b19 100644 --- a/bazaar/plugin/gtest/gtest-upp.h +++ b/bazaar/plugin/gtest/gtest-upp.h @@ -37,7 +37,23 @@ #endif -#if defined(PLATFORM_X11) +#if defined(PLATFORM_WIN32) || defined(PLATFORM_WIN64) + #define TEST_GUI_APP_MAIN \ + void TestGuiMainFn(); \ + \ + int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR lpCmdLine, int nCmdShow) \ + { \ + UPP::AppInitEnvironment__(); \ + UPP::Ctrl::InitWin32(hInstance); \ + testing::InitGoogleTest(&__argc, __argv); \ + int testsResult = RUN_ALL_TESTS(); \ + UPP::Ctrl::ExitWin32(); \ + UPP::AppExit__(); \ + return testsResult; \ + } \ + void TestGuiMainFn() + +#elif defined(PLATFORM_X11) #define TEST_GUI_APP_MAIN \ void TestGuiMainFn(); \