diff options
| author | Abseil Team <absl-team@google.com> | 2021-01-19 09:57:06 -0500 |
|---|---|---|
| committer | CJ Johnson <johnsoncj@google.com> | 2021-01-26 15:42:13 -0500 |
| commit | 14098f20154966987c59f7255acd67931f9ed0d9 (patch) | |
| tree | d386387eeed45f49aec84c5576a968f1e64be96e /docs | |
| parent | d128fc8252d53baad6ea456fa08cbf9028d255f4 (diff) | |
| download | googletest-14098f20154966987c59f7255acd67931f9ed0d9.tar.gz googletest-14098f20154966987c59f7255acd67931f9ed0d9.zip | |
Googletest export
Merge CONTRIBUTORS, delete LICENSEs in googletest/ and googlemock/
PiperOrigin-RevId: 352558822
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/advanced.md | 4 | ||||
| -rw-r--r-- | docs/faq.md | 6 | ||||
| -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 | ||||
| -rw-r--r-- | docs/pump_manual.md | 2 |
9 files changed, 33 insertions, 33 deletions
diff --git a/docs/advanced.md b/docs/advanced.md index 4b6ba0e2..95b60d22 100644 --- a/docs/advanced.md +++ b/docs/advanced.md @@ -1,8 +1,8 @@ # Advanced googletest Topics -<!-- GOOGLETEST_CM0016 DO NOT DELETE --> +go/gunitadvanced -<!-- GOOGLETEST_CM0035 DO NOT DELETE --> +[TOC] ## Introduction diff --git a/docs/faq.md b/docs/faq.md index d91bd4d0..4c9f2a2a 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -1,8 +1,8 @@ # Googletest FAQ -<!-- GOOGLETEST_CM0014 DO NOT DELETE --> +go/gunitfaq -<!-- GOOGLETEST_CM0035 DO NOT DELETE --> +[TOC] ## Why should test suite names and test names not contain underscore? @@ -350,7 +350,7 @@ 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` <!-- GOOGLETEST_CM0015 DO NOT DELETE --> and abort the whole test executable, + use `abort` (in google3, use `CHECK`) 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 diff --git a/docs/gmock_cheat_sheet.md b/docs/gmock_cheat_sheet.md index 0251efcf..63d38da4 100644 --- a/docs/gmock_cheat_sheet.md +++ b/docs/gmock_cheat_sheet.md @@ -1,10 +1,10 @@ # gMock Cheat Sheet -<!-- GOOGLETEST_CM0019 DO NOT DELETE --> +go/gmockcheat -<!-- GOOGLETEST_CM0035 DO NOT DELETE --> +[TOC] -<!-- GOOGLETEST_CM0033 DO NOT DELETE --> +<!--#include file="includes/g3_BUILD_rule.md"--> ## Defining a Mock Class @@ -229,7 +229,7 @@ and the default action will be taken each time. ## Matchers {#MatcherList} -<!-- GOOGLETEST_CM0020 DO NOT DELETE --> +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: @@ -424,9 +424,9 @@ messages, you can use: | `WhenDynamicCastTo<T>(m)` | when `argument` is passed through `dynamic_cast<T>()`, it matches matcher `m`. | <!-- mdformat on --> -<!-- GOOGLETEST_CM0026 DO NOT DELETE --> +<!--#include file="includes/g3_proto_matchers.md"--> -<!-- GOOGLETEST_CM0027 DO NOT DELETE --> +<!--#include file="includes/g3_absl_status_matcher.md"--> ### Multi-argument Matchers {#MultiArgMatchers} @@ -467,7 +467,7 @@ You can make a matcher from one or more other matchers: | `Not(m)` | `argument` doesn't match matcher `m`. | <!-- mdformat on --> -<!-- GOOGLETEST_CM0028 DO NOT DELETE --> +<!--#include file="includes/g3_useful_matchers_outsidegmock.md"--> ### Adapters for Matchers @@ -612,7 +612,7 @@ 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. -<!-- GOOGLETEST_CM0032 DO NOT DELETE --> +<!--#include file="includes/g3_stubby_actions.md"--> ### Composite Actions diff --git a/docs/gmock_cook_book.md b/docs/gmock_cook_book.md index d9e825cc..febab24b 100644 --- a/docs/gmock_cook_book.md +++ b/docs/gmock_cook_book.md @@ -1,6 +1,6 @@ # gMock Cookbook -<!-- GOOGLETEST_CM0012 DO NOT DELETE --> +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 @@ -11,7 +11,7 @@ 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. -<!-- GOOGLETEST_CM0035 DO NOT DELETE --> +[TOC] ## Creating Mock Classes @@ -184,7 +184,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.<!-- GOOGLETEST_CM0017 DO NOT DELETE --> +injection.[See this](http://go/tott/33) 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 +830,7 @@ A frequently used matcher is `_`, which matches anything: ```cpp EXPECT_CALL(foo, DoThat(_, NotNull())); ``` -<!-- GOOGLETEST_CM0022 DO NOT DELETE --> +<!--#include file="includes/g3_matching_proto_buffers_cookbook_recipe.md"--> ### Combining Matchers {#CombiningMatchers} @@ -1161,7 +1161,7 @@ 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) ...`. -<!-- GOOGLETEST_CM0023 DO NOT DELETE --> +<!--#include file="includes/g3_callbacks_as_matchers.md"--> ### Matching Arguments that Are Not Copyable @@ -1478,7 +1478,7 @@ mock object and gMock. ### Knowing When to Expect {#UseOnCall} -<!-- GOOGLETEST_CM0018 DO NOT DELETE --> +(go/use-on-call) **`ON_CALL`** is likely the *single most under-utilized construct* in gMock. @@ -2171,7 +2171,7 @@ 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. -<!-- GOOGLETEST_CM0024 DO NOT DELETE --> +<!--#include file="includes/g3_callback_snippet.md"--> ```cpp using ::testing::_; using ::testing::Invoke; @@ -3266,7 +3266,7 @@ 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. -<!-- GOOGLETEST_CM0025 DO NOT DELETE --> +<!--#include file="includes/g3_testing_code_stubby_server.md"--> ### Running Tests in Emacs @@ -4313,4 +4313,4 @@ 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. :-) -<!-- GOOGLETEST_CM0034 DO NOT DELETE --> +<!--#include file="includes/g3_content.md"--> diff --git a/docs/gmock_faq.md b/docs/gmock_faq.md index dc4a11da..0d879b27 100644 --- a/docs/gmock_faq.md +++ b/docs/gmock_faq.md @@ -1,8 +1,8 @@ ## Legacy gMock FAQ {#GMockFaq} -<!-- GOOGLETEST_CM0021 DO NOT DELETE --> +go/gmockfaq -<!-- GOOGLETEST_CM0035 DO NOT DELETE --> +[TOC] ### When I call a method on my mock object, the method for the real object is invoked instead. What's the problem? @@ -83,7 +83,7 @@ void Bar(int* p); // Neither p nor *p is const. void Bar(const int* p); // p is not const, but *p is. ``` -<!-- GOOGLETEST_CM0030 DO NOT DELETE --> +<!--#include file="includes/g3_mock_multithreaded.md"--> ### I can't figure out why gMock thinks my expectations are not satisfied. What should I do? @@ -128,7 +128,7 @@ using ::testing::_; .Times(0); ``` -<!-- GOOGLETEST_CM0031 DO NOT DELETE --> +<!--#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? diff --git a/docs/gmock_for_dummies.md b/docs/gmock_for_dummies.md index 56769108..37a5c134 100644 --- a/docs/gmock_for_dummies.md +++ b/docs/gmock_for_dummies.md @@ -1,8 +1,8 @@ # gMock for Dummies {#GMockForDummies} -<!-- GOOGLETEST_CM0013 DO NOT DELETE --> +go/gmockfordummies -<!-- GOOGLETEST_CM0035 DO NOT DELETE --> +[TOC] ## What Is gMock? @@ -208,7 +208,7 @@ 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. -<!-- GOOGLETEST_CM0029 DO NOT DELETE --> +<!--#include file="includes/g3_wrap_external_api_snippet.md"--> ## Using Mocks in Tests diff --git a/docs/pkgconfig.md b/docs/pkgconfig.md index aed4ad45..7c3a2979 100644 --- a/docs/pkgconfig.md +++ b/docs/pkgconfig.md @@ -1,6 +1,6 @@ ## Using GoogleTest from various build systems -<!-- GOOGLETEST_CM0035 DO NOT DELETE --> +[TOC] GoogleTest comes with pkg-config files that can be used to determine all necessary flags for compiling and linking to GoogleTest (and GoogleMock). diff --git a/docs/primer.md b/docs/primer.md index 28c16916..4c17fc78 100644 --- a/docs/primer.md +++ b/docs/primer.md @@ -1,8 +1,8 @@ # Googletest Primer -<!-- GOOGLETEST_CM0036 DO NOT DELETE --> +go/gunitprimer -<!-- GOOGLETEST_CM0035 DO NOT DELETE --> +[TOC] ## Introduction: Why googletest? diff --git a/docs/pump_manual.md b/docs/pump_manual.md index 9dbe15bb..bef498d3 100644 --- a/docs/pump_manual.md +++ b/docs/pump_manual.md @@ -1,6 +1,6 @@ <b>P</b>ump is <b>U</b>seful for <b>M</b>eta <b>P</b>rogramming. -<!-- GOOGLETEST_CM0035 DO NOT DELETE --> +[TOC] # The Problem |

