Fix link to FAQ in Primer.md
This commit is contained in:
@@ -123,7 +123,7 @@ c is 10<br>
|
||||
|
||||
**Notes:**
|
||||
|
||||
1. If you see a compiler error "no matching function to call" when using `ASSERT_PRED*` or `EXPECT_PRED*`, please see [this](http://code.google.com/p/googletest/wiki/V1_6_FAQ#The_compiler_complains_%22no_matching_function_to_call%22) for how to resolve it.
|
||||
1. If you see a compiler error "no matching function to call" when using `ASSERT_PRED*` or `EXPECT_PRED*`, please see [this](v1_6_FAQ.md#ithe-compiler-complains-about-undefined-references-to-some-static-const-member-variables-but-i-did-define-them-in-the-class-body-whats-wrong) for how to resolve it.
|
||||
1. Currently we only provide predicate assertions of arity <= 5. If you need a higher-arity assertion, let us know.
|
||||
|
||||
_Availability_: Linux, Windows, Mac
|
||||
@@ -263,7 +263,7 @@ int SmallestPrimeCommonDivisor(int m, int n) { ... }
|
||||
int n) {
|
||||
if (MutuallyPrime(m, n))
|
||||
return ::testing::AssertionSuccess();
|
||||
|
||||
|
||||
return ::testing::AssertionFailure()
|
||||
<< m_expr << " and " << n_expr << " (" << m << " and " << n
|
||||
<< ") are not mutually prime, " << "as they have a common divisor "
|
||||
@@ -515,9 +515,9 @@ _death tests_. More generally, any test that checks that a program terminates
|
||||
Note that if a piece of code throws an exception, we don't consider it "death"
|
||||
for the purpose of death tests, as the caller of the code could catch the exception
|
||||
and avoid the crash. If you want to verify exceptions thrown by your code,
|
||||
see [Exception Assertions](#Exception_Assertions.md).
|
||||
see [Exception Assertions](#exception-assertions).
|
||||
|
||||
If you want to test `EXPECT_*()/ASSERT_*()` failures in your test code, see [Catching Failures](#Catching_Failures.md).
|
||||
If you want to test `EXPECT_*()/ASSERT_*()` failures in your test code, see [Catching Failures](#catching-failures).
|
||||
|
||||
## How to Write a Death Test ##
|
||||
|
||||
@@ -801,7 +801,7 @@ For example,
|
||||
11: EXPECT_EQ(1, Bar(n));
|
||||
12: EXPECT_EQ(2, Bar(n + 1));
|
||||
13: }
|
||||
14:
|
||||
14:
|
||||
15: TEST(FooTest, Bar) {
|
||||
16: {
|
||||
17: SCOPED_TRACE("A"); // This trace point will be included in
|
||||
@@ -1196,9 +1196,9 @@ which are all in the `testing` namespace:
|
||||
| `Values(v1, v2, ..., vN)` | Yields values `{v1, v2, ..., vN}`. |
|
||||
| `ValuesIn(container)` and `ValuesIn(begin, end)` | Yields values from a C-style array, an STL-style container, or an iterator range `[begin, end)`. `container`, `begin`, and `end` can be expressions whose values are determined at run time. |
|
||||
| `Bool()` | Yields sequence `{false, true}`. |
|
||||
| `Combine(g1, g2, ..., gN)` | Yields all combinations (the Cartesian product for the math savvy) of the values generated by the `N` generators. This is only available if your system provides the `<tr1/tuple>` header. If you are sure your system does, and Google Test disagrees, you can override it by defining `GTEST_HAS_TR1_TUPLE=1`. See comments in [include/gtest/internal/gtest-port.h](http://code.google.com/p/googletest/source/browse/trunk/include/gtest/internal/gtest-port.h) for more information. |
|
||||
| `Combine(g1, g2, ..., gN)` | Yields all combinations (the Cartesian product for the math savvy) of the values generated by the `N` generators. This is only available if your system provides the `<tr1/tuple>` header. If you are sure your system does, and Google Test disagrees, you can override it by defining `GTEST_HAS_TR1_TUPLE=1`. See comments in [include/gtest/internal/gtest-port.h](../include/gtest/internal/gtest-port.h) for more information. |
|
||||
|
||||
For more details, see the comments at the definitions of these functions in the [source code](http://code.google.com/p/googletest/source/browse/trunk/include/gtest/gtest-param-test.h).
|
||||
For more details, see the comments at the definitions of these functions in the [source code](../include/gtest/gtest-param-test.h).
|
||||
|
||||
The following statement will instantiate tests from the `FooTest` test case
|
||||
each with parameter values `"meeny"`, `"miny"`, and `"moe"`.
|
||||
@@ -1223,7 +1223,7 @@ names:
|
||||
* `InstantiationName/FooTest.HasBlahBlah/1` for `"miny"`
|
||||
* `InstantiationName/FooTest.HasBlahBlah/2` for `"moe"`
|
||||
|
||||
You can use these names in [--gtest\_filter](#Running_a_Subset_of_the_Tests.md).
|
||||
You can use these names in [--gtest\-filter](#running-a-subset-of-the-tests).
|
||||
|
||||
This statement will instantiate all tests from `FooTest` again, each
|
||||
with parameter values `"cat"` and `"dog"`:
|
||||
@@ -1246,8 +1246,8 @@ tests in the given test case, whether their definitions come before or
|
||||
_after_ the `INSTANTIATE_TEST_CASE_P` statement.
|
||||
|
||||
You can see
|
||||
[these](http://code.google.com/p/googletest/source/browse/trunk/samples/sample7_unittest.cc)
|
||||
[files](http://code.google.com/p/googletest/source/browse/trunk/samples/sample8_unittest.cc) for more examples.
|
||||
[these](../samples/sample7_unittest.cc)
|
||||
[files](../samples/sample8_unittest.cc) for more examples.
|
||||
|
||||
_Availability_: Linux, Windows (requires MSVC 8.0 or above), Mac; since version 1.2.0.
|
||||
|
||||
@@ -1643,8 +1643,8 @@ _Availability:_ Linux, Windows, Mac; since v1.4.0.
|
||||
## Defining Event Listeners ##
|
||||
|
||||
To define a event listener, you subclass either
|
||||
[testing::TestEventListener](http://code.google.com/p/googletest/source/browse/trunk/include/gtest/gtest.h#855)
|
||||
or [testing::EmptyTestEventListener](http://code.google.com/p/googletest/source/browse/trunk/include/gtest/gtest.h#905).
|
||||
[testing::TestEventListener](../include/gtest/gtest.h#L855)
|
||||
or [testing::EmptyTestEventListener](../include/gtest/gtest.h#L905).
|
||||
The former is an (abstract) interface, where <i>each pure virtual method<br>
|
||||
can be overridden to handle a test event</i> (For example, when a test
|
||||
starts, the `OnTestStart()` method will be called.). The latter provides
|
||||
@@ -1653,10 +1653,10 @@ subclass only needs to override the methods it cares about.
|
||||
|
||||
When an event is fired, its context is passed to the handler function
|
||||
as an argument. The following argument types are used:
|
||||
* [UnitTest](http://code.google.com/p/googletest/source/browse/trunk/include/gtest/gtest.h#1007) reflects the state of the entire test program,
|
||||
* [TestCase](http://code.google.com/p/googletest/source/browse/trunk/include/gtest/gtest.h#689) has information about a test case, which can contain one or more tests,
|
||||
* [TestInfo](http://code.google.com/p/googletest/source/browse/trunk/include/gtest/gtest.h#599) contains the state of a test, and
|
||||
* [TestPartResult](http://code.google.com/p/googletest/source/browse/trunk/include/gtest/gtest-test-part.h#42) represents the result of a test assertion.
|
||||
* [UnitTest](../include/gtest/gtest.h#L1007) reflects the state of the entire test program,
|
||||
* [TestCase](../include/gtest/gtest.h#L689) has information about a test case, which can contain one or more tests,
|
||||
* [TestInfo](../include/gtest/gtest.h#L599) contains the state of a test, and
|
||||
* [TestPartResult](../include/gtest/gtest-test-part.h#L42) represents the result of a test assertion.
|
||||
|
||||
An event handler function can examine the argument it receives to find
|
||||
out interesting information about the event and the test program's
|
||||
@@ -1692,7 +1692,7 @@ state. Here's an example:
|
||||
|
||||
To use the event listener you have defined, add an instance of it to
|
||||
the Google Test event listener list (represented by class
|
||||
[TestEventListeners](http://code.google.com/p/googletest/source/browse/trunk/include/gtest/gtest.h#929)
|
||||
[TestEventListeners](../include/gtest/gtest.h#L929)
|
||||
- note the "s" at the end of the name) in your
|
||||
`main()` function, before calling `RUN_ALL_TESTS()`:
|
||||
```
|
||||
@@ -1720,7 +1720,7 @@ event listener list and delete it. 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
|
||||
[sample](http://code.google.com/p/googletest/source/browse/trunk/samples/sample9_unittest.cc).
|
||||
[sample](../samples/sample9_unittest.cc).
|
||||
|
||||
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
|
||||
@@ -1745,7 +1745,7 @@ 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
|
||||
[here](http://code.google.com/p/googletest/source/browse/trunk/samples/sample10_unittest.cc).
|
||||
[here](../samples/sample10_unittest.cc).
|
||||
|
||||
# Running Test Programs: Advanced Options #
|
||||
|
||||
@@ -1865,12 +1865,12 @@ _Availability:_ Linux, Windows, Mac.
|
||||
|
||||
### Temporarily Enabling Disabled Tests ###
|
||||
|
||||
To include [disabled tests](#Temporarily_Disabling_Tests.md) in test
|
||||
To include [disabled tests](#temporarily-disabling-tests) in test
|
||||
execution, just invoke the test program with the
|
||||
`--gtest_also_run_disabled_tests` flag or set the
|
||||
`GTEST_ALSO_RUN_DISABLED_TESTS` environment variable to a value other
|
||||
than `0`. You can combine this with the
|
||||
[--gtest\_filter](#Running_a_Subset_of_the_Tests.md) flag to further select
|
||||
[--gtest\-filter](#running-a-subset-of-the_tests) flag to further select
|
||||
which disabled tests to run.
|
||||
|
||||
_Availability:_ Linux, Windows, Mac; since version 1.3.0.
|
||||
@@ -2168,11 +2168,11 @@ and you should see an `OUTPUT_DIR` directory being created with files
|
||||
`gtest/gtest.h` and `gtest/gtest-all.cc` in it. These files contain
|
||||
everything you need to use Google Test. Just copy them to anywhere
|
||||
you want and you are ready to write tests. You can use the
|
||||
[scripts/test/Makefile](http://code.google.com/p/googletest/source/browse/trunk/scripts/test/Makefile)
|
||||
[scripts/test/Makefile](../scripts/test/Makefile)
|
||||
file as an example on how to compile your tests against them.
|
||||
|
||||
# Where to Go from Here #
|
||||
|
||||
Congratulations! You've now learned more advanced Google Test tools and are
|
||||
ready to tackle more complex testing tasks. If you want to dive even deeper, you
|
||||
can read the [Frequently-Asked Questions](V1_6_FAQ.md).
|
||||
can read the [Frequently-Asked Questions](V1_6_FAQ.md).
|
||||
|
||||
Reference in New Issue
Block a user