diff options
author | Abseil Team <absl-team@google.com> | 2021-01-26 01:51:26 (GMT) |
---|---|---|
committer | CJ Johnson <johnsoncj@google.com> | 2021-01-26 20:43:46 (GMT) |
commit | 8a7618672a4ddd576a4e0feba2e3597c3b602434 (patch) | |
tree | a502b8e7ba8b9eca4db89c7901a8d5a6adeb7767 /docs | |
parent | 3351eba0aa33668f8f4cf5d24eb5f68fce17e034 (diff) | |
download | googletest-8a7618672a4ddd576a4e0feba2e3597c3b602434.zip googletest-8a7618672a4ddd576a4e0feba2e3597c3b602434.tar.gz googletest-8a7618672a4ddd576a4e0feba2e3597c3b602434.tar.bz2 |
Googletest export
Delete internal tags from docs
PiperOrigin-RevId: 353769887
Diffstat (limited to 'docs')
-rw-r--r-- | docs/advanced.md | 4 | ||||
-rw-r--r-- | docs/faq.md | 8 | ||||
-rw-r--r-- | docs/gmock_cheat_sheet.md | 16 | ||||
-rw-r--r-- | docs/gmock_cook_book.md | 18 | ||||
-rw-r--r-- | docs/gmock_faq.md | 8 | ||||
-rw-r--r-- | docs/gmock_for_dummies.md | 6 | ||||
-rw-r--r-- | docs/pkgconfig.md | 2 | ||||
-rw-r--r-- | docs/primer.md | 4 |
8 files changed, 3 insertions, 63 deletions
diff --git a/docs/advanced.md b/docs/advanced.md index 95b60d2..7885772 100644 --- a/docs/advanced.md +++ b/docs/advanced.md @@ -1,9 +1,5 @@ # Advanced googletest Topics -go/gunitadvanced - -[TOC] - ## Introduction Now that you have read the [googletest Primer](primer.md) and learned how to diff --git a/docs/faq.md b/docs/faq.md index 4c9f2a2..d3c84ff 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -1,9 +1,5 @@ # Googletest FAQ -go/gunitfaq - -[TOC] - ## Why should test suite names and test names not contain underscore? Note: Googletest reserves underscore (`_`) for special purpose keywords, such as @@ -350,8 +346,8 @@ You may still want to use `SetUp()/TearDown()` in the following cases: * In the body of a constructor (or destructor), it's not possible to use the `ASSERT_xx` macros. Therefore, if the set-up operation could cause a fatal test failure that should prevent the test from running, it's necessary to - use `abort` (in google3, use `CHECK`) and abort the whole test executable, - or to use `SetUp()` instead of a constructor. + use `abort` and abort the whole test + executable, or to use `SetUp()` instead of a constructor. * If the tear-down operation could throw an exception, you must use `TearDown()` as opposed to the destructor, as throwing in a destructor leads to undefined behavior and usually will kill your program right away. Note diff --git a/docs/gmock_cheat_sheet.md b/docs/gmock_cheat_sheet.md index 29535a9..462da85 100644 --- a/docs/gmock_cheat_sheet.md +++ b/docs/gmock_cheat_sheet.md @@ -1,11 +1,5 @@ # gMock Cheat Sheet -go/gmockcheat - -[TOC] - -<!--#include file="includes/g3_BUILD_rule.md"--> - ## Defining a Mock Class ### Mocking a Normal Class {#MockClass} @@ -229,8 +223,6 @@ and the default action will be taken each time. ## Matchers {#MatcherList} -go/matchers - A **matcher** matches a *single* argument. You can use it inside `ON_CALL()` or `EXPECT_CALL()`, or use it to validate a value directly using two macros: @@ -427,10 +419,6 @@ messages, you can use: | `WhenDynamicCastTo<T>(m)` | when `argument` is passed through `dynamic_cast<T>()`, it matches matcher `m`. | <!-- mdformat on --> -<!--#include file="includes/g3_proto_matchers.md"--> - -<!--#include file="includes/g3_absl_status_matcher.md"--> - ### Multi-argument Matchers {#MultiArgMatchers} Technically, all matchers match a *single* value. A "multi-argument" matcher is @@ -470,8 +458,6 @@ You can make a matcher from one or more other matchers: | `Not(m)` | `argument` doesn't match matcher `m`. | <!-- mdformat on --> -<!--#include file="includes/g3_useful_matchers_outsidegmock.md"--> - ### Adapters for Matchers <!-- mdformat off(no multiline tables) --> @@ -615,8 +601,6 @@ value, and `foo` by reference. **Note:** due to technical reasons, `DoDefault()` cannot be used inside a composite action - trying to do so will result in a run-time error. -<!--#include file="includes/g3_stubby_actions.md"--> - ### Composite Actions <!-- mdformat off(no multiline tables) --> diff --git a/docs/gmock_cook_book.md b/docs/gmock_cook_book.md index febab24..de3464d 100644 --- a/docs/gmock_cook_book.md +++ b/docs/gmock_cook_book.md @@ -1,7 +1,5 @@ # gMock Cookbook -go/gmockcook - You can find recipes for using gMock here. If you haven't yet, please read [the dummy guide](gmock_for_dummies.md) first to make sure you understand the basics. @@ -11,8 +9,6 @@ recommended to write `using ::testing::Foo;` once in your file before using the name `Foo` defined by gMock. We omit such `using` statements in this section for brevity, but you should do it in your own code. -[TOC] - ## Creating Mock Classes Mock classes are defined as normal classes, using the `MOCK_METHOD` macro to @@ -183,8 +179,7 @@ class MockStack : public StackInterface<Elem> { ### Mocking Non-virtual Methods {#MockingNonVirtualMethods} -gMock can mock non-virtual functions to be used in Hi-perf dependency -injection.[See this](http://go/tott/33) +gMock can mock non-virtual functions to be used in Hi-perf dependency injection. In this case, instead of sharing a common base class with the real class, your mock class will be *unrelated* to the real class, but contain methods with the @@ -830,7 +825,6 @@ A frequently used matcher is `_`, which matches anything: ```cpp EXPECT_CALL(foo, DoThat(_, NotNull())); ``` -<!--#include file="includes/g3_matching_proto_buffers_cookbook_recipe.md"--> ### Combining Matchers {#CombiningMatchers} @@ -1161,8 +1155,6 @@ Note that the predicate function / functor doesn't have to return `bool`. It works as long as the return value can be used as the condition in in statement `if (condition) ...`. -<!--#include file="includes/g3_callbacks_as_matchers.md"--> - ### Matching Arguments that Are Not Copyable When you do an `EXPECT_CALL(mock_obj, Foo(bar))`, gMock saves away a copy of @@ -1478,8 +1470,6 @@ mock object and gMock. ### Knowing When to Expect {#UseOnCall} -(go/use-on-call) - **`ON_CALL`** is likely the *single most under-utilized construct* in gMock. There are basically two constructs for defining the behavior of a mock object: @@ -2171,8 +2161,6 @@ own precedence order distinct from the `ON_CALL` precedence order. If the built-in actions don't suit you, you can use an existing callable (function, `std::function`, method, functor, lambda) as an action. -<!--#include file="includes/g3_callback_snippet.md"--> - ```cpp using ::testing::_; using ::testing::Invoke; @@ -3266,8 +3254,6 @@ If you are interested in the mock call trace but not the stack traces, you can combine `--gmock_verbose=info` with `--gtest_stack_trace_depth=0` on the test command line. -<!--#include file="includes/g3_testing_code_stubby_server.md"--> - ### Running Tests in Emacs If you build and run your tests in Emacs using the `M-x google-compile` command @@ -4312,5 +4298,3 @@ expectations. Although `std::function` supports unlimited number of arguments, `MockFunction` implementation is limited to ten. If you ever hit that limit... well, your callback has bigger problems than being mockable. :-) - -<!--#include file="includes/g3_content.md"--> diff --git a/docs/gmock_faq.md b/docs/gmock_faq.md index 0d879b2..c02e539 100644 --- a/docs/gmock_faq.md +++ b/docs/gmock_faq.md @@ -1,9 +1,5 @@ ## Legacy gMock FAQ {#GMockFaq} -go/gmockfaq - -[TOC] - ### 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 @@ -83,8 +79,6 @@ void Bar(int* p); // Neither p nor *p is const. void Bar(const int* p); // p is not const, but *p is. ``` -<!--#include file="includes/g3_mock_multithreaded.md"--> - ### I can't figure out why gMock thinks my expectations are not satisfied. What should I do? You might want to run your test with `--gmock_verbose=info`. This flag lets @@ -128,8 +122,6 @@ using ::testing::_; .Times(0); ``` -<!--#include file="includes/g3_mock_a_stubby_server.md"--> - ### I have a failed test where gMock tells me TWICE that a particular expectation is not satisfied. Isn't this redundant? When gMock detects a failure, it prints relevant information (the mock function diff --git a/docs/gmock_for_dummies.md b/docs/gmock_for_dummies.md index 37a5c13..1e5f966 100644 --- a/docs/gmock_for_dummies.md +++ b/docs/gmock_for_dummies.md @@ -1,9 +1,5 @@ # gMock for Dummies {#GMockForDummies} -go/gmockfordummies - -[TOC] - ## What Is gMock? When you write a prototype or test, often it's not feasible or wise to rely on @@ -208,8 +204,6 @@ choosing the adaptor interface can make your code easier to write and more readable (a net win in the long run), as you can choose `FooAdaptor` to fit your specific domain much better than `Foo` does. -<!--#include file="includes/g3_wrap_external_api_snippet.md"--> - ## Using Mocks in Tests Once you have a mock class, using it is easy. The typical work flow is: diff --git a/docs/pkgconfig.md b/docs/pkgconfig.md index 7c3a297..b9bef3f 100644 --- a/docs/pkgconfig.md +++ b/docs/pkgconfig.md @@ -1,7 +1,5 @@ ## Using GoogleTest from various build systems -[TOC] - GoogleTest comes with pkg-config files that can be used to determine all necessary flags for compiling and linking to GoogleTest (and GoogleMock). Pkg-config is a standardised plain-text format containing diff --git a/docs/primer.md b/docs/primer.md index 4c17fc7..2f459fd 100644 --- a/docs/primer.md +++ b/docs/primer.md @@ -1,9 +1,5 @@ # Googletest Primer -go/gunitprimer - -[TOC] - ## Introduction: Why googletest? *googletest* helps you write better C++ tests. |