From 8f2f096162b67910a5c495d2159d2ca63e551e91 Mon Sep 17 00:00:00 2001 From: mehagar Date: Tue, 29 Dec 2015 07:29:56 -0600 Subject: [PATCH 01/25] Fix typo in AdvancedGuide.md --- googletest/docs/AdvancedGuide.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/googletest/docs/AdvancedGuide.md b/googletest/docs/AdvancedGuide.md index 5ad10e10..6518d4ae 100644 --- a/googletest/docs/AdvancedGuide.md +++ b/googletest/docs/AdvancedGuide.md @@ -32,7 +32,7 @@ output in the future. `FAIL()` generates a fatal failure, while `ADD_FAILURE()` and `ADD_FAILURE_AT()` generate a nonfatal failure. These are useful when control flow, rather than a Boolean expression, -deteremines the test's success or failure. For example, you might want to write +determines the test's success or failure. For example, you might want to write something like: ``` From 51fd8bbbe18a325a1c39670fdbc7aac701ef85aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20M=C3=BCnch?= Date: Sat, 2 Jan 2016 15:50:09 +0100 Subject: [PATCH 02/25] Fix: Markdown in V1_7_Primer.md table "Basic Assertions" is now rendered correctly as table --- googletest/docs/V1_7_Primer.md | 1 + 1 file changed, 1 insertion(+) diff --git a/googletest/docs/V1_7_Primer.md b/googletest/docs/V1_7_Primer.md index b1827c73..b0ee5976 100644 --- a/googletest/docs/V1_7_Primer.md +++ b/googletest/docs/V1_7_Primer.md @@ -108,6 +108,7 @@ streamed to an assertion, it will be translated to UTF-8 when printed. ## Basic Assertions ## These assertions do basic true/false condition testing. + | **Fatal assertion** | **Nonfatal assertion** | **Verifies** | |:--------------------|:-----------------------|:-------------| | `ASSERT_TRUE(`_condition_`)`; | `EXPECT_TRUE(`_condition_`)`; | _condition_ is true | From e5302cfca48cbb2db003e7aa3ab4f5ce0b3ecfc0 Mon Sep 17 00:00:00 2001 From: Li Peng Date: Wed, 27 Apr 2016 16:41:27 +0800 Subject: [PATCH 03/25] remove duplicated words Signed-off-by: Li Peng --- googlemock/CHANGES | 2 +- googlemock/src/gmock-matchers.cc | 2 +- googlemock/test/gmock-generated-actions_test.cc | 2 +- googletest/docs/AdvancedGuide.md | 2 +- googletest/docs/V1_5_AdvancedGuide.md | 2 +- googletest/docs/V1_6_AdvancedGuide.md | 2 +- googletest/docs/V1_7_AdvancedGuide.md | 2 +- googletest/src/gtest-death-test.cc | 2 +- googletest/src/gtest-port.cc | 2 +- googletest/src/gtest.cc | 2 +- googletest/test/gtest_unittest.cc | 2 +- googletest/xcode/Scripts/versiongenerate.py | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/googlemock/CHANGES b/googlemock/CHANGES index d6f2f760..4328ece3 100644 --- a/googlemock/CHANGES +++ b/googlemock/CHANGES @@ -94,7 +94,7 @@ Google Test): * New feature: --gmock_catch_leaked_mocks for detecting leaked mocks. * New feature: ACTION_TEMPLATE for defining templatized actions. * New feature: the .After() clause for specifying expectation order. - * New feature: the .With() clause for for specifying inter-argument + * New feature: the .With() clause for specifying inter-argument constraints. * New feature: actions ReturnArg(), ReturnNew(...), and DeleteArg(). diff --git a/googlemock/src/gmock-matchers.cc b/googlemock/src/gmock-matchers.cc index e7424510..d6599792 100644 --- a/googlemock/src/gmock-matchers.cc +++ b/googlemock/src/gmock-matchers.cc @@ -288,7 +288,7 @@ class MaxBipartiteMatchState { // Each element of the left_ vector represents a left hand side node // (i.e. an element) and each element of right_ is a right hand side // node (i.e. a matcher). The values in the left_ vector indicate - // outflow from that node to a node on the the right_ side. The values + // outflow from that node to a node on the right_ side. The values // in the right_ indicate inflow, and specify which left_ node is // feeding that right_ node, if any. For example, left_[3] == 1 means // there's a flow from element #3 to matcher #1. Such a flow would also diff --git a/googlemock/test/gmock-generated-actions_test.cc b/googlemock/test/gmock-generated-actions_test.cc index 5ca5bc78..f01390ca 100644 --- a/googlemock/test/gmock-generated-actions_test.cc +++ b/googlemock/test/gmock-generated-actions_test.cc @@ -1120,7 +1120,7 @@ TEST(ActionTemplateTest, WorksForIntegralTemplateParams) { EXPECT_FALSE(b); // Verifies that resetter is deleted. } -// Tests that ACTION_TEMPLATES works for template template parameters. +// Tests that ACTION_TEMPLATES works for template parameters. ACTION_TEMPLATE(ReturnSmartPointer, HAS_1_TEMPLATE_PARAMS(template class, Pointer), diff --git a/googletest/docs/AdvancedGuide.md b/googletest/docs/AdvancedGuide.md index 93a65200..b9201558 100644 --- a/googletest/docs/AdvancedGuide.md +++ b/googletest/docs/AdvancedGuide.md @@ -675,7 +675,7 @@ syntax only. ## How It Works ## Under the hood, `ASSERT_EXIT()` spawns a new process and executes the -death test statement in that process. The details of of how precisely +death test statement in that process. The details of how precisely that happens depend on the platform and the variable `::testing::GTEST_FLAG(death_test_style)` (which is initialized from the command-line flag `--gtest_death_test_style`). diff --git a/googletest/docs/V1_5_AdvancedGuide.md b/googletest/docs/V1_5_AdvancedGuide.md index 34e19c26..03432aad 100644 --- a/googletest/docs/V1_5_AdvancedGuide.md +++ b/googletest/docs/V1_5_AdvancedGuide.md @@ -599,7 +599,7 @@ syntax only. ## How It Works ## Under the hood, `ASSERT_EXIT()` spawns a new process and executes the -death test statement in that process. The details of of how precisely +death test statement in that process. The details of how precisely that happens depend on the platform and the variable `::testing::GTEST_FLAG(death_test_style)` (which is initialized from the command-line flag `--gtest_death_test_style`). diff --git a/googletest/docs/V1_6_AdvancedGuide.md b/googletest/docs/V1_6_AdvancedGuide.md index 78864b16..f420274d 100644 --- a/googletest/docs/V1_6_AdvancedGuide.md +++ b/googletest/docs/V1_6_AdvancedGuide.md @@ -672,7 +672,7 @@ syntax only. ## How It Works ## Under the hood, `ASSERT_EXIT()` spawns a new process and executes the -death test statement in that process. The details of of how precisely +death test statement in that process. The details of how precisely that happens depend on the platform and the variable `::testing::GTEST_FLAG(death_test_style)` (which is initialized from the command-line flag `--gtest_death_test_style`). diff --git a/googletest/docs/V1_7_AdvancedGuide.md b/googletest/docs/V1_7_AdvancedGuide.md index dd4af8f3..ef989269 100644 --- a/googletest/docs/V1_7_AdvancedGuide.md +++ b/googletest/docs/V1_7_AdvancedGuide.md @@ -673,7 +673,7 @@ syntax only. ## How It Works ## Under the hood, `ASSERT_EXIT()` spawns a new process and executes the -death test statement in that process. The details of of how precisely +death test statement in that process. The details of how precisely that happens depend on the platform and the variable `::testing::GTEST_FLAG(death_test_style)` (which is initialized from the command-line flag `--gtest_death_test_style`). diff --git a/googletest/src/gtest-death-test.cc b/googletest/src/gtest-death-test.cc index a01a3698..1943c2f8 100644 --- a/googletest/src/gtest-death-test.cc +++ b/googletest/src/gtest-death-test.cc @@ -1243,7 +1243,7 @@ int GetStatusFileDescriptor(unsigned int parent_process_id, reinterpret_cast(write_handle_as_size_t); HANDLE dup_write_handle; - // The newly initialized handle is accessible only in in the parent + // The newly initialized handle is accessible only in the parent // process. To obtain one accessible within the child, we need to use // DuplicateHandle. if (!::DuplicateHandle(parent_process_handle.Get(), write_handle, diff --git a/googletest/src/gtest-port.cc b/googletest/src/gtest-port.cc index e5bf3dd2..6aeef495 100644 --- a/googletest/src/gtest-port.cc +++ b/googletest/src/gtest-port.cc @@ -496,7 +496,7 @@ class ThreadLocalRegistryImpl { FALSE, thread_id); GTEST_CHECK_(thread != NULL); - // We need to to pass a valid thread ID pointer into CreateThread for it + // We need to pass a valid thread ID pointer into CreateThread for it // to work correctly under Win98. DWORD watcher_thread_id; HANDLE watcher_thread = ::CreateThread( diff --git a/googletest/src/gtest.cc b/googletest/src/gtest.cc index d882ab2e..4df3bd6b 100644 --- a/googletest/src/gtest.cc +++ b/googletest/src/gtest.cc @@ -1784,7 +1784,7 @@ std::string CodePointToUtf8(UInt32 code_point) { return str; } -// The following two functions only make sense if the the system +// The following two functions only make sense if the system // uses UTF-16 for wide string encoding. All supported systems // with 16 bit wchar_t (Windows, Cygwin, Symbian OS) do use UTF-16. diff --git a/googletest/test/gtest_unittest.cc b/googletest/test/gtest_unittest.cc index 88e94134..21beac85 100644 --- a/googletest/test/gtest_unittest.cc +++ b/googletest/test/gtest_unittest.cc @@ -1388,7 +1388,7 @@ class TestResultTest : public Test { delete r2; } - // Helper that compares two two TestPartResults. + // Helper that compares two TestPartResults. static void CompareTestPartResult(const TestPartResult& expected, const TestPartResult& actual) { EXPECT_EQ(expected.type(), actual.type()); diff --git a/googletest/xcode/Scripts/versiongenerate.py b/googletest/xcode/Scripts/versiongenerate.py index 81de8c96..dba08e9a 100755 --- a/googletest/xcode/Scripts/versiongenerate.py +++ b/googletest/xcode/Scripts/versiongenerate.py @@ -88,7 +88,7 @@ file_data = """// // is executed in a "Run Script" build phase when creating gtest.framework. This // header file is not used during compilation of C-source. Rather, it simply // defines some version strings for substitution in the Info.plist. Because of -// this, we are not not restricted to C-syntax nor are we using include guards. +// this, we are not restricted to C-syntax nor are we using include guards. // #define GTEST_VERSIONINFO_SHORT %s.%s From 75c5a0e0c02019218fbba4951b89b4fecbc151e0 Mon Sep 17 00:00:00 2001 From: Manuel Vives Date: Sat, 21 May 2016 20:18:32 -0400 Subject: [PATCH 04/25] Issue 709: Fix Cmake policy 0048 --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8d2b552e..0dd97a0f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,6 @@ cmake_minimum_required(VERSION 2.6.2) +cmake_policy(SET CMP0048 NEW) project( googletest-distribution ) enable_testing() From 9907f860680bec0ff4fe37dbd0c59b91d3fccfe0 Mon Sep 17 00:00:00 2001 From: Marzo Sette Torres Junior Date: Fri, 2 Sep 2016 14:39:48 -0300 Subject: [PATCH 05/25] Clarifying language The old language might mislead someone into thinking that the access level on the base class itself was changed. --- googlemock/docs/CookBook.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/googlemock/docs/CookBook.md b/googlemock/docs/CookBook.md index c52f1009..5f5ea44c 100644 --- a/googlemock/docs/CookBook.md +++ b/googlemock/docs/CookBook.md @@ -18,8 +18,9 @@ You must always put a mock method definition (`MOCK_METHOD*`) in a `public:` section of the mock class, regardless of the method being mocked being `public`, `protected`, or `private` in the base class. This allows `ON_CALL` and `EXPECT_CALL` to reference the mock function -from outside of the mock class. (Yes, C++ allows a subclass to change -the access level of a virtual function in the base class.) Example: +from outside of the mock class. (Yes, C++ allows a subclass to specify +a different access level than the base class on a virtual function.) +Example: ``` class Foo { From 2e8062bd72c6d16277719ece4cc6c71238d8a441 Mon Sep 17 00:00:00 2001 From: Ross Wang Date: Tue, 18 Oct 2016 13:56:03 -0700 Subject: [PATCH 06/25] Update Primer.md Correcting typo: "text fixture" => "test fixture" --- googletest/docs/Primer.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/googletest/docs/Primer.md b/googletest/docs/Primer.md index 474c1d2a..be6ad38b 100644 --- a/googletest/docs/Primer.md +++ b/googletest/docs/Primer.md @@ -382,7 +382,7 @@ When invoked, the `RUN_ALL_TESTS()` macro: 1. Restores the state of all Google Test flags. 1. Repeats the above steps for the next test, until all tests have run. -In addition, if the text fixture's constructor generates a fatal failure in +In addition, if the test fixture's constructor generates a fatal failure in step 2, there is no point for step 3 - 5 and they are thus skipped. Similarly, if step 3 generates a fatal failure, step 4 will be skipped. From 88c1c2c080445ef57ffdd1906af26d81a35c11a4 Mon Sep 17 00:00:00 2001 From: Edgar Riba Date: Sat, 5 Nov 2016 19:58:53 +0100 Subject: [PATCH 07/25] update README.md with tiny-dnn tiny-dnn in its recent version updated the testing framework to GTest. We would like to be mentioned as consumers of the project. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 076484e4..cb5cf5bd 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,7 @@ the following notable projects: * [Protocol Buffers](https://github.com/google/protobuf), Google's data interchange format. * The [OpenCV](http://opencv.org/) computer vision library. + * [tiny-dnn](https://github.com/tiny-dnn/tiny-dnn): header only, dependency-free deep learning framework in C++11 ## Related Open Source Projects ## From 75142aeeca029e22686fced632c12945aec51842 Mon Sep 17 00:00:00 2001 From: Alexey Klimkin Date: Mon, 12 Dec 2016 16:38:14 -0800 Subject: [PATCH 08/25] Fix a typo Help says "FILE_PATH defaults to test_details.xml", but the real path is test_detail.xml. --- googletest/src/gtest.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/googletest/src/gtest.cc b/googletest/src/gtest.cc index d882ab2e..a0bdc2c0 100644 --- a/googletest/src/gtest.cc +++ b/googletest/src/gtest.cc @@ -5189,7 +5189,7 @@ static const char kColorEncodedHelpMessage[] = " @G--" GTEST_FLAG_PREFIX_ "output=xml@Y[@G:@YDIRECTORY_PATH@G" GTEST_PATH_SEP_ "@Y|@G:@YFILE_PATH]@D\n" " Generate an XML report in the given directory or with the given file\n" -" name. @YFILE_PATH@D defaults to @Gtest_details.xml@D.\n" +" name. @YFILE_PATH@D defaults to @Gtest_detail.xml@D.\n" #if GTEST_CAN_STREAM_RESULTS_ " @G--" GTEST_FLAG_PREFIX_ "stream_result_to=@YHOST@G:@YPORT@D\n" " Stream test results to the given server.\n" From 51c788bd264dfe897f76f2c9fcb4841d12f2d42c Mon Sep 17 00:00:00 2001 From: nicolacavallini Date: Fri, 23 Dec 2016 11:45:08 +0100 Subject: [PATCH 09/25] added link to sample 6 in the documentation of typed test --- googletest/docs/AdvancedGuide.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/googletest/docs/AdvancedGuide.md b/googletest/docs/AdvancedGuide.md index 93a65200..87127669 100644 --- a/googletest/docs/AdvancedGuide.md +++ b/googletest/docs/AdvancedGuide.md @@ -1344,7 +1344,7 @@ TYPED_TEST(FooTest, DoesBlah) { TYPED_TEST(FooTest, HasPropertyA) { ... } ``` -You can see `samples/sample6_unittest.cc` for a complete example. +You can see [`samples/sample6_unittest.cc`](../samples/sample6_unittest.cc) for a complete example. _Availability:_ Linux, Windows (requires MSVC 8.0 or above), Mac; since version 1.1.0. @@ -1551,7 +1551,7 @@ exception, you could catch the exception and assert on it. But Google Test doesn't use exceptions, so how do we test that a piece of code generates an expected failure? -`"gtest/gtest-spi.h"` contains some constructs to do this. After +`"gtest/gtest-spi.h"` contains some constructs to do this. After `#include`ing this header, you can use | `EXPECT_FATAL_FAILURE(`_statement, substring_`);` | From c16ad8ce5d5ba34a9f22b94fa1d526f804af890e Mon Sep 17 00:00:00 2001 From: Dawid Kurek Date: Mon, 6 Feb 2017 13:31:11 +0100 Subject: [PATCH 10/25] Replace html entities with their equivalents --- googlemock/docs/CookBook.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/googlemock/docs/CookBook.md b/googlemock/docs/CookBook.md index 0460d357..89a41508 100644 --- a/googlemock/docs/CookBook.md +++ b/googlemock/docs/CookBook.md @@ -2365,7 +2365,7 @@ Now there’s one topic we haven’t covered: how do you set expectations on `Sh // When one calls ShareBuzz() on the MockBuzzer like this, the call is // forwarded to DoShareBuzz(), which is mocked. Therefore this statement // will trigger the above EXPECT_CALL. - mock_buzzer_.ShareBuzz(MakeUnique<Buzz>(AccessLevel::kInternal), + mock_buzzer_.ShareBuzz(MakeUnique(AccessLevel::kInternal), ::base::Now()); ``` @@ -2404,7 +2404,7 @@ Now, the mock `DoShareBuzz()` method is free to save the buzz argument for later ``` std::unique_ptr intercepted_buzz; EXPECT_CALL(mock_buzzer_, DoShareBuzz(NotNull(), _)) - .WillOnce(Invoke([&intercepted_buzz](Buzz* buzz, Time timestamp) { + .WillOnce(Invoke([&intercepted_buzz](Buzz* buzz, Time timestamp) { // Save buzz in intercepted_buzz for analysis later. intercepted_buzz.reset(buzz); return false; From 82ed7f87161c8bfcc4ee8f7e0004f2635e945a28 Mon Sep 17 00:00:00 2001 From: vpfautz Date: Sun, 26 Feb 2017 19:15:33 +0100 Subject: [PATCH 11/25] Fixed some typos --- googletest/Makefile.am | 2 +- googletest/samples/sample1.cc | 2 +- googletest/scripts/upload.py | 2 +- googletest/src/gtest.cc | 2 +- googletest/test/gtest-port_test.cc | 2 +- googletest/test/gtest_test_utils.py | 2 +- googletest/test/gtest_unittest.cc | 2 +- googletest/test/gtest_xml_outfiles_test.py | 2 +- googletest/test/gtest_xml_output_unittest.py | 2 +- googletest/xcode/Scripts/versiongenerate.py | 4 ++-- 10 files changed, 11 insertions(+), 11 deletions(-) diff --git a/googletest/Makefile.am b/googletest/Makefile.am index 29797e4e..dbc004de 100644 --- a/googletest/Makefile.am +++ b/googletest/Makefile.am @@ -216,7 +216,7 @@ pkginclude_internal_HEADERS = \ lib_libgtest_main_la_SOURCES = src/gtest_main.cc lib_libgtest_main_la_LIBADD = lib/libgtest.la -# Bulid rules for samples and tests. Automake's naming for some of +# Build rules for samples and tests. Automake's naming for some of # these variables isn't terribly obvious, so this is a brief # reference: # diff --git a/googletest/samples/sample1.cc b/googletest/samples/sample1.cc index f171e260..7c08b28f 100644 --- a/googletest/samples/sample1.cc +++ b/googletest/samples/sample1.cc @@ -55,7 +55,7 @@ bool IsPrime(int n) { // Try to divide n by every odd number i, starting from 3 for (int i = 3; ; i += 2) { - // We only have to try i up to the squre root of n + // We only have to try i up to the square root of n if (i > n/i) break; // Now, we have i <= n/i < n. diff --git a/googletest/scripts/upload.py b/googletest/scripts/upload.py index 6e6f9a14..81e8e04d 100755 --- a/googletest/scripts/upload.py +++ b/googletest/scripts/upload.py @@ -732,7 +732,7 @@ class SubversionVCS(VersionControlSystem): else: self.rev_start = self.rev_end = None # Cache output from "svn list -r REVNO dirname". - # Keys: dirname, Values: 2-tuple (ouput for start rev and end rev). + # Keys: dirname, Values: 2-tuple (output for start rev and end rev). self.svnls_cache = {} # SVN base URL is required to fetch files deleted in an older revision. # Result is cached to not guess it over and over again in GetBaseFile(). diff --git a/googletest/src/gtest.cc b/googletest/src/gtest.cc index d882ab2e..1602c0cd 100644 --- a/googletest/src/gtest.cc +++ b/googletest/src/gtest.cc @@ -1171,7 +1171,7 @@ class Hunk { // Print a unified diff header for one hunk. // The format is // "@@ -, +, @@" - // where the left/right parts are ommitted if unnecessary. + // where the left/right parts are omitted if unnecessary. void PrintHeader(std::ostream* ss) const { *ss << "@@ "; if (removes_) { diff --git a/googletest/test/gtest-port_test.cc b/googletest/test/gtest-port_test.cc index c5067a40..1d25ee6b 100644 --- a/googletest/test/gtest-port_test.cc +++ b/googletest/test/gtest-port_test.cc @@ -1209,7 +1209,7 @@ class DestructorTracker { : index_(GetNewIndex()) {} ~DestructorTracker() { // We never access DestructorCall::List() concurrently, so we don't need - // to protect this acccess with a mutex. + // to protect this access with a mutex. DestructorCall::List()[index_]->ReportDestroyed(); } diff --git a/googletest/test/gtest_test_utils.py b/googletest/test/gtest_test_utils.py index 4acd36c9..d2b6748d 100755 --- a/googletest/test/gtest_test_utils.py +++ b/googletest/test/gtest_test_utils.py @@ -245,7 +245,7 @@ class Subprocess: p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=stderr, cwd=working_dir, universal_newlines=True, env=env) - # communicate returns a tuple with the file obect for the child's + # communicate returns a tuple with the file object for the child's # output. self.output = p.communicate()[0] self._return_code = p.returncode diff --git a/googletest/test/gtest_unittest.cc b/googletest/test/gtest_unittest.cc index 97fcd5a8..6d20be3f 100644 --- a/googletest/test/gtest_unittest.cc +++ b/googletest/test/gtest_unittest.cc @@ -3689,7 +3689,7 @@ TEST(AssertionTest, ASSERT_EQ) { TEST(AssertionTest, ASSERT_EQ_NULL) { // A success. const char* p = NULL; - // Some older GCC versions may issue a spurious waring in this or the next + // Some older GCC versions may issue a spurious warning in this or the next // assertion statement. This warning should not be suppressed with // static_cast since the test verifies the ability to use bare NULL as the // expected parameter to the macro. diff --git a/googletest/test/gtest_xml_outfiles_test.py b/googletest/test/gtest_xml_outfiles_test.py index 524e437e..678f546c 100755 --- a/googletest/test/gtest_xml_outfiles_test.py +++ b/googletest/test/gtest_xml_outfiles_test.py @@ -105,7 +105,7 @@ class GTestXMLOutFilesTest(gtest_xml_test_utils.GTestXMLTestCase): # TODO(wan@google.com): libtool causes the built test binary to be # named lt-gtest_xml_outfiles_test_ instead of - # gtest_xml_outfiles_test_. To account for this possibillity, we + # gtest_xml_outfiles_test_. To account for this possibility, we # allow both names in the following code. We should remove this # hack when Chandler Carruth's libtool replacement tool is ready. output_file_name1 = test_name + ".xml" diff --git a/googletest/test/gtest_xml_output_unittest.py b/googletest/test/gtest_xml_output_unittest.py index bcd59759..e940a5aa 100755 --- a/googletest/test/gtest_xml_output_unittest.py +++ b/googletest/test/gtest_xml_output_unittest.py @@ -237,7 +237,7 @@ class GTestXMLOutputUnitTest(gtest_xml_test_utils.GTestXMLTestCase): '--shut_down_xml'] p = gtest_test_utils.Subprocess(command) if p.terminated_by_signal: - # p.signal is avalable only if p.terminated_by_signal is True. + # p.signal is available only if p.terminated_by_signal is True. self.assertFalse( p.terminated_by_signal, '%s was killed by signal %d' % (GTEST_PROGRAM_NAME, p.signal)) diff --git a/googletest/xcode/Scripts/versiongenerate.py b/googletest/xcode/Scripts/versiongenerate.py index 81de8c96..a6abb8bb 100755 --- a/googletest/xcode/Scripts/versiongenerate.py +++ b/googletest/xcode/Scripts/versiongenerate.py @@ -42,7 +42,7 @@ 1. The AC_INIT macro will be contained within the first 1024 characters of configure.ac 2. The version string will be 3 integers separated by periods and will be - surrounded by squre brackets, "[" and "]" (e.g. [1.0.1]). The first + surrounded by square brackets, "[" and "]" (e.g. [1.0.1]). The first segment represents the major version, the second represents the minor version and the third represents the fix version. 3. No ")" character exists between the opening "(" and closing ")" of @@ -68,7 +68,7 @@ config_file.close() # Extract the version string from the AC_INIT macro # The following init_expression means: -# Extract three integers separated by periods and surrounded by squre +# Extract three integers separated by periods and surrounded by square # brackets(e.g. "[1.0.1]") between "AC_INIT(" and ")". Do not be greedy # (*? is the non-greedy flag) since that would pull in everything between # the first "(" and the last ")" in the file. From 3d7d8637989aecf4bd73ab5664ebf2e0513e6487 Mon Sep 17 00:00:00 2001 From: danilcha Date: Sat, 11 Mar 2017 01:02:21 +0100 Subject: [PATCH 12/25] Update README.md --- googlemock/README.md | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/googlemock/README.md b/googlemock/README.md index 7b13a6d3..6fd9221a 100644 --- a/googlemock/README.md +++ b/googlemock/README.md @@ -125,13 +125,34 @@ build Google Mock and its tests, which has further requirements: ### Building Google Mock ### +#### Using CMake #### + 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 +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. +may be of particular interest. +The only modification you will need is to change + + target_link_libraries(example gtest_main) + +to + + target_link_libraries(example gmock_main) + +However, we also recommend adding the following lines (if using CMake 2.8.11 or later): + + target_include_directories(gtest SYSTEM INTERFACE "${gtest_SOURCE_DIR}/include") + target_include_directories(gtest_main SYSTEM INTERFACE "${gtest_SOURCE_DIR}/include") + target_include_directories(gmock SYSTEM INTERFACE "${gmock_SOURCE_DIR}/include") + target_include_directories(gmock_main SYSTEM INTERFACE "${gmock_SOURCE_DIR}/include") + +This marks Google Mock includes as system, which will silence compiler warnings when +compiling your tests using clang with `-Wpedantic -Wall -Wextra -Wconversion`. + #### Preparing to Build (Unix only) #### From b6bdad37de69c120cee4d99e2071888ce54b19ae Mon Sep 17 00:00:00 2001 From: danilcha Date: Sat, 11 Mar 2017 01:06:58 +0100 Subject: [PATCH 13/25] Update README.md --- googlemock/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/googlemock/README.md b/googlemock/README.md index 6fd9221a..af39548c 100644 --- a/googlemock/README.md +++ b/googlemock/README.md @@ -147,8 +147,8 @@ However, we also recommend adding the following lines (if using CMake 2.8.11 or target_include_directories(gtest SYSTEM INTERFACE "${gtest_SOURCE_DIR}/include") target_include_directories(gtest_main SYSTEM INTERFACE "${gtest_SOURCE_DIR}/include") - target_include_directories(gmock SYSTEM INTERFACE "${gmock_SOURCE_DIR}/include") - target_include_directories(gmock_main SYSTEM INTERFACE "${gmock_SOURCE_DIR}/include") + target_include_directories(gmock SYSTEM INTERFACE "${gmock_SOURCE_DIR}/include") + target_include_directories(gmock_main SYSTEM INTERFACE "${gmock_SOURCE_DIR}/include") This marks Google Mock includes as system, which will silence compiler warnings when compiling your tests using clang with `-Wpedantic -Wall -Wextra -Wconversion`. From d36aeb619590bf8331dfc5ab05d5c9c7b22e4abc Mon Sep 17 00:00:00 2001 From: danilcha Date: Sun, 12 Mar 2017 17:47:14 +0100 Subject: [PATCH 14/25] Added explicit gtest library dependency --- googlemock/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/googlemock/README.md b/googlemock/README.md index af39548c..1259f776 100644 --- a/googlemock/README.md +++ b/googlemock/README.md @@ -141,7 +141,7 @@ The only modification you will need is to change to - target_link_libraries(example gmock_main) + target_link_libraries(example gtest gmock_main) However, we also recommend adding the following lines (if using CMake 2.8.11 or later): From d98857c63450a6e56e6eda6ad3851737f6eff57b Mon Sep 17 00:00:00 2001 From: danilcha Date: Sun, 12 Mar 2017 18:11:22 +0100 Subject: [PATCH 15/25] Again rewrote everything --- googlemock/README.md | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/googlemock/README.md b/googlemock/README.md index 1259f776..7efc0685 100644 --- a/googlemock/README.md +++ b/googlemock/README.md @@ -135,23 +135,35 @@ 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. -The only modification you will need is to change +To make it work for Google Mock you will need to change target_link_libraries(example gtest_main) to - target_link_libraries(example gtest gmock_main) + target_link_libraries(example gmock_main) + +This works because `gmock_main` library is compiled with Google Test. +However, it does not automatically add Google Test includes. +Therefore you will also have to change -However, we also recommend adding the following lines (if using CMake 2.8.11 or later): + if (CMAKE_VERSION VERSION_LESS 2.8.11) + include_directories("${gtest_SOURCE_DIR}/include") + endif() - target_include_directories(gtest SYSTEM INTERFACE "${gtest_SOURCE_DIR}/include") - target_include_directories(gtest_main SYSTEM INTERFACE "${gtest_SOURCE_DIR}/include") - target_include_directories(gmock SYSTEM INTERFACE "${gmock_SOURCE_DIR}/include") - target_include_directories(gmock_main SYSTEM INTERFACE "${gmock_SOURCE_DIR}/include") +to -This marks Google Mock includes as system, which will silence compiler warnings when -compiling your tests using clang with `-Wpedantic -Wall -Wextra -Wconversion`. + if (CMAKE_VERSION VERSION_LESS 2.8.11) + include_directories(BEFORE SYSTEM + "${gtest_SOURCE_DIR}/include" "${gmock_SOURCE_DIR}/include") + else() + target_include_directories(gmock_main SYSTEM BEFORE INTERFACE + "${gtest_SOURCE_DIR}/include" "${gmock_SOURCE_DIR}/include") + endif() + +This will addtionally mark Google Mock includes as system, which will +silence compiler warnings when compiling your tests using clang with +`-Wpedantic -Wall -Wextra -Wconversion`. #### Preparing to Build (Unix only) #### From e7cfb0940ae3fa6a9f70af3dd5b671c5d0002db3 Mon Sep 17 00:00:00 2001 From: Hector Dearman Date: Mon, 19 Jun 2017 18:27:33 +0100 Subject: [PATCH 16/25] Fixed misspelling in assertion message. This upstreams a Google-internal change (146491438). --- googlemock/include/gmock/gmock-matchers.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/googlemock/include/gmock/gmock-matchers.h b/googlemock/include/gmock/gmock-matchers.h index 9ade5b64..3a97c438 100644 --- a/googlemock/include/gmock/gmock-matchers.h +++ b/googlemock/include/gmock/gmock-matchers.h @@ -646,7 +646,7 @@ class SafeMatcherCastImpl { // type U. GTEST_COMPILE_ASSERT_( internal::is_reference::value || !internal::is_reference::value, - cannot_convert_non_referentce_arg_to_reference); + cannot_convert_non_reference_arg_to_reference); // In case both T and U are arithmetic types, enforce that the // conversion is not lossy. typedef GTEST_REMOVE_REFERENCE_AND_CONST_(T) RawT; From 3a027b074aba6ac470bc1aae8443bf4eea6537df Mon Sep 17 00:00:00 2001 From: Hector Dearman Date: Mon, 19 Jun 2017 18:43:55 +0100 Subject: [PATCH 17/25] Fix typo in gmock-actions.h This upstreams a Google-internal change (141765019). --- googlemock/include/gmock/gmock-actions.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/googlemock/include/gmock/gmock-actions.h b/googlemock/include/gmock/gmock-actions.h index b3f654af..845c8232 100644 --- a/googlemock/include/gmock/gmock-actions.h +++ b/googlemock/include/gmock/gmock-actions.h @@ -1029,9 +1029,9 @@ class DoBothAction { // return sqrt(x*x + y*y); // } // ... -// EXEPCT_CALL(mock, Foo("abc", _, _)) +// EXPECT_CALL(mock, Foo("abc", _, _)) // .WillOnce(Invoke(DistanceToOriginWithLabel)); -// EXEPCT_CALL(mock, Bar(5, _, _)) +// EXPECT_CALL(mock, Bar(5, _, _)) // .WillOnce(Invoke(DistanceToOriginWithIndex)); // // you could write @@ -1041,8 +1041,8 @@ class DoBothAction { // return sqrt(x*x + y*y); // } // ... -// EXEPCT_CALL(mock, Foo("abc", _, _)).WillOnce(Invoke(DistanceToOrigin)); -// EXEPCT_CALL(mock, Bar(5, _, _)).WillOnce(Invoke(DistanceToOrigin)); +// EXPECT_CALL(mock, Foo("abc", _, _)).WillOnce(Invoke(DistanceToOrigin)); +// EXPECT_CALL(mock, Bar(5, _, _)).WillOnce(Invoke(DistanceToOrigin)); typedef internal::IgnoredValue Unused; // This constructor allows us to turn an Action object into an From 6168d0db2374dcb0ad6e64aec6b19d864e30d16c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20Bostr=C3=B6m?= Date: Tue, 11 Jul 2017 13:23:01 -0700 Subject: [PATCH 18/25] Add gtest-parallel to open-source projects. --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 076484e4..d879118e 100644 --- a/README.md +++ b/README.md @@ -73,6 +73,9 @@ listener for Google Test that implements the [TAP protocol](https://en.wikipedia.org/wiki/Test_Anything_Protocol) for test result output. If your test runner understands TAP, you may find it useful. +[gtest-parallel](https://github.com/google/gtest-parallel) is a test runner that +runs tests from your binary in parallel to provide significant speed-up. + ## Requirements ## Google Test is designed to have fairly minimal requirements to build From a659ce57f6bf6198e90698bd48d603a127d7c7de Mon Sep 17 00:00:00 2001 From: Herbert Thielen Date: Sun, 30 Jul 2017 17:05:48 +0200 Subject: [PATCH 19/25] fix links to Google C++ Style Guide --- googlemock/docs/CookBook.md | 2 +- googlemock/docs/DevGuide.md | 2 +- googletest/docs/DevGuide.md | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/googlemock/docs/CookBook.md b/googlemock/docs/CookBook.md index 90071bc0..34387c0e 100644 --- a/googlemock/docs/CookBook.md +++ b/googlemock/docs/CookBook.md @@ -294,7 +294,7 @@ There are some caveats though (I don't like them just as much as the next guy, but sadly they are side effects of C++'s limitations): 1. `NiceMock` and `StrictMock` only work for mock methods defined using the `MOCK_METHOD*` family of macros **directly** in the `MockFoo` class. If a mock method is defined in a **base class** of `MockFoo`, the "nice" or "strict" modifier may not affect it, depending on the compiler. In particular, nesting `NiceMock` and `StrictMock` (e.g. `NiceMock >`) is **not** supported. - 1. The constructors of the base mock (`MockFoo`) cannot have arguments passed by non-const reference, which happens to be banned by the [Google C++ style guide](http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml). + 1. The constructors of the base mock (`MockFoo`) cannot have arguments passed by non-const reference, which happens to be banned by the [Google C++ style guide](https://google.github.io/styleguide/cppguide.html). 1. During the constructor or destructor of `MockFoo`, the mock object is _not_ nice or strict. This may cause surprises if the constructor or destructor calls a mock method on `this` object. (This behavior, however, is consistent with C++'s general rule: if a constructor or destructor calls a virtual method of `this` object, that method is treated as non-virtual. In other words, to the base class's constructor or destructor, `this` object behaves like an instance of the base class, not the derived class. This rule is required for safety. Otherwise a base constructor may use members of a derived class before they are initialized, or a base destructor may use members of a derived class after they have been destroyed.) Finally, you should be **very cautious** about when to use naggy or strict mocks, as they tend to make tests more brittle and harder to maintain. When you refactor your code without changing its externally visible behavior, ideally you should't need to update any tests. If your code interacts with a naggy mock, however, you may start to get spammed with warnings as the result of your change. Worse, if your code interacts with a strict mock, your tests may start to fail and you'll be forced to fix them. Our general recommendation is to use nice mocks (not yet the default) most of the time, use naggy mocks (the current default) when developing or debugging tests, and use strict mocks only as the last resort. diff --git a/googlemock/docs/DevGuide.md b/googlemock/docs/DevGuide.md index f4bab75c..adb74fe1 100644 --- a/googlemock/docs/DevGuide.md +++ b/googlemock/docs/DevGuide.md @@ -91,7 +91,7 @@ instructions for how to sign and return it. To keep the source consistent, readable, diffable and easy to merge, we use a fairly rigid coding style, as defined by the [google-styleguide](https://github.com/google/styleguide) project. All patches will be expected -to conform to the style outlined [here](https://github.com/google/styleguide/blob/gh-pages/cppguide.xml). +to conform to the style outlined [here](https://google.github.io/styleguide/cppguide.html). ## Submitting Patches ## diff --git a/googletest/docs/DevGuide.md b/googletest/docs/DevGuide.md index 06467a32..4333a8e0 100644 --- a/googletest/docs/DevGuide.md +++ b/googletest/docs/DevGuide.md @@ -80,8 +80,8 @@ instructions for how to sign and return it. ## Coding Style ## To keep the source consistent, readable, diffable and easy to merge, -we use a fairly rigid coding style, as defined by the [google-styleguide](http://code.google.com/p/google-styleguide/) project. All patches will be expected -to conform to the style outlined [here](http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml). +we use a fairly rigid coding style, as defined by the [google-styleguide](https://github.com/google/styleguide) project. All patches will be expected +to conform to the style outlined [here](https://google.github.io/styleguide/cppguide.html). ## Updating Generated Code ## From 76f3a0b4fe71d81462a95dbf5cec8041b2b690dc Mon Sep 17 00:00:00 2001 From: Christophe Vidal Date: Sun, 10 Jul 2016 08:11:35 +0700 Subject: [PATCH 20/25] Fixed typo --- googlemock/configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/googlemock/configure.ac b/googlemock/configure.ac index 3b740f20..edfd8963 100644 --- a/googlemock/configure.ac +++ b/googlemock/configure.ac @@ -130,7 +130,7 @@ AS_IF([test "x${HAVE_BUILT_GTEST}" = "xyes"], GTEST_LIBS=`${GTEST_CONFIG} --libs` GTEST_VERSION=`${GTEST_CONFIG} --version`], [AC_CONFIG_SUBDIRS([../googletest]) - # GTEST_CONFIG needs to be executable both in a Makefile environmont and + # GTEST_CONFIG needs to be executable both in a Makefile environment and # in a shell script environment, so resolve an absolute path for it here. GTEST_CONFIG="`pwd -P`/../googletest/scripts/gtest-config" GTEST_CPPFLAGS='-I$(top_srcdir)/../googletest/include' From b0eda8c2ca9a0f1bf90480e639927fd7e986f80c Mon Sep 17 00:00:00 2001 From: Manuel VIVES Date: Wed, 2 Aug 2017 21:03:13 -0400 Subject: [PATCH 21/25] Fix policy issue with old cmakes #1169 --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7fceb399..f7fb65e1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,9 @@ cmake_minimum_required(VERSION 2.6.4) -cmake_policy(SET CMP0048 NEW) +if (policy CMP0048) + cmake_policy(SET CMP0048 NEW) +endif (policy CMP0048) + project( googletest-distribution ) enable_testing() From a824aeccf0628039c1fc10567ca985fcbe80389f Mon Sep 17 00:00:00 2001 From: Joel Laity Date: Thu, 3 Aug 2017 15:50:45 +1200 Subject: [PATCH 22/25] Fixed cmake policy issue --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f7fb65e1..30486302 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,8 +1,8 @@ cmake_minimum_required(VERSION 2.6.4) -if (policy CMP0048) +if (POLICY CMP0048) cmake_policy(SET CMP0048 NEW) -endif (policy CMP0048) +endif (POLICY CMP0048) project( googletest-distribution ) From be0d00e73381d4f5880d66ecc6dc474aa736bf0f Mon Sep 17 00:00:00 2001 From: Alex Converse Date: Tue, 11 Apr 2017 10:20:18 -0700 Subject: [PATCH 23/25] Use wider types to prevent unsigned overflow diagnostics The rest of the (covered) codebase is already integer overflow clean. This is a cherry-pick of an internal change. TESTED=gtest_shuffle_test goes from fail to pass with -fsanitize=integer --- googletest/src/gtest.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/googletest/src/gtest.cc b/googletest/src/gtest.cc index 4aed0e1c..6cac93d5 100644 --- a/googletest/src/gtest.cc +++ b/googletest/src/gtest.cc @@ -310,7 +310,8 @@ namespace internal { // than kMaxRange. UInt32 Random::Generate(UInt32 range) { // These constants are the same as are used in glibc's rand(3). - state_ = (1103515245U*state_ + 12345U) % kMaxRange; + // Use wider types than necessary to prevent unsigned overflow diagnostics. + state_ = static_cast(1103515245ULL*state_ + 12345U) % kMaxRange; GTEST_CHECK_(range > 0) << "Cannot generate a number in the range [0, 0)."; From 77dfa1e00ffaf4e32af93f39395df1391b264a86 Mon Sep 17 00:00:00 2001 From: Shlomi Fish Date: Wed, 4 Jan 2017 15:51:29 +0200 Subject: [PATCH 24/25] Correct some typos in a comment --- googlemock/test/gmock-generated-actions_test.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/googlemock/test/gmock-generated-actions_test.cc b/googlemock/test/gmock-generated-actions_test.cc index 03908588..80bcb31c 100644 --- a/googlemock/test/gmock-generated-actions_test.cc +++ b/googlemock/test/gmock-generated-actions_test.cc @@ -1120,7 +1120,7 @@ TEST(ActionTemplateTest, WorksForIntegralTemplateParams) { EXPECT_FALSE(b); // Verifies that resetter is deleted. } -// Tests that ACTION_TEMPLATES works for template parameters. +// Tests that ACTION_TEMPLATE works for a template with template parameters. ACTION_TEMPLATE(ReturnSmartPointer, HAS_1_TEMPLATE_PARAMS(template class, Pointer), From 8dd8fb0e4a0a3e4c10167fff943d6abd88034e66 Mon Sep 17 00:00:00 2001 From: Herbert Thielen Date: Sat, 5 Aug 2017 12:42:00 +0200 Subject: [PATCH 25/25] fix small typo in comment --- googletest/samples/sample3_unittest.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/googletest/samples/sample3_unittest.cc b/googletest/samples/sample3_unittest.cc index bf3877d0..a4fbe5a0 100644 --- a/googletest/samples/sample3_unittest.cc +++ b/googletest/samples/sample3_unittest.cc @@ -72,7 +72,7 @@ class QueueTest : public testing::Test { // accessed from sub-classes. // virtual void SetUp() will be called before each test is run. You - // should define it if you need to initialize the varaibles. + // should define it if you need to initialize the variables. // Otherwise, this can be skipped. virtual void SetUp() { q1_.Enqueue(1);