From c33ce7c159055c956d97dbdb40532f20d71351d8 Mon Sep 17 00:00:00 2001 From: kosak Date: Mon, 27 Jul 2015 21:36:08 +0000 Subject: [PATCH] Inject the custom InitGoogleTest function using a macro. --- src/gtest.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/gtest.cc b/src/gtest.cc index bfc4f4fe..487592a6 100644 --- a/src/gtest.cc +++ b/src/gtest.cc @@ -5361,13 +5361,21 @@ void InitGoogleTestImpl(int* argc, CharType** argv) { // // Calling the function for the second time has no user-visible effect. void InitGoogleTest(int* argc, char** argv) { +#if defined(GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_) + GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_(argc, argv); +#else // defined(GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_) internal::InitGoogleTestImpl(argc, argv); +#endif // defined(GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_) } // This overloaded version can be used in Windows programs compiled in // UNICODE mode. void InitGoogleTest(int* argc, wchar_t** argv) { +#if defined(GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_) + GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_(argc, argv); +#else // defined(GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_) internal::InitGoogleTestImpl(argc, argv); +#endif // defined(GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_) } } // namespace testing