From ff7263226a130e2349bf406626a87e651a9b2b08 Mon Sep 17 00:00:00 2001 From: mehagar Date: Tue, 29 Dec 2015 07:29:56 -0600 Subject: 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 5ad10e1..6518d4a 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: ``` -- cgit v0.12 From 62b167e40981f2a00397e80ddf4b6bd8cd6f4a38 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: 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 b1827c7..b0ee597 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 | -- cgit v0.12 From 266a185a528bc2061016f133862e9af67fa126ce Mon Sep 17 00:00:00 2001 From: Li Peng Date: Wed, 27 Apr 2016 16:41:27 +0800 Subject: 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 d6f2f76..4328ece 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 e742451..d659979 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 5ca5bc7..f01390c 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 93a6520..b920155 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 34e19c2..03432aa 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 78864b1..f420274 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 dd4af8f..ef98926 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 a01a369..1943c2f 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 e5bf3dd..6aeef49 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 d882ab2..4df3bd6 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 88e9413..21beac8 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 81de8c9..dba08e9 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 -- cgit v0.12 From a7ab054f2b777c9456cc70442596fd1b4b45cb02 Mon Sep 17 00:00:00 2001 From: Manuel Vives Date: Sat, 21 May 2016 20:18:32 -0400 Subject: Issue 709: Fix Cmake policy 0048 --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8d2b552..0dd97a0 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() -- cgit v0.12 From f700442db332033cd874fe453c1006b2a5fcd276 Mon Sep 17 00:00:00 2001 From: Marzo Sette Torres Junior Date: Fri, 2 Sep 2016 14:39:48 -0300 Subject: 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 c52f100..5f5ea44 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 { -- cgit v0.12 From 0b6d9475170a3a8a03d1b1d7ec991896daa8d95f Mon Sep 17 00:00:00 2001 From: Ross Wang Date: Tue, 18 Oct 2016 13:56:03 -0700 Subject: 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 474c1d2..be6ad38 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. -- cgit v0.12 From 21ccd6108dc8985a1c414599dde258cbc13225a1 Mon Sep 17 00:00:00 2001 From: Edgar Riba Date: Sat, 5 Nov 2016 19:58:53 +0100 Subject: 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 076484e..cb5cf5b 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 ## -- cgit v0.12 From 3ec005239febf13798f1af69eabbb8c4fb2ead7d Mon Sep 17 00:00:00 2001 From: Alexey Klimkin Date: Mon, 12 Dec 2016 16:38:14 -0800 Subject: 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 d882ab2..a0bdc2c 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" -- cgit v0.12 From 2eaab21554e992be5c62772a473c123f5e262220 Mon Sep 17 00:00:00 2001 From: nicolacavallini Date: Fri, 23 Dec 2016 11:45:08 +0100 Subject: 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 93a6520..8712766 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_`);` | -- cgit v0.12 From 51d92b2ccb9708c52fee3f2dc81c26f51bf8f19f Mon Sep 17 00:00:00 2001 From: Dawid Kurek Date: Mon, 6 Feb 2017 13:31:11 +0100 Subject: 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 0460d35..89a4150 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; -- cgit v0.12 From a2451c74038fa50870186c9c17b3393ead4b5981 Mon Sep 17 00:00:00 2001 From: vpfautz Date: Sun, 26 Feb 2017 19:15:33 +0100 Subject: 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 29797e4..dbc004d 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 f171e26..7c08b28 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 6e6f9a1..81e8e04 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 d882ab2..1602c0c 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 c5067a4..1d25ee6 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 4acd36c..d2b6748 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 97fcd5a..6d20be3 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 524e437..678f546 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 bcd5975..e940a5a 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 81de8c9..a6abb8b 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. -- cgit v0.12 From b2521c890a8cf56830f9de0e0830311b30e7f61e Mon Sep 17 00:00:00 2001 From: danilcha Date: Sat, 11 Mar 2017 01:02:21 +0100 Subject: 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 7b13a6d..6fd9221 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) #### -- cgit v0.12 From b6c4d434dbf41e8a83b808988f7a1cc95d4a5d39 Mon Sep 17 00:00:00 2001 From: danilcha Date: Sat, 11 Mar 2017 01:06:58 +0100 Subject: 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 6fd9221..af39548 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`. -- cgit v0.12 From 81bc87652d40f1ad9e93650c0a4ba323b235f61d Mon Sep 17 00:00:00 2001 From: danilcha Date: Sun, 12 Mar 2017 17:47:14 +0100 Subject: 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 af39548..1259f77 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): -- cgit v0.12 From 5ff680577d3e6ed290e0b704ac5e349ed16aebf9 Mon Sep 17 00:00:00 2001 From: danilcha Date: Sun, 12 Mar 2017 18:11:22 +0100 Subject: Again rewrote everything --- googlemock/README.md | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/googlemock/README.md b/googlemock/README.md index 1259f77..7efc068 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) - -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`. + 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 + + if (CMAKE_VERSION VERSION_LESS 2.8.11) + include_directories("${gtest_SOURCE_DIR}/include") + endif() + +to + + 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) #### -- cgit v0.12 From 24054ff0737836a1e937bee7c3acb41471cc4555 Mon Sep 17 00:00:00 2001 From: Hector Dearman Date: Mon, 19 Jun 2017 18:27:33 +0100 Subject: 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 9ade5b6..3a97c43 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; -- cgit v0.12 From 41ad243d930e9f28665cc4cb1127917f0c0731d6 Mon Sep 17 00:00:00 2001 From: Hector Dearman Date: Mon, 19 Jun 2017 18:43:55 +0100 Subject: 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 b3f654a..845c823 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 -- cgit v0.12 From 1b39c3dcdf7759fd8dce5ef2d0c265151de9f1b0 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: Add gtest-parallel to open-source projects. --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 076484e..d879118 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 -- cgit v0.12 From ec19d455bc1224fc2ca8c43d4a0e3d528a7e2a26 Mon Sep 17 00:00:00 2001 From: Herbert Thielen Date: Sun, 30 Jul 2017 17:05:48 +0200 Subject: 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 90071bc..34387c0 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 f4bab75..adb74fe 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 06467a3..4333a8e 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 ## -- cgit v0.12 From 623616a50a3220ca43609cf5f534325d5ba21c6b Mon Sep 17 00:00:00 2001 From: Christophe Vidal Date: Sun, 10 Jul 2016 08:11:35 +0700 Subject: Fixed typo --- googlemock/configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/googlemock/configure.ac b/googlemock/configure.ac index 3b740f2..edfd896 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' -- cgit v0.12 From b68f1e769c7a846b10c9ba2f604fc4d0532ecc95 Mon Sep 17 00:00:00 2001 From: Manuel VIVES Date: Wed, 2 Aug 2017 21:03:13 -0400 Subject: 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 7fceb39..f7fb65e 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() -- cgit v0.12 From 568958e94000946a035a034a6d99c7a90fc8984f Mon Sep 17 00:00:00 2001 From: Joel Laity Date: Thu, 3 Aug 2017 15:50:45 +1200 Subject: Fixed cmake policy issue --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f7fb65e..3048630 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 ) -- cgit v0.12 From deb99a9d268b7846cace92386414cd799002f855 Mon Sep 17 00:00:00 2001 From: Alex Converse Date: Tue, 11 Apr 2017 10:20:18 -0700 Subject: 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 4aed0e1..6cac93d 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)."; -- cgit v0.12 From aac403334d57ca59a7e5930e2b6f73e9cfadee2a Mon Sep 17 00:00:00 2001 From: Shlomi Fish Date: Wed, 4 Jan 2017 15:51:29 +0200 Subject: 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 0390858..80bcb31 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), -- cgit v0.12 From 212f4d793e5f019903d0c0b4c24e14341b641d8a Mon Sep 17 00:00:00 2001 From: Herbert Thielen Date: Sat, 5 Aug 2017 12:42:00 +0200 Subject: 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 bf3877d..a4fbe5a 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); -- cgit v0.12