]> git-server-git.apps.pok.os.sepia.ceph.com Git - googletest.git/commitdiff
Googletest export
authorAbseil Team <absl-team@google.com>
Thu, 1 Aug 2019 19:04:08 +0000 (15:04 -0400)
committerGennadiy Civil <misterg@google.com>
Thu, 1 Aug 2019 20:06:11 +0000 (16:06 -0400)
Add links to "sampleK_unittest.cc" examples. Fix some broken docs crosslinks.

PiperOrigin-RevId: 261169561

googlemock/docs/cheat_sheet.md
googlemock/docs/for_dummies.md
googlemock/docs/gmock_faq.md
googletest/docs/advanced.md
googletest/docs/faq.md
googletest/docs/primer.md

index 540da39e7290d528684598e89ebde8eb7bf88e17..3bfc6dde2e3005e3070d34ba43a75dd267e6200b 100644 (file)
@@ -177,7 +177,8 @@ Example usage:
 To customize the default action for a particular method of a specific mock
 object, use `ON_CALL()`. `ON_CALL()` has a similar syntax to `EXPECT_CALL()`,
 but it is used for setting default behaviors (when you do not require that the
-mock method is called). See go/prefer-on-call for a more detailed discussion.
+mock method is called). See [here](cook_book.md#UseOnCall) for a more detailed
+discussion.
 
 ```cpp
 ON_CALL(mock-object, method(matchers))
@@ -332,8 +333,8 @@ The `argument` can be either a C string or a C++ string object:
 
 `ContainsRegex()` and `MatchesRegex()` take ownership of the `RE` object. They
 use the regular expression syntax defined
-[here](http://go/gunit-advanced-regex). `StrCaseEq()`, `StrCaseNe()`, `StrEq()`,
-and `StrNe()` work for wide strings as well.
+[here](advanced.md#regular-expression-syntax). `StrCaseEq()`, `StrCaseNe()`,
+`StrEq()`, and `StrNe()` work for wide strings as well.
 
 #### Container Matchers
 
@@ -658,20 +659,20 @@ which must be a permanent callback.
 :                                    : be any copyable value. Available since  :
 :                                    : v1.1.0.                                 :
 
-#### Using a Function, Functor, Lambda, or Callback as an Action
+#### Using a Function, Functor, or Lambda as an Action
 
 In the following, by "callable" we mean a free function, `std::function`,
-functor, lambda, or `google3`-style permanent callback.
+functor, or lambda.
 
 |                                     |                                        |
 | :---------------------------------- | :------------------------------------- |
 | `f`                                 | Invoke f with the arguments passed to  |
 :                                     : the mock function, where f is a        :
-:                                     : callable (except of google3 callback). :
+:                                     : callable.                              :
 | `Invoke(f)`                         | Invoke `f` with the arguments passed   |
 :                                     : to the mock function, where `f` can be :
 :                                     : a global/static function or a functor. :
-| `Invoke(object_pointer,             | Invoke the {method on the object with  |
+| `Invoke(object_pointer,             | Invoke the method on the object with   |
 : &class\:\:method)`                  : the arguments passed to the mock       :
 :                                     : function.                              :
 | `InvokeWithoutArgs(f)`              | Invoke `f`, which can be a             |
index 5551cd8bc01ba948a7270e2e5d3c2925daee3c5d..3bccd2bde2f4aaf186b4ff27153c99cc3071d35c 100644 (file)
@@ -695,4 +695,4 @@ For example, in some tests we may not care about how many times `GetX()` and
 In gMock, if you are not interested in a method, just don't say anything about
 it. If a call to this method occurs, you'll see a warning in the test output,
 but it won't be a failure. This is called "naggy" behavior; to change, see
-[The Nice, the Strict, and the Naggy](#NiceStrictNaggy).
+[The Nice, the Strict, and the Naggy](cook_book.md#NiceStrictNaggy).
index 3c932291eb03d3c194407662328cc73a898b1ed6..214aabf1218af9cc7ee5c3d37e7e58516aefb116 100644 (file)
@@ -91,9 +91,9 @@ trace, you'll gain insights on why the expectations you set are not met.
 
 If you see the message "The mock function has no default action set, and its
 return type has no default value set.", then try
-[adding a default action](http://go/gmockguide#DefaultValue). Due to a known
-issue, unexpected calls on mocks without default actions don't print out a
-detailed comparison between the actual arguments and the expected arguments.
+[adding a default action](for_dummies.md#DefaultValue). Due to a known issue,
+unexpected calls on mocks without default actions don't print out a detailed
+comparison between the actual arguments and the expected arguments.
 
 ### My program crashed and `ScopedMockLog` spit out tons of messages. Is it a gMock bug?
 
index f8624c0ec9cb5b0e6d1fd0ce4bec28c2ad4c5f04..f48e4b409d2e887600c016ad23d10abef157b9a7 100644 (file)
@@ -399,7 +399,8 @@ and you're ready to go.
 
 ### More String Assertions
 
-(Please read the [previous](#AssertThat) section first if you haven't.)
+(Please read the [previous](#asserting-using-gmock-matchers) section first if
+you haven't.)
 
 You can use the gMock
 [string matchers](../../googlemock/docs/cheat_sheet.md#string-matchers) with
@@ -1407,7 +1408,10 @@ Please note that `INSTANTIATE_TEST_SUITE_P` will instantiate *all* tests in the
 given test suite, whether their definitions come before or *after* the
 `INSTANTIATE_TEST_SUITE_P` statement.
 
-You can see sample7_unittest.cc and sample8_unittest.cc for more examples.
+You can see [sample7_unittest.cc] and [sample8_unittest.cc] for more examples.
+
+[sample7_unittest.cc]: ../samples/sample7_unittest.cc "Parameterized Test example"
+[sample8_unittest.cc]: ../samples/sample8_unittest.cc "Parameterized Test example with multiple parameters"
 
 ### Creating Value-Parameterized Abstract Tests
 
@@ -1446,7 +1450,7 @@ returns the value of `testing::PrintToString(GetParam())`. It does not work for
 
 NOTE: test names must be non-empty, unique, and may only contain ASCII
 alphanumeric characters. In particular, they
-[should not contain underscores](https://github.com/google/googletest/blob/master/googletest/docs/faq.md#why-should-test-suite-names-and-test-names-not-contain-underscore)
+[should not contain underscores](faq.md#why-should-test-suite-names-and-test-names-not-contain-underscore)
 
 ```c++
 class MyTestSuite : public testing::TestWithParam<int> {};
@@ -1555,7 +1559,9 @@ TYPED_TEST(FooTest, DoesBlah) {
 TYPED_TEST(FooTest, HasPropertyA) { ... }
 ```
 
-You can see sample6_unittest.cc
+You can see [sample6_unittest.cc] for a complete example.
+
+[sample6_unittest.cc]: ../samples/sample6_unittest.cc "Typed Test example"
 
 ## Type-Parameterized Tests
 
@@ -1630,7 +1636,7 @@ that type directly without `::testing::Types<...>`, like this:
 INSTANTIATE_TYPED_TEST_SUITE_P(My, FooTest, int);
 ```
 
-You can see `sample6_unittest.cc` for a complete example.
+You can see [sample6_unittest.cc] for a complete example.
 
 ## Testing Private Code
 
@@ -1998,7 +2004,9 @@ You can do so by adding one line:
 ```
 
 Now, sit back and enjoy a completely different output from your tests. For more
-details, you can read this sample9_unittest.cc
+details, see [sample9_unittest.cc].
+
+[sample9_unittest.cc]: ../samples/sample9_unittest.cc "Event listener example"
 
 You may append more than one listener to the list. When an `On*Start()` or
 `OnTestPartResult()` event is fired, the listeners will receive it in the order
@@ -2023,7 +2031,9 @@ handle `OnTestPartResult()` *before* listeners that can generate failures. This
 ensures that failures generated by the latter are attributed to the right test
 by the former.
 
-We have a sample of failure-raising listener sample10_unittest.cc
+See [sample10_unittest.cc] for an example of a failure-raising listener.
+
+[sample10_unittest.cc]: ../samples/sample10_unittest.cc "Failure-raising listener example"
 
 ## Running Test Programs: Advanced Options
 
index d6e7f54a9b7f86beb650f9a2502d711fe7d2ba55..9949fec26d112d9b2322db69a3f4c678a8e0cf33 100644 (file)
@@ -263,7 +263,7 @@ If necessary, you can continue to derive test fixtures from a derived fixture.
 googletest has no limit on how deep the hierarchy can be.
 
 For a complete example using derived test fixtures, see
-[googletest sample](https://github.com/google/googletest/blob/master/googletest/samples/sample5_unittest.cc)
+[sample5_unittest.cc](../samples/sample5_unittest.cc).
 
 ## My compiler complains "void value not ignored as it ought to be." What does this mean?
 
index 275982098f31b9dd849e4270149667d2d233582b..cbb48ec0eb3430fa625f6dc307d333d02b021353 100644 (file)
@@ -51,26 +51,34 @@ of misunderstanding these.
 Historically, googletest started to use the term _Test Case_ for grouping
 related tests, whereas current publications including the International Software
 Testing Qualifications Board ([ISTQB](http://www.istqb.org/)) and various
-textbooks on Software Quality use the term _[Test
-Suite](http://glossary.istqb.org/search/test%20suite)_ for this.
+textbooks on Software Quality use the term _[Test Suite][istqb test suite]_ for
+this.
 
 The related term _Test_, as it is used in the googletest, is corresponding to
-the term _[Test Case](http://glossary.istqb.org/search/test%20case)_ of ISTQB
-and others.
+the term _[Test Case][istqb test case]_ of ISTQB and others.
 
 The term _Test_ is commonly of broad enough sense, including ISTQB's definition
 of _Test Case_, so it's not much of a problem here. But the term _Test Case_ as
 was used in Google Test is of contradictory sense and thus confusing.
 
-googletest recently started replacing the term _Test Case_ by _Test Suite_ The
-preferred API is TestSuite*. The older TestCase* API is being slowly deprecated
-and refactored away
+googletest recently started replacing the term _Test Case_ with _Test Suite_.
+The preferred API is *TestSuite*. The older TestCase API is being slowly
+deprecated and refactored away.
 
 So please be aware of the different definitions of the terms:
 
-Meaning                                                                              | googletest Term         | [ISTQB](http://www.istqb.org/) Term
-:----------------------------------------------------------------------------------- | :---------------------- | :----------------------------------
-Exercise a particular program path with specific input values and verify the results | [TEST()](#simple-tests) | [Test Case](http://glossary.istqb.org/search/test%20case)
+| Meaning           | googletest Term         | [ISTQB](http://www.istqb.org/) |
+:                   :                         : Term                           :
+| :---------------- | :---------------------- | :----------------------------- |
+| Exercise a        | [TEST()](#simple-tests) | [Test Case][istqb test case]   |
+: particular        :                         :                                :
+: program path with :                         :                                :
+: specific input    :                         :                                :
+: values and verify :                         :                                :
+: the results       :                         :                                :
+
+[istqb test case]: http://glossary.istqb.org/en/search/test%20case
+[istqb test suite]: http://glossary.istqb.org/en/search/test%20suite
 
 ## Basic Concepts
 
@@ -235,9 +243,8 @@ of two wide strings fails, their values will be printed as UTF-8 narrow strings.
 **Availability**: Linux, Windows, Mac.
 
 **See also**: For more string comparison tricks (substring, prefix, suffix, and
-regular expression matching, for example), see
-[this](https://github.com/google/googletest/blob/master/googletest/docs/advanced.md)
-in the Advanced googletest Guide.
+regular expression matching, for example), see [this](advanced.md) in the
+Advanced googletest Guide.
 
 ## Simple Tests