From 5ed950c9e39cff044e84ca27d1b6919fa8dd7148 Mon Sep 17 00:00:00 2001 From: Gennadiy Civil Date: Wed, 19 Jun 2019 16:48:38 -0400 Subject: Renaming doc files to make the file names more palatable and in preparation for including documentation in sync process --- googlemock/README.md | 6 +++--- googlemock/docs/CheatSheet.md | 4 ++-- googlemock/docs/Documentation.md | 2 +- googlemock/docs/ForDummies.md | 8 ++++---- googlemock/docs/FrequentlyAskedQuestions.md | 14 +++++++------- googlemock/include/gmock/gmock-generated-actions.h | 2 +- googlemock/include/gmock/gmock-generated-actions.h.pump | 2 +- googlemock/include/gmock/gmock-generated-matchers.h | 2 +- googlemock/include/gmock/gmock-generated-matchers.h.pump | 2 +- googlemock/scripts/fuse_gmock_files.py | 2 +- googlemock/src/gmock-spec-builders.cc | 2 +- googlemock/test/gmock-spec-builders_test.cc | 2 +- googlemock/test/gmock_output_test_golden.txt | 8 ++++---- googletest/docs/advanced.md | 6 +++--- googletest/docs/primer.md | 2 +- 15 files changed, 32 insertions(+), 32 deletions(-) diff --git a/googlemock/README.md b/googlemock/README.md index 5bbc7fb..6465fc6 100644 --- a/googlemock/README.md +++ b/googlemock/README.md @@ -64,7 +64,7 @@ Once you understand the basics, check out the rest of the docs: * [CheatSheet](../googlemock/docs/CheatSheet.md) - all the commonly used stuff at a glance. - * [CookBook](../googlemock/docs/CookBook.md) - recipes for getting things done, + * [CookBook](../googlemock/docs/cook_book.md) - recipes for getting things done, including advanced techniques. If you need help, please check the @@ -195,8 +195,8 @@ may need to tweak your compiler and/or linker flags. Please see the If you have custom matchers defined using `MatcherInterface` or `MakePolymorphicMatcher()`, you'll need to update their definitions to use the new matcher API ( -[monomorphic](./docs/CookBook.md#writing-new-monomorphic-matchers), -[polymorphic](./docs/CookBook.md#writing-new-polymorphic-matchers)). +[monomorphic](./docs/cook_book.md#writing-new-monomorphic-matchers), +[polymorphic](./docs/cook_book.md#writing-new-polymorphic-matchers)). Matchers defined using `MATCHER()` or `MATCHER_P*()` aren't affected. Happy testing! diff --git a/googlemock/docs/CheatSheet.md b/googlemock/docs/CheatSheet.md index bc2af11..d09d910 100644 --- a/googlemock/docs/CheatSheet.md +++ b/googlemock/docs/CheatSheet.md @@ -338,7 +338,7 @@ You can make a matcher from one or more other matchers: | Matcher | Description | |:--------|:------------| |`MatcherCast(m)`|casts matcher `m` to type `Matcher`.| -|`SafeMatcherCast(m)`| [safely casts](CookBook.md#casting-matchers) matcher `m` to type `Matcher`.| +|`SafeMatcherCast(m)`| [safely casts](cook_book.md#casting-matchers) matcher `m` to type `Matcher`.| |`Truly(predicate)`|`predicate(argument)` returns something considered by C++ to be true, where `predicate` is a function or functor.| ## Matchers as Predicates ## @@ -579,7 +579,7 @@ class MockFunction { MOCK_METHODn(Call, R(A1, ..., An)); }; ``` -See this [recipe](CookBook.md#using-check-points) for one application of it. +See this [recipe](cook_book.md#using-check-points) for one application of it. # Flags # diff --git a/googlemock/docs/Documentation.md b/googlemock/docs/Documentation.md index f621259..af8a3b9 100644 --- a/googlemock/docs/Documentation.md +++ b/googlemock/docs/Documentation.md @@ -6,7 +6,7 @@ the respective git branch/tag).** * [ForDummies](ForDummies.md) -- start here if you are new to Google Mock. * [CheatSheet](CheatSheet.md) -- a quick reference. - * [CookBook](CookBook.md) -- recipes for doing various tasks using Google Mock. + * [CookBook](cook_book.md) -- recipes for doing various tasks using Google Mock. * [FrequentlyAskedQuestions](FrequentlyAskedQuestions.md) -- check here before asking a question on the mailing list. To contribute code to Google Mock, read: diff --git a/googlemock/docs/ForDummies.md b/googlemock/docs/ForDummies.md index e2a430f..c8a83cb 100644 --- a/googlemock/docs/ForDummies.md +++ b/googlemock/docs/ForDummies.md @@ -76,7 +76,7 @@ If you are lucky, the mocks you need to use have already been implemented by som Using the `Turtle` interface as example, here are the simple steps you need to follow: 1. Derive a class `MockTurtle` from `Turtle`. - 1. Take a _virtual_ function of `Turtle` (while it's possible to [mock non-virtual methods using templates](CookBook.md#mocking-nonvirtual-methods), it's much more involved). Count how many arguments it has. + 1. Take a _virtual_ function of `Turtle` (while it's possible to [mock non-virtual methods using templates](cook_book.md#mocking-nonvirtual-methods), it's much more involved). Count how many arguments it has. 1. In the `public:` section of the child class, write `MOCK_METHODn();` (or `MOCK_CONST_METHODn();` if you are mocking a `const` method), where `n` is the number of the arguments; if you counted wrong, shame on you, and a compiler error will tell you so. 1. Now comes the fun part: you take the function signature, cut-and-paste the _function name_ as the _first_ argument to the macro, and leave what's left as the _second_ argument (in case you're curious, this is the _type of the function_). 1. Repeat until all virtual functions you want to mock are done. @@ -316,7 +316,7 @@ EXPECT_CALL(turtle, GetX()) .WillRepeatedly(Return(n++)); ``` -Instead of returning 100, 101, 102, ..., consecutively, this mock function will always return 100 as `n++` is only evaluated once. Similarly, `Return(new Foo)` will create a new `Foo` object when the `EXPECT_CALL()` is executed, and will return the same pointer every time. If you want the side effect to happen every time, you need to define a custom action, which we'll teach in the [CookBook](CookBook.md). +Instead of returning 100, 101, 102, ..., consecutively, this mock function will always return 100 as `n++` is only evaluated once. Similarly, `Return(new Foo)` will create a new `Foo` object when the `EXPECT_CALL()` is executed, and will return the same pointer every time. If you want the side effect to happen every time, you need to define a custom action, which we'll teach in the [CookBook](cook_book.md). Time for another quiz! What do you think the following means? @@ -372,7 +372,7 @@ By creating an object of type `InSequence`, all expectations in its scope are pu In this example, we test that `Foo()` calls the three expected functions in the order as written. If a call is made out-of-order, it will be an error. -(What if you care about the relative order of some of the calls, but not all of them? Can you specify an arbitrary partial order? The answer is ... yes! If you are impatient, the details can be found in the [CookBook](CookBook.md#expecting-partially-ordered-calls).) +(What if you care about the relative order of some of the calls, but not all of them? Can you specify an arbitrary partial order? The answer is ... yes! If you are impatient, the details can be found in the [CookBook](cook_book.md#expecting-partially-ordered-calls).) ## All Expectations Are Sticky (Unless Said Otherwise) ## Now let's do a quick quiz to see how well you can use this mock stuff already. How would you test that the turtle is asked to go to the origin _exactly twice_ (you want to ignore any other instructions it receives)? @@ -444,4 +444,4 @@ In Google Mock, if you are not interested in a method, just don't say anything a # What Now? # Congratulations! You've learned enough about Google Mock to start using it. Now, you might want to join the [googlemock](http://groups.google.com/group/googlemock) discussion group and actually write some tests using Google Mock - it will be fun. Hey, it may even be addictive - you've been warned. -Then, if you feel like increasing your mock quotient, you should move on to the [CookBook](CookBook.md). You can learn many advanced features of Google Mock there -- and advance your level of enjoyment and testing bliss. +Then, if you feel like increasing your mock quotient, you should move on to the [CookBook](cook_book.md). You can learn many advanced features of Google Mock there -- and advance your level of enjoyment and testing bliss. diff --git a/googlemock/docs/FrequentlyAskedQuestions.md b/googlemock/docs/FrequentlyAskedQuestions.md index 412d844..7b7ba0f 100644 --- a/googlemock/docs/FrequentlyAskedQuestions.md +++ b/googlemock/docs/FrequentlyAskedQuestions.md @@ -7,7 +7,7 @@ tried [Google Mock Doctor](#how-am-i-supposed-to-make-sense-of-these-horrible-te ## When I call a method on my mock object, the method for the real object is invoked instead. What's the problem? ## -In order for a method to be mocked, it must be _virtual_, unless you use the [high-perf dependency injection technique](CookBook.md#mocking-nonvirtual-methods). +In order for a method to be mocked, it must be _virtual_, unless you use the [high-perf dependency injection technique](cook_book.md#mocking-nonvirtual-methods). ## I wrote some matchers. After I upgraded to a new version of Google Mock, they no longer compile. What's going on? ## @@ -196,8 +196,8 @@ class MyGreatMatcher { ``` For more information, you can read these -[two](CookBook.md#writing-new-monomorphic-matchers) -[recipes](CookBook.md#writing-new-polymorphic-matchers) +[two](cook_book.md#writing-new-monomorphic-matchers) +[recipes](cook_book.md#writing-new-polymorphic-matchers) from the cookbook. As always, you are welcome to post questions on `googlemock@googlegroups.com` if you need any help. @@ -403,10 +403,10 @@ verbose level. If you find yourself needing to perform some action that's not supported by Google Mock directly, remember that you can define your own actions using -[MakeAction()](CookBook.md#writing-new-actions-quickly) or -[MakePolymorphicAction()](CookBook.md#writing-new-polymorphic-actions), +[MakeAction()](cook_book.md#writing-new-actions-quickly) or +[MakePolymorphicAction()](cook_book.md#writing-new-polymorphic-actions), or you can write a stub function and invoke it using -[Invoke()](CookBook.md#using-functionsmethodsfunctors-as-actions). +[Invoke()](cook_book.md#using-functionsmethodsfunctors-as-actions). ## MOCK\_METHODn()'s second argument looks funny. Why don't you use the MOCK\_METHODn(Method, return\_type, arg\_1, ..., arg\_n) syntax? ## @@ -528,7 +528,7 @@ when the mock method is called. `SetArgPointee()` says what the side effect is, but doesn't say what the return value should be. You need `DoAll()` to chain a `SetArgPointee()` with a `Return()`. -See this [recipe](CookBook.md#mocking-side-effects) for more details and an example. +See this [recipe](cook_book.md#mocking-side-effects) for more details and an example. ## My question is not in your FAQ! ## diff --git a/googlemock/include/gmock/gmock-generated-actions.h b/googlemock/include/gmock/gmock-generated-actions.h index 409886c..bf95300 100644 --- a/googlemock/include/gmock/gmock-generated-actions.h +++ b/googlemock/include/gmock/gmock-generated-actions.h @@ -268,7 +268,7 @@ class ActionHelper { // MORE INFORMATION: // // To learn more about using these macros, please search for 'ACTION' on -// https://github.com/google/googletest/blob/master/googlemock/docs/CookBook.md +// https://github.com/google/googletest/blob/master/googlemock/docs/cook_book.md // An internal macro needed for implementing ACTION*(). #define GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_\ diff --git a/googlemock/include/gmock/gmock-generated-actions.h.pump b/googlemock/include/gmock/gmock-generated-actions.h.pump index 87c580c..39e65c3 100644 --- a/googlemock/include/gmock/gmock-generated-actions.h.pump +++ b/googlemock/include/gmock/gmock-generated-actions.h.pump @@ -191,7 +191,7 @@ $template // MORE INFORMATION: // // To learn more about using these macros, please search for 'ACTION' on -// https://github.com/google/googletest/blob/master/googlemock/docs/CookBook.md +// https://github.com/google/googletest/blob/master/googlemock/docs/cook_book.md $range i 0..n $range k 0..n-1 diff --git a/googlemock/include/gmock/gmock-generated-matchers.h b/googlemock/include/gmock/gmock-generated-matchers.h index f9c927c..b6f34bd 100644 --- a/googlemock/include/gmock/gmock-generated-matchers.h +++ b/googlemock/include/gmock/gmock-generated-matchers.h @@ -261,7 +261,7 @@ // // To learn more about using these macros, please search for 'MATCHER' // on -// https://github.com/google/googletest/blob/master/googlemock/docs/CookBook.md +// https://github.com/google/googletest/blob/master/googlemock/docs/cook_book.md #define MATCHER(name, description)\ class name##Matcher {\ diff --git a/googlemock/include/gmock/gmock-generated-matchers.h.pump b/googlemock/include/gmock/gmock-generated-matchers.h.pump index 43a0c5f..333dc9d 100644 --- a/googlemock/include/gmock/gmock-generated-matchers.h.pump +++ b/googlemock/include/gmock/gmock-generated-matchers.h.pump @@ -263,7 +263,7 @@ $$ }} This line fixes auto-indentation of the following code in Emacs. // // To learn more about using these macros, please search for 'MATCHER' // on -// https://github.com/google/googletest/blob/master/googlemock/docs/CookBook.md +// https://github.com/google/googletest/blob/master/googlemock/docs/cook_book.md $range i 0..n $for i diff --git a/googlemock/scripts/fuse_gmock_files.py b/googlemock/scripts/fuse_gmock_files.py index 9b6956f..c33c725 100755 --- a/googlemock/scripts/fuse_gmock_files.py +++ b/googlemock/scripts/fuse_gmock_files.py @@ -55,7 +55,7 @@ EXAMPLES This tool is experimental. In particular, it assumes that there is no conditional inclusion of Google Mock or Google Test headers. Please report any problems to googlemock@googlegroups.com. You can read -https://github.com/google/googletest/blob/master/googlemock/docs/CookBook.md for more +https://github.com/google/googletest/blob/master/googlemock/docs/cook_book.md for more information. """ diff --git a/googlemock/src/gmock-spec-builders.cc b/googlemock/src/gmock-spec-builders.cc index 1971415..ea8e173 100644 --- a/googlemock/src/gmock-spec-builders.cc +++ b/googlemock/src/gmock-spec-builders.cc @@ -292,7 +292,7 @@ void ReportUninterestingCall(CallReaction reaction, const std::string& msg) { "an EXPECT_CALL() if you don't mean to enforce the call. " "See " "https://github.com/google/googletest/blob/master/googlemock/" - "docs/CookBook.md#" + "docs/cook_book.md#" "knowing-when-to-expect for details.\n", stack_frames_to_skip); break; diff --git a/googlemock/test/gmock-spec-builders_test.cc b/googlemock/test/gmock-spec-builders_test.cc index 10869b6..d362a90 100644 --- a/googlemock/test/gmock-spec-builders_test.cc +++ b/googlemock/test/gmock-spec-builders_test.cc @@ -2178,7 +2178,7 @@ class GMockVerboseFlagTest : public VerboseFlagPreservingFixture { "an EXPECT_CALL() if you don't mean to enforce the call. " "See " "https://github.com/google/googletest/blob/master/googlemock/docs/" - "CookBook.md#" + "cook_book.md#" "knowing-when-to-expect for details."; // A void-returning function. diff --git a/googlemock/test/gmock_output_test_golden.txt b/googlemock/test/gmock_output_test_golden.txt index dbcb211..4c90b41 100644 --- a/googlemock/test/gmock_output_test_golden.txt +++ b/googlemock/test/gmock_output_test_golden.txt @@ -75,14 +75,14 @@ GMOCK WARNING: Uninteresting mock function call - returning default value. Function call: Bar2(0, 1) Returns: false -NOTE: You can safely ignore the above warning unless this call should not happen. Do not suppress it by blindly adding an EXPECT_CALL() if you don't mean to enforce the call. See https://github.com/google/googletest/blob/master/googlemock/docs/CookBook.md#knowing-when-to-expect for details. +NOTE: You can safely ignore the above warning unless this call should not happen. Do not suppress it by blindly adding an EXPECT_CALL() if you don't mean to enforce the call. See https://github.com/google/googletest/blob/master/googlemock/docs/cook_book.md#knowing-when-to-expect for details. [ OK ] GMockOutputTest.UninterestingCall [ RUN ] GMockOutputTest.UninterestingCallToVoidFunction GMOCK WARNING: Uninteresting mock function call - returning directly. Function call: Bar3(0, 1) -NOTE: You can safely ignore the above warning unless this call should not happen. Do not suppress it by blindly adding an EXPECT_CALL() if you don't mean to enforce the call. See https://github.com/google/googletest/blob/master/googlemock/docs/CookBook.md#knowing-when-to-expect for details. +NOTE: You can safely ignore the above warning unless this call should not happen. Do not suppress it by blindly adding an EXPECT_CALL() if you don't mean to enforce the call. See https://github.com/google/googletest/blob/master/googlemock/docs/cook_book.md#knowing-when-to-expect for details. [ OK ] GMockOutputTest.UninterestingCallToVoidFunction [ RUN ] GMockOutputTest.RetiredExpectation unknown file: Failure @@ -266,14 +266,14 @@ Uninteresting mock function call - taking default action specified at: FILE:#: Function call: Bar2(2, 2) Returns: true -NOTE: You can safely ignore the above warning unless this call should not happen. Do not suppress it by blindly adding an EXPECT_CALL() if you don't mean to enforce the call. See https://github.com/google/googletest/blob/master/googlemock/docs/CookBook.md#knowing-when-to-expect for details. +NOTE: You can safely ignore the above warning unless this call should not happen. Do not suppress it by blindly adding an EXPECT_CALL() if you don't mean to enforce the call. See https://github.com/google/googletest/blob/master/googlemock/docs/cook_book.md#knowing-when-to-expect for details. GMOCK WARNING: Uninteresting mock function call - taking default action specified at: FILE:#: Function call: Bar2(1, 1) Returns: false -NOTE: You can safely ignore the above warning unless this call should not happen. Do not suppress it by blindly adding an EXPECT_CALL() if you don't mean to enforce the call. See https://github.com/google/googletest/blob/master/googlemock/docs/CookBook.md#knowing-when-to-expect for details. +NOTE: You can safely ignore the above warning unless this call should not happen. Do not suppress it by blindly adding an EXPECT_CALL() if you don't mean to enforce the call. See https://github.com/google/googletest/blob/master/googlemock/docs/cook_book.md#knowing-when-to-expect for details. [ OK ] GMockOutputTest.UninterestingCallWithDefaultAction [ RUN ] GMockOutputTest.ExplicitActionsRunOutWithDefaultAction diff --git a/googletest/docs/advanced.md b/googletest/docs/advanced.md index 8f230ce..c8a7eb6 100644 --- a/googletest/docs/advanced.md +++ b/googletest/docs/advanced.md @@ -394,14 +394,14 @@ using ::testing::StartsWith; EXPECT_THAT(Foo(), StartsWith("Hello")); ``` -Read this [recipe](../../googlemock/docs/CookBook.md#using-matchers-in-google-test-assertions) in +Read this [recipe](../../googlemock/docs/cook_book.md#using-matchers-in-google-test-assertions) in the gMock Cookbook for more details. gMock has a rich set of matchers. You can do many things googletest cannot do alone with them. For a list of matchers gMock provides, read -[this](../../googlemock/docs/CookBook.md#using-matchers). Especially useful among them are +[this](../../googlemock/docs/cook_book.md#using-matchers). Especially useful among them are some [protocol buffer matchers](https://github.com/google/nucleus/blob/master/nucleus/testing/protocol-buffer-matchers.h). It's easy to write -your [own matchers](../../googlemock/docs/CookBook.md#writing-new-matchers-quickly) too. +your [own matchers](../../googlemock/docs/cook_book.md#writing-new-matchers-quickly) too. For example, you can use gMock's [EqualsProto](https://github.com/google/nucleus/blob/master/nucleus/testing/protocol-buffer-matchers.h) diff --git a/googletest/docs/primer.md b/googletest/docs/primer.md index 8f4d4a0..450707b 100644 --- a/googletest/docs/primer.md +++ b/googletest/docs/primer.md @@ -164,7 +164,7 @@ you'll get a compiler error. We used to require the arguments to support the `<<` is supported, it will be called to print the arguments when the assertion fails; otherwise googletest will attempt to print them in the best way it can. For more details and how to customize the printing of the arguments, see -gMock [recipe](../../googlemock/docs/CookBook.md#teaching-google-mock-how-to-print-your-values).). +gMock [recipe](../../googlemock/docs/cook_book.md#teaching-google-mock-how-to-print-your-values).). These assertions can work with a user-defined type, but only if you define the corresponding comparison operator (e.g. `==`, `<`, etc). Since this is -- cgit v0.12