diff options
author | Herbert Thielen <thielen@hs-worms.de> | 2017-09-08 09:47:45 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-08 09:47:45 (GMT) |
commit | 803ab9a860694e96e2c48784c12dbdee30447726 (patch) | |
tree | 09c3cd45aa96e9598b28965a2194fcc5ba41ce2a /googletest | |
parent | e8c6942ac1570c9598cf2d177f6c69cc5ab2bd7b (diff) | |
parent | 894cdb82cb2a1141bde8710a67ea4c5325d1d202 (diff) | |
download | googletest-803ab9a860694e96e2c48784c12dbdee30447726.zip googletest-803ab9a860694e96e2c48784c12dbdee30447726.tar.gz googletest-803ab9a860694e96e2c48784c12dbdee30447726.tar.bz2 |
Merge branch 'master' into hethi/remove-linker-warning-on-non-existing-pathrefs/pull/1250/head
Diffstat (limited to 'googletest')
-rw-r--r-- | googletest/cmake/internal_utils.cmake | 11 | ||||
-rw-r--r-- | googletest/test/gtest-param-test_test.cc | 4 | ||||
-rw-r--r-- | googletest/test/gtest_unittest.cc | 2 |
3 files changed, 11 insertions, 6 deletions
diff --git a/googletest/cmake/internal_utils.cmake b/googletest/cmake/internal_utils.cmake index ec5d08c..9915c11 100644 --- a/googletest/cmake/internal_utils.cmake +++ b/googletest/cmake/internal_utils.cmake @@ -48,10 +48,14 @@ endmacro() macro(config_compiler_and_linker) # Note: pthreads on MinGW is not supported, even if available # instead, we use windows threading primitives + unset(GTEST_HAS_PTHREAD) if (NOT gtest_disable_pthreads AND NOT MINGW) # Defines CMAKE_USE_PTHREADS_INIT and CMAKE_THREAD_LIBS_INIT. set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads) + if (CMAKE_USE_PTHREADS_INIT) + set(GTEST_HAS_PTHREAD ON) + endif() endif() fix_default_compiler_settings_() @@ -94,7 +98,7 @@ macro(config_compiler_and_linker) set(cxx_no_exception_flags "-D_HAS_EXCEPTIONS=0") set(cxx_no_rtti_flags "-GR-") elseif (CMAKE_COMPILER_IS_GNUCXX) - set(cxx_base_flags "-Wall -Wshadow") + set(cxx_base_flags "-Wall -Wshadow -Werror") set(cxx_exception_flags "-fexceptions") set(cxx_no_exception_flags "-fno-exceptions") # Until version 4.3.2, GCC doesn't define a macro to indicate @@ -126,7 +130,8 @@ macro(config_compiler_and_linker) set(cxx_no_rtti_flags "") endif() - if (CMAKE_USE_PTHREADS_INIT) # The pthreads library is available and allowed. + # The pthreads library is available and allowed? + if (DEFINED GTEST_HAS_PTHREAD) set(GTEST_HAS_PTHREAD_MACRO "-DGTEST_HAS_PTHREAD=1") else() set(GTEST_HAS_PTHREAD_MACRO "-DGTEST_HAS_PTHREAD=0") @@ -159,7 +164,7 @@ function(cxx_library_with_type name type cxx_flags) PROPERTIES COMPILE_DEFINITIONS "GTEST_CREATE_SHARED_LIBRARY=1") endif() - if (CMAKE_USE_PTHREADS_INIT) + if (DEFINED GTEST_HAS_PTHREAD) target_link_libraries(${name} ${CMAKE_THREAD_LIBS_INIT}) endif() endfunction() diff --git a/googletest/test/gtest-param-test_test.cc b/googletest/test/gtest-param-test_test.cc index 857f6c5..d1b0644 100644 --- a/googletest/test/gtest-param-test_test.cc +++ b/googletest/test/gtest-param-test_test.cc @@ -857,8 +857,8 @@ TEST_P(CustomLambdaNamingTest, CustomTestNames) {} INSTANTIATE_TEST_CASE_P(CustomParamNameLambda, CustomLambdaNamingTest, Values(std::string("LambdaName")), - [](const ::testing::TestParamInfo<std::string>& info) { - return info.param; + [](const ::testing::TestParamInfo<std::string>& tpinfo) { + return tpinfo.param; }); #endif // GTEST_LANG_CXX11 diff --git a/googletest/test/gtest_unittest.cc b/googletest/test/gtest_unittest.cc index f84def9..745c950 100644 --- a/googletest/test/gtest_unittest.cc +++ b/googletest/test/gtest_unittest.cc @@ -2096,7 +2096,7 @@ class UnitTestRecordPropertyTestEnvironment : public Environment { }; // This will test property recording outside of any test or test case. -static Environment* record_property_env = +Environment* record_property_env GTEST_ATTRIBUTE_UNUSED_ = AddGlobalTestEnvironment(new UnitTestRecordPropertyTestEnvironment); // This group of tests is for predicate assertions (ASSERT_PRED*, etc) |