mirror of
https://github.com/google/googletest.git
synced 2025-01-15 00:47:54 +08:00
Merge branch 'master' into hethi/remove-linker-warning-on-non-existing-path
This commit is contained in:
commit
803ab9a860
14
.travis.yml
14
.travis.yml
@ -7,7 +7,11 @@ install:
|
|||||||
# /usr/bin/gcc is 4.6 always, but gcc-X.Y is available.
|
# /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
|
- 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.
|
# /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 ${PATH}
|
||||||
- echo ${CXX}
|
- echo ${CXX}
|
||||||
- ${CXX} --version
|
- ${CXX} --version
|
||||||
@ -22,14 +26,16 @@ addons:
|
|||||||
- ubuntu-toolchain-r-test
|
- ubuntu-toolchain-r-test
|
||||||
- llvm-toolchain-precise-3.7
|
- llvm-toolchain-precise-3.7
|
||||||
packages:
|
packages:
|
||||||
- gcc-4.9
|
|
||||||
- g++-4.9
|
- g++-4.9
|
||||||
- clang-3.7
|
- clang-3.7
|
||||||
- valgrind
|
|
||||||
os:
|
os:
|
||||||
- linux
|
- linux
|
||||||
- osx
|
- osx
|
||||||
language: cpp
|
language: cpp
|
||||||
|
cache: ccache
|
||||||
|
before_cache:
|
||||||
|
# print statistics before uploading new cache
|
||||||
|
- ccache --show-stats
|
||||||
compiler:
|
compiler:
|
||||||
- gcc
|
- gcc
|
||||||
- clang
|
- clang
|
||||||
@ -37,7 +43,7 @@ script: ./travis.sh
|
|||||||
env:
|
env:
|
||||||
matrix:
|
matrix:
|
||||||
- SHARED_LIB=OFF STATIC_LIB=ON CMAKE_PKG=OFF BUILD_TYPE=Debug VERBOSE=1
|
- SHARED_LIB=OFF STATIC_LIB=ON CMAKE_PKG=OFF BUILD_TYPE=Debug VERBOSE=1
|
||||||
- SHARED_LIB=OFF STATIC_LIB=ON CMAKE_PKG=OFF BUILD_TYPE=Debug VERBOSE=1 CXX_FLAGS=-std=c++11
|
- SHARED_LIB=OFF STATIC_LIB=ON CMAKE_PKG=OFF BUILD_TYPE=Release VERBOSE=1 CXX_FLAGS=-std=c++11
|
||||||
notifications:
|
notifications:
|
||||||
email: false
|
email: false
|
||||||
sudo: false
|
sudo: false
|
||||||
|
@ -164,7 +164,7 @@ if (gmock_build_tests)
|
|||||||
cxx_test(gmock_link_test gmock_main test/gmock_link2_test.cc)
|
cxx_test(gmock_link_test gmock_main test/gmock_link2_test.cc)
|
||||||
cxx_test(gmock_test gmock_main)
|
cxx_test(gmock_test gmock_main)
|
||||||
|
|
||||||
if (CMAKE_USE_PTHREADS_INIT)
|
if (DEFINED GTEST_HAS_PTHREAD)
|
||||||
cxx_test(gmock_stress_test gmock)
|
cxx_test(gmock_stress_test gmock)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -48,10 +48,14 @@ endmacro()
|
|||||||
macro(config_compiler_and_linker)
|
macro(config_compiler_and_linker)
|
||||||
# Note: pthreads on MinGW is not supported, even if available
|
# Note: pthreads on MinGW is not supported, even if available
|
||||||
# instead, we use windows threading primitives
|
# instead, we use windows threading primitives
|
||||||
|
unset(GTEST_HAS_PTHREAD)
|
||||||
if (NOT gtest_disable_pthreads AND NOT MINGW)
|
if (NOT gtest_disable_pthreads AND NOT MINGW)
|
||||||
# Defines CMAKE_USE_PTHREADS_INIT and CMAKE_THREAD_LIBS_INIT.
|
# Defines CMAKE_USE_PTHREADS_INIT and CMAKE_THREAD_LIBS_INIT.
|
||||||
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
||||||
find_package(Threads)
|
find_package(Threads)
|
||||||
|
if (CMAKE_USE_PTHREADS_INIT)
|
||||||
|
set(GTEST_HAS_PTHREAD ON)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
fix_default_compiler_settings_()
|
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_exception_flags "-D_HAS_EXCEPTIONS=0")
|
||||||
set(cxx_no_rtti_flags "-GR-")
|
set(cxx_no_rtti_flags "-GR-")
|
||||||
elseif (CMAKE_COMPILER_IS_GNUCXX)
|
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_exception_flags "-fexceptions")
|
||||||
set(cxx_no_exception_flags "-fno-exceptions")
|
set(cxx_no_exception_flags "-fno-exceptions")
|
||||||
# Until version 4.3.2, GCC doesn't define a macro to indicate
|
# 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 "")
|
set(cxx_no_rtti_flags "")
|
||||||
endif()
|
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")
|
set(GTEST_HAS_PTHREAD_MACRO "-DGTEST_HAS_PTHREAD=1")
|
||||||
else()
|
else()
|
||||||
set(GTEST_HAS_PTHREAD_MACRO "-DGTEST_HAS_PTHREAD=0")
|
set(GTEST_HAS_PTHREAD_MACRO "-DGTEST_HAS_PTHREAD=0")
|
||||||
@ -159,7 +164,7 @@ function(cxx_library_with_type name type cxx_flags)
|
|||||||
PROPERTIES
|
PROPERTIES
|
||||||
COMPILE_DEFINITIONS "GTEST_CREATE_SHARED_LIBRARY=1")
|
COMPILE_DEFINITIONS "GTEST_CREATE_SHARED_LIBRARY=1")
|
||||||
endif()
|
endif()
|
||||||
if (CMAKE_USE_PTHREADS_INIT)
|
if (DEFINED GTEST_HAS_PTHREAD)
|
||||||
target_link_libraries(${name} ${CMAKE_THREAD_LIBS_INIT})
|
target_link_libraries(${name} ${CMAKE_THREAD_LIBS_INIT})
|
||||||
endif()
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
@ -857,8 +857,8 @@ TEST_P(CustomLambdaNamingTest, CustomTestNames) {}
|
|||||||
INSTANTIATE_TEST_CASE_P(CustomParamNameLambda,
|
INSTANTIATE_TEST_CASE_P(CustomParamNameLambda,
|
||||||
CustomLambdaNamingTest,
|
CustomLambdaNamingTest,
|
||||||
Values(std::string("LambdaName")),
|
Values(std::string("LambdaName")),
|
||||||
[](const ::testing::TestParamInfo<std::string>& info) {
|
[](const ::testing::TestParamInfo<std::string>& tpinfo) {
|
||||||
return info.param;
|
return tpinfo.param;
|
||||||
});
|
});
|
||||||
|
|
||||||
#endif // GTEST_LANG_CXX11
|
#endif // GTEST_LANG_CXX11
|
||||||
|
@ -2096,7 +2096,7 @@ class UnitTestRecordPropertyTestEnvironment : public Environment {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// This will test property recording outside of any test or test case.
|
// 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);
|
AddGlobalTestEnvironment(new UnitTestRecordPropertyTestEnvironment);
|
||||||
|
|
||||||
// This group of tests is for predicate assertions (ASSERT_PRED*, etc)
|
// This group of tests is for predicate assertions (ASSERT_PRED*, etc)
|
||||||
|
20
travis.sh
20
travis.sh
@ -1,5 +1,25 @@
|
|||||||
#!/usr/bin/env sh
|
#!/usr/bin/env sh
|
||||||
set -evx
|
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
|
env | sort
|
||||||
|
|
||||||
mkdir build || true
|
mkdir build || true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user