Bazaar: GTest test main function reorganization.

git-svn-id: svn://ultimatepp.org/upp/trunk@15022 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
klugier 2020-09-12 15:23:17 +00:00
parent cfd070d0c2
commit 2310f9bce7
3 changed files with 16 additions and 31 deletions

View file

@ -1,3 +1,4 @@
#include <Core/Core.h>
#include <plugin/gtest/gtest.h>
TEST_APP_MAIN {}

View file

@ -15,7 +15,7 @@ class AppWindowTest : public testing::Test
{
protected:
AppWindowTest()
: windowRect(0, 0, 200, 200)
: windowRect(0, 0, 250, 250)
{}
void SetUp() override

View file

@ -3,36 +3,20 @@
#include <Core/config.h>
#if defined(PLATFORM_WIN32) || defined(PLATFORM_WIN64)
#define TEST_APP_MAIN \
void TestMainFn(int argc, char** argv); \
\
int main(int argc, char** argv) \
{ \
Upp::MemoryIgnoreLeaksBlock __; \
testing::InitGoogleTest(&argc, argv); \
TestMainFn(argc, argv); \
return RUN_ALL_TESTS(); \
} \
\
void TestMainFn(int argc, char** argv)
#else
#define TEST_APP_MAIN \
void TestMainFn(int argc, char** argv); \
\
int main(int argc, char** argv) \
{ \
testing::InitGoogleTest(&argc, argv); \
TestMainFn(argc, argv); \
return RUN_ALL_TESTS(); \
} \
\
void TestMainFn(int argc, char** argv)
#endif
#define TEST_APP_MAIN \
void TestMainFn(); \
\
int main(int argc, char** argv) \
{ \
UPP::AppInit__(argc, (const char **)argv); \
testing::InitGoogleTest(&argc, argv); \
UPP::AppExecute__(TestMainFn); \
int testsResult = RUN_ALL_TESTS(); \
UPP::AppExit__(); \
return testsResult; \
} \
\
void TestMainFn()
#if defined(PLATFORM_WIN32) || defined(PLATFORM_WIN64)