From 3429113886a93087047143f1b5a92efc78e1397f Mon Sep 17 00:00:00 2001 From: Dan Albert <danalbert@google.com> Date: Wed, 2 Mar 2016 15:43:47 -0800 Subject: [PATCH 01/18] Fix a test to compile when tuple isn't available. --- googletest/test/gtest-printers_test.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/googletest/test/gtest-printers_test.cc b/googletest/test/gtest-printers_test.cc index 3e97cc24..af69f282 100644 --- a/googletest/test/gtest-printers_test.cc +++ b/googletest/test/gtest-printers_test.cc @@ -211,7 +211,9 @@ using ::testing::internal::Strings; using ::testing::internal::UniversalPrint; using ::testing::internal::UniversalPrinter; using ::testing::internal::UniversalTersePrint; +#if GTEST_HAS_TR1_TUPLE || GTEST_HAS_STD_TUPLE_ using ::testing::internal::UniversalTersePrintTupleFieldsToStrings; +#endif using ::testing::internal::string; // The hash_* classes are not part of the C++ standard. STLport From d8fe70f477d8a99745b69f7650f75eacf96866f9 Mon Sep 17 00:00:00 2001 From: Arkadiy Shapkin <arkady.shapkin@gmail.com> Date: Mon, 5 Sep 2016 00:57:49 +0300 Subject: [PATCH 02/18] Fix build with MinGW-w64 --- googletest/include/gtest/internal/gtest-port.h | 2 +- googletest/test/gtest-port_test.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/googletest/include/gtest/internal/gtest-port.h b/googletest/include/gtest/internal/gtest-port.h index 92f4c11c..860aaaf5 100644 --- a/googletest/include/gtest/internal/gtest-port.h +++ b/googletest/include/gtest/internal/gtest-port.h @@ -396,7 +396,7 @@ # include <io.h> # endif // In order to avoid having to include <windows.h>, use forward declaration -#if GTEST_OS_WINDOWS_MINGW +#if GTEST_OS_WINDOWS_MINGW && !defined(__MINGW64_VERSION_MAJOR) // MinGW defined _CRITICAL_SECTION and _RTL_CRITICAL_SECTION as two // separate (equivalent) structs, instead of using typedef typedef struct _CRITICAL_SECTION GTEST_CRITICAL_SECTION; diff --git a/googletest/test/gtest-port_test.cc b/googletest/test/gtest-port_test.cc index 05f8821e..c5067a40 100644 --- a/googletest/test/gtest-port_test.cc +++ b/googletest/test/gtest-port_test.cc @@ -1295,7 +1295,7 @@ TEST(WindowsTypesTest, HANDLEIsVoidStar) { StaticAssertTypeEq<HANDLE, void*>(); } -#if GTEST_OS_WINDOWS_MINGW +#if GTEST_OS_WINDOWS_MINGW && !defined(__MINGW64_VERSION_MAJOR) TEST(WindowsTypesTest, _CRITICAL_SECTIONIs_CRITICAL_SECTION) { StaticAssertTypeEq<CRITICAL_SECTION, _CRITICAL_SECTION>(); } From 10ff7f9468634ecc5a6ff8b8e5888d5d5068daeb Mon Sep 17 00:00:00 2001 From: Samuel Roth <s-roth@onu.edu> Date: Mon, 12 Sep 2016 12:14:00 -0400 Subject: [PATCH 03/18] Fixing relative links --- googlemock/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/googlemock/README.md b/googlemock/README.md index 332beab3..629b8678 100644 --- a/googlemock/README.md +++ b/googlemock/README.md @@ -53,7 +53,7 @@ the Apache License, which is different from Google Mock's license. If you are new to the project, we suggest that you read the user documentation in the following order: - * Learn the [basics](../googletest/docs/Primer.md) of + * Learn the [basics](../../../googletest/docs/Primer.md) of Google Test, if you choose to use Google Mock with it (recommended). * Read [Google Mock for Dummies](docs/ForDummies.md). * Read the instructions below on how to build Google Mock. From 16d6af7d414a5d7a7e6c3d1cfbdaf4b45bdad193 Mon Sep 17 00:00:00 2001 From: Samuel Roth <s-roth@onu.edu> Date: Mon, 12 Sep 2016 12:14:53 -0400 Subject: [PATCH 04/18] Relative links --- googlemock/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/googlemock/README.md b/googlemock/README.md index 629b8678..ae7e4846 100644 --- a/googlemock/README.md +++ b/googlemock/README.md @@ -53,7 +53,7 @@ the Apache License, which is different from Google Mock's license. If you are new to the project, we suggest that you read the user documentation in the following order: - * Learn the [basics](../../../googletest/docs/Primer.md) of + * Learn the [basics](../../googletest/docs/Primer.md) of Google Test, if you choose to use Google Mock with it (recommended). * Read [Google Mock for Dummies](docs/ForDummies.md). * Read the instructions below on how to build Google Mock. From 51b290d41e5d5407f7155e903d1ff559129f7d40 Mon Sep 17 00:00:00 2001 From: Samuel Roth <s-roth@onu.edu> Date: Mon, 12 Sep 2016 12:15:49 -0400 Subject: [PATCH 05/18] One works --- googlemock/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/googlemock/README.md b/googlemock/README.md index ae7e4846..261af22d 100644 --- a/googlemock/README.md +++ b/googlemock/README.md @@ -53,7 +53,7 @@ the Apache License, which is different from Google Mock's license. If you are new to the project, we suggest that you read the user documentation in the following order: - * Learn the [basics](../../googletest/docs/Primer.md) of + * Learn the [basics](../../tree/master/googletest/docs/Primer.md) of Google Test, if you choose to use Google Mock with it (recommended). * Read [Google Mock for Dummies](docs/ForDummies.md). * Read the instructions below on how to build Google Mock. From 9cb03aa702235e3665d3555214eeb45082ac678e Mon Sep 17 00:00:00 2001 From: Samuel Roth <s-roth@onu.edu> Date: Mon, 12 Sep 2016 12:19:26 -0400 Subject: [PATCH 06/18] Fixing ForDummies link --- googlemock/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/googlemock/README.md b/googlemock/README.md index 261af22d..8318f871 100644 --- a/googlemock/README.md +++ b/googlemock/README.md @@ -55,7 +55,7 @@ documentation in the following order: * Learn the [basics](../../tree/master/googletest/docs/Primer.md) of Google Test, if you choose to use Google Mock with it (recommended). - * Read [Google Mock for Dummies](docs/ForDummies.md). + * Read [Google Mock for Dummies](../../tree/master/googlemock/docs/ForDummies.md). * Read the instructions below on how to build Google Mock. You can also watch Zhanyong's [talk](http://www.youtube.com/watch?v=sYpCyLI47rM) on Google Mock's usage and implementation. From f5c0130e88a373ed4a53c96c2676ebe53a3b883c Mon Sep 17 00:00:00 2001 From: Samuel Roth <s-roth@onu.edu> Date: Mon, 12 Sep 2016 12:24:08 -0400 Subject: [PATCH 07/18] Broken relative links fixed --- googlemock/README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/googlemock/README.md b/googlemock/README.md index 8318f871..a02fd225 100644 --- a/googlemock/README.md +++ b/googlemock/README.md @@ -62,14 +62,14 @@ You can also watch Zhanyong's [talk](http://www.youtube.com/watch?v=sYpCyLI47rM) Once you understand the basics, check out the rest of the docs: - * [CheatSheet](docs/CheatSheet.md) - all the commonly used stuff + * [CheatSheet](../../tree/master/googlemock/docs/CheatSheet.md) - all the commonly used stuff at a glance. - * [CookBook](docs/CookBook.md) - recipes for getting things done, + * [CookBook](../../tree/master/googlemock/docs/CookBook.md) - recipes for getting things done, including advanced techniques. If you need help, please check the -[KnownIssues](docs/KnownIssues.md) and -[FrequentlyAskedQuestions](docs/FrequentlyAskedQuestions.md) before +[KnownIssues](../../tree/master/googlemock/docs/KnownIssues.md) and +[FrequentlyAskedQuestions](../../tree/master/googlemock/docs/FrequentlyAskedQuestions.md) before posting a question on the [discussion group](http://groups.google.com/group/googlemock). @@ -79,7 +79,7 @@ posting a question on the Google Mock is not a testing framework itself. Instead, it needs a testing framework for writing tests. Google Mock works seamlessly with [Google Test](http://code.google.com/p/googletest/), but -you can also use it with [any C++ testing framework](googlemock/ForDummies.md#Using_Google_Mock_with_Any_Testing_Framework). +you can also use it with [any C++ testing framework](../../tree/master/googlemock/docs/ForDummies.md#Using_Google_Mock_with_Any_Testing_Framework). ### Requirements for End Users ### @@ -90,7 +90,7 @@ You must use the bundled version of Google Test when using Google Mock. You can also easily configure Google Mock to work with another testing framework, although it will still need Google Test. Please read ["Using_Google_Mock_with_Any_Testing_Framework"]( - docs/ForDummies.md#Using_Google_Mock_with_Any_Testing_Framework) + ../../tree/master/googlemock/docs/ForDummies.md#Using_Google_Mock_with_Any_Testing_Framework) for instructions. Google Mock depends on advanced C++ features and thus requires a more From 995db996dee6d6a8b537fd0174a940545442b137 Mon Sep 17 00:00:00 2001 From: Samuel Roth <s-roth@onu.edu> Date: Mon, 12 Sep 2016 12:27:36 -0400 Subject: [PATCH 08/18] Fixing KnownIssues and FrequentlyAskedQuestions links --- googlemock/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/googlemock/README.md b/googlemock/README.md index a02fd225..2d6184da 100644 --- a/googlemock/README.md +++ b/googlemock/README.md @@ -68,8 +68,8 @@ Once you understand the basics, check out the rest of the docs: including advanced techniques. If you need help, please check the -[KnownIssues](../../tree/master/googlemock/docs/KnownIssues.md) and -[FrequentlyAskedQuestions](../../tree/master/googlemock/docs/FrequentlyAskedQuestions.md) before +[KnownIssues](docs/KnownIssues.md) and +[FrequentlyAskedQuestions](docs/FrequentlyAskedQuestions.md) before posting a question on the [discussion group](http://groups.google.com/group/googlemock). From 960a511f45beb0d8d2e40c439684e11f15c96d63 Mon Sep 17 00:00:00 2001 From: Samuel Roth <s-roth@onu.edu> Date: Mon, 12 Sep 2016 12:31:50 -0400 Subject: [PATCH 09/18] Fixing relative links --- googlemock/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/googlemock/README.md b/googlemock/README.md index 2d6184da..c6ef70ab 100644 --- a/googlemock/README.md +++ b/googlemock/README.md @@ -79,7 +79,7 @@ posting a question on the Google Mock is not a testing framework itself. Instead, it needs a testing framework for writing tests. Google Mock works seamlessly with [Google Test](http://code.google.com/p/googletest/), but -you can also use it with [any C++ testing framework](../../tree/master/googlemock/docs/ForDummies.md#Using_Google_Mock_with_Any_Testing_Framework). +you can also use it with [any C++ testing framework](../../tree/master/googlemock/docs/ForDummies.md#using-google-mock-with-any-testing-framework). ### Requirements for End Users ### @@ -90,7 +90,7 @@ You must use the bundled version of Google Test when using Google Mock. You can also easily configure Google Mock to work with another testing framework, although it will still need Google Test. Please read ["Using_Google_Mock_with_Any_Testing_Framework"]( - ../../tree/master/googlemock/docs/ForDummies.md#Using_Google_Mock_with_Any_Testing_Framework) + ../../tree/master/googlemock/docs/ForDummies.md#using-google-mock-with-any-testing-framework) for instructions. Google Mock depends on advanced C++ features and thus requires a more From 0e0ff5c3410f88e09701fef04dcfcaad9cd3494f Mon Sep 17 00:00:00 2001 From: Samuel Roth <s-roth@onu.edu> Date: Mon, 12 Sep 2016 12:33:44 -0400 Subject: [PATCH 10/18] blob vs tree --- googlemock/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/googlemock/README.md b/googlemock/README.md index c6ef70ab..ba8842dc 100644 --- a/googlemock/README.md +++ b/googlemock/README.md @@ -79,7 +79,7 @@ posting a question on the Google Mock is not a testing framework itself. Instead, it needs a testing framework for writing tests. Google Mock works seamlessly with [Google Test](http://code.google.com/p/googletest/), but -you can also use it with [any C++ testing framework](../../tree/master/googlemock/docs/ForDummies.md#using-google-mock-with-any-testing-framework). +you can also use it with [any C++ testing framework](../../master/googlemock/docs/ForDummies.md#using-google-mock-with-any-testing-framework). ### Requirements for End Users ### From 32b4a9b39079ca4bf4ff539246302652d86e777f Mon Sep 17 00:00:00 2001 From: Samuel Roth <s-roth@onu.edu> Date: Mon, 12 Sep 2016 12:34:50 -0400 Subject: [PATCH 11/18] Fixed broken links --- googlemock/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/googlemock/README.md b/googlemock/README.md index ba8842dc..191df69f 100644 --- a/googlemock/README.md +++ b/googlemock/README.md @@ -90,7 +90,7 @@ You must use the bundled version of Google Test when using Google Mock. You can also easily configure Google Mock to work with another testing framework, although it will still need Google Test. Please read ["Using_Google_Mock_with_Any_Testing_Framework"]( - ../../tree/master/googlemock/docs/ForDummies.md#using-google-mock-with-any-testing-framework) + ../../master/googlemock/docs/ForDummies.md#using-google-mock-with-any-testing-framework) for instructions. Google Mock depends on advanced C++ features and thus requires a more From 8ce0b5907cd9cd933698b456e7dadb674557e820 Mon Sep 17 00:00:00 2001 From: Marco Molteni <marco.molteni@laposte.net> Date: Tue, 13 Sep 2016 20:53:41 +0200 Subject: [PATCH 12/18] Cookbok: fix broken relative link --- googlemock/docs/CookBook.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/googlemock/docs/CookBook.md b/googlemock/docs/CookBook.md index c52f1009..0460d357 100644 --- a/googlemock/docs/CookBook.md +++ b/googlemock/docs/CookBook.md @@ -218,7 +218,7 @@ per-function syntactic overhead will be much lower. If you are concerned about the performance overhead incurred by virtual functions, and profiling confirms your concern, you can -combine this with the recipe for [mocking non-virtual methods](#Mocking_Nonvirtual_Methods.md). +combine this with the recipe for [mocking non-virtual methods](#mocking-nonvirtual-methods). ## The Nice, the Strict, and the Naggy ## From 4eafafbde585418303229607227055106a86f507 Mon Sep 17 00:00:00 2001 From: Dan Albert <danalbert@google.com> Date: Tue, 1 Nov 2016 06:32:25 -0700 Subject: [PATCH 13/18] Fix detection of GTEST_HAS_CLONE for Android. This was not in Gingerbread for anything but ARM (even though the libs were hacked to lie about it being available in gingerbread). --- googletest/include/gtest/internal/gtest-port.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/googletest/include/gtest/internal/gtest-port.h b/googletest/include/gtest/internal/gtest-port.h index 7d6e4658..a8078750 100644 --- a/googletest/include/gtest/internal/gtest-port.h +++ b/googletest/include/gtest/internal/gtest-port.h @@ -754,8 +754,12 @@ using ::std::tuple_size; # if GTEST_OS_LINUX && !defined(__ia64__) # if GTEST_OS_LINUX_ANDROID -// On Android, clone() is only available on ARM starting with Gingerbread. -# if defined(__arm__) && __ANDROID_API__ >= 9 +// On Android, clone() became available at different API levels for each 32-bit +// architecture. +# if defined(__LP64__) || \ + (defined(__arm__) && __ANDROID_API__ >= 9) || \ + (defined(__mips__) && __ANDROID_API__ >= 12) || \ + (defined(__i386__) && __ANDROID_API__ >= 17) # define GTEST_HAS_CLONE 1 # else # define GTEST_HAS_CLONE 0 From cb502b7ad15c9dc9d1f74087a9fc7b6d12177b9b Mon Sep 17 00:00:00 2001 From: Craig Scott <audiofanatic@gmail.com> Date: Tue, 8 Dec 2015 00:14:24 +1100 Subject: [PATCH 14/18] Added CMake configure-time download instructions to docs Adds instructions for how to add gtest and gmock to another CMake project directly. Downloading of the googletest sources happens as configure time, allowing it to be added to the main build directly via the add_subdirectory() command. This ensures googletest is built with the same compiler settings, etc. and will typically result in a more robust and more convenient build arrangement. --- googlemock/README.md | 10 ++++ googletest/README.md | 107 ++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 115 insertions(+), 2 deletions(-) diff --git a/googlemock/README.md b/googlemock/README.md index 332beab3..ed500c8a 100644 --- a/googlemock/README.md +++ b/googlemock/README.md @@ -125,6 +125,14 @@ build Google Mock and its tests, which has further requirements: ### Building Google Mock ### +If you have CMake available, it is recommended that you follow the +[build instructions][gtest_cmakebuild] +as described for Google Test. If are using Google Mock with an +existing CMake project, the section +[Incorporating Into An Existing CMake Project][gtest_incorpcmake] +may be of particular interest. Otherwise, the following sections +detail how to build Google Mock without CMake. + #### Preparing to Build (Unix only) #### If you are using a Unix system and plan to use the GNU Autotools build @@ -331,3 +339,5 @@ patch. Happy testing! [gtest_readme]: ../googletest/README.md "googletest" +[gtest_cmakebuild]: ../googletest/README.md#using-cmake "Using CMake" +[gtest_incorpcmake]: ../googletest/README.md#incorporating-into-an-existing-cmake-project "Incorporating Into An Existing CMake Project" diff --git a/googletest/README.md b/googletest/README.md index edd44080..0a3474c0 100644 --- a/googletest/README.md +++ b/googletest/README.md @@ -59,7 +59,13 @@ cross-platform.). If you don't have CMake installed already, you can download it for free from <http://www.cmake.org/>. CMake works by generating native makefiles or build projects that can -be used in the compiler environment of your choice. The typical +be used in the compiler environment of your choice. You can either +build Google Test as a standalone project or it can be incorporated +into an existing CMake build for another project. + +#### Standalone CMake Project #### + +When building Google Test as a standalone project, the typical workflow starts with: mkdir mybuild # Create a directory to hold the build output. @@ -80,13 +86,110 @@ using Visual Studio. On Mac OS X with Xcode installed, a `.xcodeproj` file will be generated. +#### Incorporating Into An Existing CMake Project #### + +If you want to use gtest in a project which already uses CMake, then a +more robust and flexible approach is to build gtest as part of that +project directly. This is done by making the GoogleTest source code +available to the main build and adding it using CMake's +`add_subdirectory()` command. This has the significant advantage that +the same compiler and linker settings are used between gtest and the +rest of your project, so issues associated with using incompatible +libraries (eg debug/release), etc. are avoided. This is particularly +useful on Windows. Making GoogleTest's source code available to the +main build can be done a few different ways: + +* Download the GoogleTest source code manually and place it at a + known location. This is the least flexible approach and can make + it more difficult to use with continuous integration systems, etc. +* Embed the GoogleTest source code as a direct copy in the main + project's source tree. This is often the simplest approach, but is + also the hardest to keep up to date. Some organizations may not + permit this method. +* Add GoogleTest as a git submodule or equivalent. This may not + always be possible or appropriate. Git submodules, for example, + have their own set of advantages and drawbacks. +* Use CMake to download GoogleTest as part of the build's configure + step. This is just a little more complex, but doesn't have the + limitations of the other methods. + +The last of the above methods is implemented with a small piece +of CMake code in a separate file (e.g. `CMakeLists.txt.in`) which +is copied to the build area and then invoked as a sub-build +_during the CMake stage_. That directory is then pulled into the +main build with `add_subdirectory()`. For example: + +New file `CMakeLists.txt.in`: + + cmake_minimum_required(VERSION 2.8.2) + + project(googletest-download NONE) + + include(ExternalProject) + ExternalProject_Add(googletest + GIT_REPOSITORY https://github.com/google/googletest.git + GIT_TAG master + SOURCE_DIR "${CMAKE_BINARY_DIR}/googletest-src" + BINARY_DIR "${CMAKE_BINARY_DIR}/googletest-build" + CONFIGURE_COMMAND "" + BUILD_COMMAND "" + INSTALL_COMMAND "" + TEST_COMMAND "" + ) + +Existing build's `CMakeLists.txt`: + + # Download and unpack googletest at configure time + configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt) + execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" . + RESULT_VARIABLE result + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/googletest-download ) + if(result) + message(FATAL_ERROR "CMake step for googletest failed: ${result}") + endif() + execute_process(COMMAND ${CMAKE_COMMAND} --build . + RESULT_VARIABLE result + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/googletest-download ) + if(result) + message(FATAL_ERROR "Build step for googletest failed: ${result}") + endif() + + # Prevent overriding the parent project's compiler/linker + # settings on Windows + set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) + + # Add googletest directly to our build. This defines + # the gtest and gtest_main targets. + add_subdirectory(${CMAKE_BINARY_DIR}/googletest-src + ${CMAKE_BINARY_DIR}/googletest-build) + + # The gtest/gtest_main targets carry header search path + # dependencies automatically when using CMake 2.8.11 or + # later. Otherwise we have to add them here ourselves. + if (CMAKE_VERSION VERSION_LESS 2.8.11) + include_directories("${gtest_SOURCE_DIR}/include") + endif() + + # Now simply link against gtest or gtest_main as needed. Eg + add_executable(example example.cpp) + target_link_libraries(example gtest_main) + add_test(NAME example_test COMMAND example) + +Note that this approach requires CMake 2.8.2 or later due to +its use of the `ExternalProject_Add()` command. The above +technique is discussed in more detail in +[this separate article](http://crascit.com/2015/07/25/cmake-gtest/) +which also contains a link to a fully generalized implementation +of the technique. + + ### Legacy Build Scripts ### Before settling on CMake, we have been providing hand-maintained build projects/scripts for Visual Studio, Xcode, and Autotools. While we continue to provide them for convenience, they are not actively maintained any more. We highly recommend that you follow the -instructions in the previous two sections to integrate Google Test +instructions in the above sections to integrate Google Test with your existing build system. If you still need to use the legacy build scripts, here's how: From c0059a79f82d0ecc3e9bfdc12146a5b84befc70a Mon Sep 17 00:00:00 2001 From: Craig Scott <audiofanatic@gmail.com> Date: Fri, 1 Jan 2016 11:01:15 +1100 Subject: [PATCH 15/18] 2.6.4 is the minimum CMake version, so enforce it (#656) --- CMakeLists.txt | 2 +- googlemock/CMakeLists.txt | 2 +- googletest/CMakeLists.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8d2b552e..5754992e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.6.2) +cmake_minimum_required(VERSION 2.6.4) project( googletest-distribution ) diff --git a/googlemock/CMakeLists.txt b/googlemock/CMakeLists.txt index beb259a2..9fb96a4b 100644 --- a/googlemock/CMakeLists.txt +++ b/googlemock/CMakeLists.txt @@ -38,7 +38,7 @@ endif() # ${gmock_BINARY_DIR}. # Language "C" is required for find_package(Threads). project(gmock CXX C) -cmake_minimum_required(VERSION 2.6.2) +cmake_minimum_required(VERSION 2.6.4) if (COMMAND set_up_hermetic_build) set_up_hermetic_build() diff --git a/googletest/CMakeLists.txt b/googletest/CMakeLists.txt index 621d0f04..36d0a9ec 100644 --- a/googletest/CMakeLists.txt +++ b/googletest/CMakeLists.txt @@ -45,7 +45,7 @@ endif() # ${gtest_BINARY_DIR}. # Language "C" is required for find_package(Threads). project(gtest CXX C) -cmake_minimum_required(VERSION 2.6.2) +cmake_minimum_required(VERSION 2.6.4) if (COMMAND set_up_hermetic_build) set_up_hermetic_build() From 06a81e9357b6e5cf023ac65b7468191cd1949d42 Mon Sep 17 00:00:00 2001 From: Mike Bjorge <mbjorge@google.com> Date: Mon, 9 Jan 2017 16:02:55 -0800 Subject: [PATCH 16/18] Add GTEST_ATTRIBUTE_UNUSED_ to REGISTER_TYPED_TEST_CASE_P If REGISTER_TYPED_TEST_CASE_P is included in a header file, but the .cc file does not declare INSTANTIATE_TYPED_TEST_CASE_P, an unused-variable warning may be raised by the compiler. --- googletest/include/gtest/gtest-typed-test.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/googletest/include/gtest/gtest-typed-test.h b/googletest/include/gtest/gtest-typed-test.h index 5f69d567..f4be9e55 100644 --- a/googletest/include/gtest/gtest-typed-test.h +++ b/googletest/include/gtest/gtest-typed-test.h @@ -241,9 +241,10 @@ INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, MyTypes); namespace GTEST_CASE_NAMESPACE_(CaseName) { \ typedef ::testing::internal::Templates<__VA_ARGS__>::type gtest_AllTests_; \ } \ - static const char* const GTEST_REGISTERED_TEST_NAMES_(CaseName) = \ - GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).VerifyRegisteredTestNames(\ - __FILE__, __LINE__, #__VA_ARGS__) + static const char* const GTEST_REGISTERED_TEST_NAMES_(CaseName) \ + GTEST_ATTRIBUTE_UNUSED = \ + GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).VerifyRegisteredTestNames(\ + __FILE__, __LINE__, #__VA_ARGS__) // The 'Types' template argument below must have spaces around it // since some compilers may choke on '>>' when passing a template From 9655b9f53da31aa3707001b8e103d9abbadd4bcc Mon Sep 17 00:00:00 2001 From: srz_zumix <zumix.cpp@gmail.com> Date: Fri, 3 Feb 2017 08:05:22 +0900 Subject: [PATCH 17/18] fix typo /GTEST_ATTRIBUTE_UNUSED/GTEST_ATTRIBUTE_UNUSED_/ --- googletest/include/gtest/gtest-typed-test.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/googletest/include/gtest/gtest-typed-test.h b/googletest/include/gtest/gtest-typed-test.h index f4be9e55..20726b2c 100644 --- a/googletest/include/gtest/gtest-typed-test.h +++ b/googletest/include/gtest/gtest-typed-test.h @@ -242,7 +242,7 @@ INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, MyTypes); typedef ::testing::internal::Templates<__VA_ARGS__>::type gtest_AllTests_; \ } \ static const char* const GTEST_REGISTERED_TEST_NAMES_(CaseName) \ - GTEST_ATTRIBUTE_UNUSED = \ + GTEST_ATTRIBUTE_UNUSED_ = \ GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).VerifyRegisteredTestNames(\ __FILE__, __LINE__, #__VA_ARGS__) From ba638689e40fc60c2e5194fc777bf30541deeff8 Mon Sep 17 00:00:00 2001 From: Billy Donahue <BillyDonahue@users.noreply.github.com> Date: Sat, 25 Feb 2017 20:46:21 -0500 Subject: [PATCH 18/18] Remove /tree/ from Readme.md links. Issue #1028 --- googlemock/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/googlemock/README.md b/googlemock/README.md index 3eb10cbb..7b13a6d3 100644 --- a/googlemock/README.md +++ b/googlemock/README.md @@ -53,18 +53,18 @@ the Apache License, which is different from Google Mock's license. If you are new to the project, we suggest that you read the user documentation in the following order: - * Learn the [basics](../../tree/master/googletest/docs/Primer.md) of + * Learn the [basics](../../master/googletest/docs/Primer.md) of Google Test, if you choose to use Google Mock with it (recommended). - * Read [Google Mock for Dummies](../../tree/master/googlemock/docs/ForDummies.md). + * Read [Google Mock for Dummies](../../master/googlemock/docs/ForDummies.md). * Read the instructions below on how to build Google Mock. You can also watch Zhanyong's [talk](http://www.youtube.com/watch?v=sYpCyLI47rM) on Google Mock's usage and implementation. Once you understand the basics, check out the rest of the docs: - * [CheatSheet](../../tree/master/googlemock/docs/CheatSheet.md) - all the commonly used stuff + * [CheatSheet](../../master/googlemock/docs/CheatSheet.md) - all the commonly used stuff at a glance. - * [CookBook](../../tree/master/googlemock/docs/CookBook.md) - recipes for getting things done, + * [CookBook](../../master/googlemock/docs/CookBook.md) - recipes for getting things done, including advanced techniques. If you need help, please check the