diff options
author | Herbert Thielen <thielen@hs-worms.de> | 2017-09-08 11:38:27 +0200 |
---|---|---|
committer | Herbert Thielen <thielen@hs-worms.de> | 2017-09-08 11:38:27 +0200 |
commit | 8620328bcae4d753bf8bee6a46b01b4e77613934 (patch) | |
tree | 3aa4b540ae6e8e7db689b2ca2197c6f4a4381e4c | |
parent | be94bf501e649dfa6790b3cce2bbe300949b6e74 (diff) | |
parent | 894cdb82cb2a1141bde8710a67ea4c5325d1d202 (diff) | |
download | googletest-8620328bcae4d753bf8bee6a46b01b4e77613934.tar.gz googletest-8620328bcae4d753bf8bee6a46b01b4e77613934.tar.bz2 googletest-8620328bcae4d753bf8bee6a46b01b4e77613934.zip |
Merge branch 'master' into hethi/cleanup-travis-environment
-rw-r--r-- | .travis.yml | 14 | ||||
-rw-r--r-- | googletest/cmake/internal_utils.cmake | 2 | ||||
-rw-r--r-- | googletest/test/gtest-param-test_test.cc | 4 | ||||
-rw-r--r-- | googletest/test/gtest_unittest.cc | 2 | ||||
-rwxr-xr-x | travis.sh | 20 |
5 files changed, 34 insertions, 8 deletions
diff --git a/.travis.yml b/.travis.yml index 27094676..418720fd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,11 @@ install: # /usr/bin/gcc is 4.6 always, but gcc-X.Y is available. - if [ "$CXX" = "g++" ]; then export CXX="g++-4.9" CC="gcc-4.9"; fi # /usr/bin/clang is 3.4, lets override with modern one. -- if [ "$CXX" = "clang++" ] && [ "$TRAVIS_OS_NAME" = "linux" ]; then export CXX="clang++-3.7" CC="clang-3.7"; fi +- if [ "$CXX" = "clang++" ] && [ "$TRAVIS_OS_NAME" = "linux" ]; then export CXX="clang++-3.7" CC="clang-3.7"; ln -sf /usr/bin/ccache /$HOME/bin/$CXX; ln -sf /usr/bin/ccache /$HOME/bin/$CC; fi +# ccache on OS X needs installation first +- if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew install ccache; export PATH="/usr/local/opt/ccache/libexec:$PATH"; fi +# reset ccache statistics +- ccache --zero-stats - echo ${PATH} - echo ${CXX} - ${CXX} --version @@ -22,14 +26,16 @@ addons: - ubuntu-toolchain-r-test - llvm-toolchain-precise-3.7 packages: - - gcc-4.9 - g++-4.9 - clang-3.7 - - valgrind os: - linux - osx language: cpp +cache: ccache +before_cache: + # print statistics before uploading new cache + - ccache --show-stats compiler: - gcc - clang @@ -37,7 +43,7 @@ script: ./travis.sh env: matrix: - BUILD_TYPE=Debug VERBOSE=1 - - BUILD_TYPE=Debug VERBOSE=1 CXX_FLAGS=-std=c++11 + - BUILD_TYPE=Release VERBOSE=1 CXX_FLAGS=-std=c++11 notifications: email: false sudo: false diff --git a/googletest/cmake/internal_utils.cmake b/googletest/cmake/internal_utils.cmake index ce947337..9915c11f 100644 --- a/googletest/cmake/internal_utils.cmake +++ b/googletest/cmake/internal_utils.cmake @@ -98,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 diff --git a/googletest/test/gtest-param-test_test.cc b/googletest/test/gtest-param-test_test.cc index 857f6c5e..d1b0644f 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 f84def90..745c9506 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) @@ -1,5 +1,25 @@ #!/usr/bin/env sh set -evx + +# if possible, ask for the precise number of processors, +# otherwise take 2 processors as reasonable default; see +# https://docs.travis-ci.com/user/speeding-up-the-build/#Makefile-optimization +if [ -x /usr/bin/getconf ]; then + NPROCESSORS=$(/usr/bin/getconf _NPROCESSORS_ONLN) +else + NPROCESSORS=2 +fi +# as of 2017-09-04 Travis CI reports 32 processors, but GCC build +# crashes if parallelized too much (maybe memory consumption problem), +# so limit to 4 processors for the time being. +if [ $NPROCESSORS -gt 4 ] ; then + echo "$0:Note: Limiting processors to use by make from $NPROCESSORS to 4." + NPROCESSORS=4 +fi +# Tell make to use the processors. No preceding '-' required. +MAKEFLAGS="j${NPROCESSORS}" +export MAKEFLAGS + env | sort mkdir build || true |