Commit d7281311 authored by Derek Mauro's avatar Derek Mauro
Browse files

Merge pull request #3189 from ellert:gtest-help-test-GNU/kFreeBSD

PiperOrigin-RevId: 349349288
parents 389cb68b ed1bf868
### Useful Matchers Defined Outside of gMock
#### std::tuple
**deps:** `"//util/tuple:matchers"` <br>
`#include "util/tuple/matchers.h"` <br>
In namespace `util::tuple::testing`:
<a name="table21"></a>
<table border="1" cellspacing="0" cellpadding="1">
<tr>
<td> `Tuple(m0, m1, ..., mn)` </td>
<td> `argument` is a `std::tuple` const reference with `n + 1` elements, where the i-th element matches `std::get*(argument)` </td>
</tr>
<tr>
<td> `FieldPairsAre(m0, m1, ..., mn)` </td>
<td> matches a pair (2-tuple) of tuples where matcher `mi` matches the i-th fields of the tuples; usually for use inside `Pointwise()` or `UnorderedPointwise()` </td>
</tr>
</table>
#### Web
**deps:** `"//webutil/url:test_utils"` <br>
`#include "webutil/url/test_utils.h"`
<a name="table23"></a>
<table border="1" cellspacing="0" cellpadding="1">
<tr>
<td> `webutil_url::testing::HasUrlArg(key)` </td>
<td> `argument` is a URL string that has a query argument whose name is `key`. E.g. `http://foo.com/bar?key=value` </td>
</tr>
<tr>
<td> `webutil_url::testing::HasUrlArg(key, m)` </td>
<td> `argument` is a URL string that has a query argument whose name is `key` and whose value matches `m`. </td>
</tr>
<tr>
<td> `webutil_url::testing::HasUrlPathParam(key)` </td>
<td> `argument` is a URL string that has a path parameter whose name is `key`. E.g. `http://foo.com/bar;key=value` </td>
</tr>
<tr>
<td> `webutil_url::testing::HasUrlPathParam(key, m)` </td>
<td> `argument` is a URL string that has a path parameter whose name is `key` and whose value matches `m`. </td>
</tr>
</table>
**deps:** `"//third_party/jsoncpp:testing"` <br>
`#include "third_party/jsoncpp/testing.h"`
<a name="table24"></a>
<table border="1" cellspacing="0" cellpadding="1">
<tr>
<td> `Json::testing::EqualsJson(json)` </td>
<td> `argument` is a string that represents the same Json value as the `json` string does. </td>
</tr>
</table>
#### Encoding
**deps:** `"//testing/lib/util/coding:varint"` <br>
`#include "testing/lib/util/coding/varint.h"`
<a name="table25"></a>
<table border="1" cellspacing="0" cellpadding="1">
<tr>
<td> `testing_lib_util_coding::EncodesVarint64(n)` </td>
<td> `argument` is a string that represents a Varint encoding of `n`, a `uint64` value. </td>
</tr>
</table>
#### XPath
**deps:** `"//template/prototemplate/testing:xpath_matcher"` <br>
`#include "template/prototemplate/testing/xpath_matcher.h"`
<a name="table26"></a>
<table border="1" cellspacing="0" cellpadding="1">
<tr>
<td> `prototemplate::testing::MatchesXPath(str)` </td>
<td> `argument` is a well-formed HTML/XML string that matches the given [XPath](http://www.w3.org/TR/xpath/#contents) expression. </td>
</tr>
</table>
#### Flume
**deps:** `"//pipeline/flume/contrib:matchers"` <br>
`#include "pipeline/flume/contrib/matchers.h"`
<a name="table27"></a>
<table border="1" cellspacing="0" cellpadding="1">
<tr>
<td> `flume::testing::Kv(key_matcher, value_matcher)` </td>
<td> `argument` is a `KV` where the key matches `key_matcher` and the value matches `value_matcher`. </td>
</tr>
</table>
#### i18n strings
**deps:** `"///i18n/testing/public:expecti18n"` <br>
`#include "google3/i18n/testing/public/expecti18n.h"`
<a name="table28"></a>
<table border="1" cellspacing="0" cellpadding="1">
<tr>
<td> `i18n_testing::I18nEq(utf8)` </td>
<td> `argument` is a `absl::string_view` whose content matches `utf8` allowing for locale data changes.
In case it does not match, the error message contains both a readable version of both strings and the list of
decoded codepoints.</td>
</tr>
</table>
See also the [Wrap External APIs](http://go/d4tg/wrap-external.html) chapter of
the
*[Design for Testability Guide](http://www.corp.google.com/eng/howto/testing/testability_guide/)*.
......@@ -1432,8 +1432,8 @@ given test suite, whether their definitions come before or *after* the
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"
[sample7_unittest.cc]: ../googletest/samples/sample7_unittest.cc "Parameterized Test example"
[sample8_unittest.cc]: ../googletest/samples/sample8_unittest.cc "Parameterized Test example with multiple parameters"
### Creating Value-Parameterized Abstract Tests
......@@ -1583,7 +1583,7 @@ TYPED_TEST(FooTest, HasPropertyA) { ... }
You can see [sample6_unittest.cc] for a complete example.
[sample6_unittest.cc]: ../samples/sample6_unittest.cc "Typed Test example"
[sample6_unittest.cc]: ../googletest/samples/sample6_unittest.cc "Typed Test example"
## Type-Parameterized Tests
......@@ -2026,7 +2026,7 @@ You can do so by adding one line:
Now, sit back and enjoy a completely different output from your tests. For more
details, see [sample9_unittest.cc].
[sample9_unittest.cc]: ../samples/sample9_unittest.cc "Event listener example"
[sample9_unittest.cc]: ../googletest/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
......@@ -2053,7 +2053,7 @@ by the former.
See [sample10_unittest.cc] for an example of a failure-raising listener.
[sample10_unittest.cc]: ../samples/sample10_unittest.cc "Failure-raising listener example"
[sample10_unittest.cc]: ../googletest/samples/sample10_unittest.cc "Failure-raising listener example"
## Running Test Programs: Advanced Options
......
......@@ -281,7 +281,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
[sample5_unittest.cc](../samples/sample5_unittest.cc).
[sample5_unittest.cc](../googletest/samples/sample5_unittest.cc).
## My compiler complains "void value not ignored as it ought to be." What does this mean?
......
......@@ -43,6 +43,7 @@ import gtest_test_utils
IS_LINUX = os.name == 'posix' and os.uname()[0] == 'Linux'
IS_GNUKFREEBSD = os.name == 'posix' and os.uname()[0] == 'GNU/kFreeBSD'
IS_WINDOWS = os.name == 'nt'
PROGRAM_PATH = gtest_test_utils.GetTestExecutablePath('gtest_help_test_')
......@@ -111,7 +112,7 @@ class GTestHelpTest(gtest_test_utils.TestCase):
self.assertEquals(0, exit_code)
self.assert_(HELP_REGEX.search(output), output)
if IS_LINUX:
if IS_LINUX or IS_GNUKFREEBSD:
self.assert_(STREAM_RESULT_TO_FLAG in output, output)
else:
self.assert_(STREAM_RESULT_TO_FLAG not in output, output)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment