diff options
author | kosak <kosak@google.com> | 2015-07-27 21:18:24 +0000 |
---|---|---|
committer | kosak <kosak@google.com> | 2015-07-27 21:18:24 +0000 |
commit | f487e9510be94c70f08485887a16b48d756bf38f (patch) | |
tree | d2caa162bfa728c2348d8ba7309a57bfc5e31836 | |
parent | 4188ec35292595660c1bc5b6f35cefe17188e1ab (diff) | |
download | googletest-f487e9510be94c70f08485887a16b48d756bf38f.tar.gz googletest-f487e9510be94c70f08485887a16b48d756bf38f.tar.bz2 googletest-f487e9510be94c70f08485887a16b48d756bf38f.zip |
Inject the name of the Init function using a macro.
-rw-r--r-- | include/gtest/internal/gtest-port.h | 4 | ||||
-rw-r--r-- | test/gtest-port_test.cc | 8 |
2 files changed, 9 insertions, 3 deletions
diff --git a/include/gtest/internal/gtest-port.h b/include/gtest/internal/gtest-port.h index 30997f35..f17cf92d 100644 --- a/include/gtest/internal/gtest-port.h +++ b/include/gtest/internal/gtest-port.h @@ -290,6 +290,10 @@ # define GTEST_PROJECT_URL_ "http://code.google.com/p/googletest/" #endif // !defined(GTEST_DEV_EMAIL_) +#if !defined(GTEST_INIT_GOOGLE_TEST_NAME_) +# define GTEST_INIT_GOOGLE_TEST_NAME_ "testing::InitGoogleTest" +#endif // !defined(GTEST_INIT_GOOGLE_TEST_NAME_) + // Determines the version of gcc that is used to compile this. #ifdef __GNUC__ // 40302 means version 4.3.2. diff --git a/test/gtest-port_test.cc b/test/gtest-port_test.cc index 14418804..d17bad00 100644 --- a/test/gtest-port_test.cc +++ b/test/gtest-port_test.cc @@ -382,15 +382,17 @@ TEST(GtestCheckDeathTest, LivesSilentlyOnSuccess) { // the platform. The test will produce compiler errors in case of failure. // For simplicity, we only cover the most important platforms here. TEST(RegexEngineSelectionTest, SelectsCorrectRegexEngine) { -#if GTEST_HAS_POSIX_RE +#if !GTEST_USES_PCRE +# if GTEST_HAS_POSIX_RE EXPECT_TRUE(GTEST_USES_POSIX_RE); -#else +# else EXPECT_TRUE(GTEST_USES_SIMPLE_RE); -#endif +# endif +#endif // !GTEST_USES_PCRE } #if GTEST_USES_POSIX_RE |