Commit Graph

180 Commits

Author SHA1 Message Date
Baruch
173dd7c7d6
Merge branch 'google:main' into custom_type_combine 2022-09-25 13:35:27 +03:00
John Hinnegan
05cc575c65
Update link to Bazel installation guide
The Bazel docs have moved!
2022-09-18 10:54:36 -04:00
Baruch
56070d8903
Merge branch 'google:main' into custom_type_combine 2022-09-14 21:46:21 +03:00
Abseil Team
c29315dda4 Use UnorderedElementsAre in example about using matchers with maps
PiperOrigin-RevId: 473353707
Change-Id: Ief5bdbd2b8e28bac8f47be9aaeac4bb93875a793
2022-09-09 15:14:57 -07:00
Baruch
dd969ed5fe
Merge branch 'google:main' into custom_type_combine 2022-08-25 10:55:49 +03:00
Copybara-Service
6045bf2ade Merge pull request #3918 from assafpr:master2main
PiperOrigin-RevId: 464586117
Change-Id: Icda62f13b962f7408bb5698ae2b627391257d152
2022-08-01 11:47:51 -07:00
Baruch Burstein
3280a930bf Custom type with Combine(). Fix for #3781 2022-07-31 22:50:04 +03:00
Copybara-Service
78aa2ba440 Merge pull request #3787 from codeinred:fix-quickstart
PiperOrigin-RevId: 460272863
Change-Id: I139e31faca4dab6f697e0cd1b3491f791fda5f8a
2022-07-11 12:23:26 -07:00
Derek Mauro
96f51426e4 Remove support for C++11
v1.12.x is the last branch to support C++11
Future releases will require at least C++14

PiperOrigin-RevId: 458250106
Change-Id: Ibee2248649ff3c13daaa179135887848bf730f3f
2022-06-30 09:53:51 -07:00
assafpr
df4b8edee0
Update advanced.md
master branch changed to main branch in links
2022-06-27 09:48:05 +03:00
assafpr
b59ae848d1
Update faq.md 2022-06-22 16:12:54 +03:00
assafpr
1b772a9bc4
documentation, change mater branch to main 2022-06-22 14:36:10 +03:00
assafpr
358a3f6e3e
documentation, change mater branch to main 2022-06-22 14:31:03 +03:00
Abseil Team
8b521aa43a gmock_cook_book.md: Delete superfluous statement from 2014.
PiperOrigin-RevId: 454677195
Change-Id: I7a1419e22d617db41a5c310bc6f6158ba4cec1ab
2022-06-13 12:51:26 -07:00
Abseil Team
b1f84bf176 Update googletest docs to indicate that RE2 is now used for regexp implementation when building with Bazel and using Abseil.
PiperOrigin-RevId: 454012698
Change-Id: I3a9df78368ffe3cb7cf3d315001125b97b1aebbe
2022-06-09 14:25:17 -07:00
elixir
6cd3823783 Clarify that this-> is needed to access members of type-parameterized tests.
PiperOrigin-RevId: 451439108
Change-Id: I8929df21d53cbe6c42e38653e1bb0cac72fc36f9
2022-05-27 11:32:10 -07:00
Abseil Team
cf942a5d69 Update GoogleTest documentation's spelling of "GoogleTest".
PiperOrigin-RevId: 451067898
Change-Id: I658ab92c4ea616736f0170ac4d1548bb15a944e2
2022-05-25 19:18:09 -07:00
Abseil Team
7041051488 Clarify the pitfalls of EXPECT_THAT and highlight it's best practices
PiperOrigin-RevId: 450721917
Change-Id: I34d63a65b7158975abd46a9a14cded75439e7e7f
2022-05-24 10:57:53 -07:00
Aaron Jacobs
6386897feb gmock-actions: make OnceAction public.
So that it can be referenced in conversion operators for actions that need to
know the concrete return type.

PiperOrigin-RevId: 447889344
Change-Id: I643d3298bc8effd08741282a956c221f9d67d378
2022-05-10 20:08:51 -07:00
Abseil Team
8ded48c37b Rewrite "Testing a Certain Property of an Object" as "Defining a Custom Matcher Class", and fix the code examples.
PiperOrigin-RevId: 445252626
Change-Id: I9f038cb669d3da6743606343c2341fc59725d722
2022-04-28 14:41:49 -07:00
Abseil Team
a1cc8c5519 Add support for move-only and &&-qualified actions in WillOnce.
This provides a type-safe way for an action to express that it wants to be
called only once, or to capture move-only objects. It is a generalization of
the type system-evading hack in ByMove, with the improvement that it works for
_any_ action (including user-defined ones), and correctly expresses that the
action can only be used with WillOnce. I'll make existing actions benefit in a
future commit.

PiperOrigin-RevId: 440496139
Change-Id: I4145d191cca5655995ef41360bb126c123cb41d3
2022-04-08 18:40:07 -07:00
Abseil Team
c9044ba3dd Trying to make it more clear: this is probably not about mock classes, but about mocked classes
PiperOrigin-RevId: 439427291
Change-Id: I3cac035e732fb3fe4f9c314657932a55269e0416
2022-04-04 15:30:50 -07:00
Alecto Irene Perez
7da4a4114a
Fix quickstart-cmake documentation
Signed-off-by: Alecto Irene Perez <perez.cs@pm.me>
2022-03-26 21:52:05 -06:00
Abseil Team
1754febbaa Clarify public access on gmock examples.
PiperOrigin-RevId: 436268062
Change-Id: I3161b36121f78acf920d66fe121b2f1d5e5707b9
2022-03-21 11:57:05 -07:00
Copybara-Service
8a422b8398 Merge pull request #3774 from sobczyk:main
PiperOrigin-RevId: 434738675
Change-Id: I7c8de4004bac6b750674d19e3e79c0695a42652e
2022-03-15 06:55:30 -07:00
Szymon Sobik
132059ba0c Adjust documentation regarding xml and json source file location otput. 2022-03-08 01:16:36 +01:00
Abseil Team
0e402173c9 Add a 3-arg overload for ResultOf() matcher that takes a description string for better error messages.
PiperOrigin-RevId: 427598749
Change-Id: I8c7a5d7b2dde017641534f1c7eed8dd56c33e845
2022-02-09 16:20:06 -08:00
Copybara-Service
7eae8de0da Merge pull request #3723 from ramkumar-kr:patch-1
PiperOrigin-RevId: 423920083
Change-Id: I5e172813387f841d5a6c56eea155b876a465d208
2022-01-24 15:04:20 -08:00
Dino Radakovic
4e9fe30884 Fix reference to source file in gmock FAQ
PiperOrigin-RevId: 421915817
Change-Id: I22800e8943f9eb050304c521701d4040b1b7a914
2022-01-14 14:40:35 -08:00
Abseil Team
2d07f12b60 Fix run-on sentence
dispatch. It will use the definition from the class the constructor of which

PiperOrigin-RevId: 421291241
Change-Id: If81e3d6d3774edfbbb4baaec8a3cd96566b3b09c
2022-01-12 07:19:51 -08:00
Ram Kumar K R
0256210376
Update example to reflect the tests below 2022-01-04 13:36:22 -08:00
Abseil Team
d81ae2f0bf Clarify "package" means "Bazel package", and promote testonly=True rather than testing sub-directory.
PiperOrigin-RevId: 417945818
Change-Id: I8686ee0414fb80269528677f291877a231d1c991
2021-12-22 22:50:04 -08:00
Copybara-Service
9a32aee22d Merge pull request #3684 from ludgerpaehler:patch-1
PiperOrigin-RevId: 417474317
Change-Id: I4c84f59ba272a6bec3f992f7afae36e1c5617fad
2021-12-20 13:59:26 -08:00
Abseil Team
1b2606425c Fix typo in GoogleMock Cookbook.
PiperOrigin-RevId: 413674665
Change-Id: I466f87348390f42434a70f183efdf0557be9dddd
2021-12-02 07:44:32 -08:00
Ludger Paehler
b4d4e6e348
Fix typo in the queue test. 2021-11-25 16:53:19 +01:00
Derek Mauro
4848324c5f Update URLs in Bazel Quickstart
PiperOrigin-RevId: 410041507
Change-Id: I6ca514249a54e7fbe6d8fbf4f07317a39af40929
2021-11-15 11:51:27 -08:00
Abseil Team
9ca071b6e5 Googletest export
Revert CL that updated example for SetUpTestSuite/TearDownTestSuite to initialize static member variables inline.

It seems that non-const static data members for some reason still must be initialized out-of-line.

PiperOrigin-RevId: 408913846
2021-11-10 17:21:19 -05:00
Abseil Team
79efd968bf Googletest export
Update example for SetUpTestSuite/TearDownTestSuite to use modern C++ standards.

Currently it is using an outdated C++ construct (defining static member variables separately from the declaration).

PiperOrigin-RevId: 408663014
2021-11-09 16:31:33 -05:00
Abseil Team
aa486f165e Googletest export
Add missing InitGoogleTest line in "Registering tests" example code

Copying the original code gives the following error message
"""
IMPORTANT NOTICE - DO NOT IGNORE:
This test program did NOT call testing::InitGoogleTest() before calling RUN_ALL_TESTS(). This is INVALID. Soon Google Test will start to enforce the valid usage. Please fix it ASAP, or IT WILL START TO FAIL.
"""

PiperOrigin-RevId: 408385714
2021-11-09 10:24:14 -05:00
Abseil Team
d4e084a1cc Googletest export
Style only change. Make use of advanced testing functions `FloatLE` and `DoubleLE` consistent.

PiperOrigin-RevId: 407660542
2021-11-09 10:23:55 -05:00
Abseil Team
7cf37a18d1 Googletest export
Add docs section on test sharding

Fixes #3622

PiperOrigin-RevId: 405712812
2021-11-03 13:45:51 -04:00
Abseil Team
178cfacb24 Googletest export
add missing using ::testing::DoAll when DoAll used in example

PiperOrigin-RevId: 402416497
2021-10-13 12:28:13 -04:00
Christian Clauss
ee1be03b43 Fix remaining typos discovered by codespell 2021-09-24 08:09:32 +02:00
dinord
09074c1571 Merge pull request #3573 from cclauss:patch-1
PiperOrigin-RevId: 397998384
2021-09-23 23:31:33 +00:00
Vertexwahn
277e0a0168 Remove bazelbuild/rules_cc dependency 2021-09-17 10:04:26 +02:00
Christian Clauss
5b43f14be9
Fix typos discovered by codespell 2021-09-16 21:44:29 +02:00
Abseil Team
6bfab0becc Googletest export
Add a caveat section for potential memory leak with derived classes using `SetUpTestSuite`.

PiperOrigin-RevId: 396986728
2021-09-16 13:00:01 -04:00
CJ Johnson
955c7f837e Merge pull request #3531 from theidexisted:patch-1
PiperOrigin-RevId: 392720416
2021-08-26 14:30:09 -04:00
Abseil Team
2f80c2ba71 Googletest export
Standardize access to GoogleTest flags on GTEST_FLAG_GET/GTEST_FLAG_SET

Custom implementations can decide how access to flags is performed depending on the implementation of flags being used.

PiperOrigin-RevId: 391971115
2021-08-20 15:08:40 -04:00
theidexisted
088e6ed9a8
Simplify example code with c++11 2021-08-19 16:35:14 +08:00
Berke
f91723cb90 typo fix gmock_cook_book 2021-08-05 12:09:54 +03:00
Abseil Team
5b40153003 Googletest export
Format documentation

PiperOrigin-RevId: 388592443
2021-08-04 13:54:45 -04:00
Abseil Team
652ec31f9f Googletest export
Introduce a new matcher for unescaping Base-64 strings to gmock.

PiperOrigin-RevId: 388471904
2021-08-04 13:54:39 -04:00
Abseil Team
c22ce88775 Googletest export
Standardize access to GoogleTest flags on GTEST_FLAG_GET/GTEST_FLAG_SET

Custom implementations can decide how access to flags is performed depending on the implementation of flags being used.

PiperOrigin-RevId: 388181424
2021-08-04 13:54:33 -04:00
Abseil Team
29d2540622 Googletest export
Proliferation of inclusive language.

PiperOrigin-RevId: 387535677
2021-08-04 13:54:27 -04:00
Abseil Team
8d51ffdfab Googletest export
Remove unneeded using ::std::get;

PiperOrigin-RevId: 383688097
2021-07-09 09:28:13 -04:00
Abseil Team
8306020a3e Googletest export
Add `Conditional` wrapper to gtest

This follows an initial proposal for an 'EqIff` matcher. `Conditional` was considered more precise as an EqIff() matcher may suffer from `Iff` not being universally understood.

PiperOrigin-RevId: 383407665
2021-07-07 14:34:28 -04:00
Abseil Team
4ec4cd23f4 Googletest export
Implement 'Contains(e).Times(n)' matcher modifier which allows to test for arbitrary occurrences including absence with Times(0).

PiperOrigin-RevId: 382210276
2021-06-30 13:33:57 -04:00
dinord
355d57d90d Merge pull request #3443 from hyukmyeong:typo
PiperOrigin-RevId: 380705469
2021-06-22 13:30:42 +00:00
Hyuk Myeong
1745a405eb fix typos 2021-06-13 19:53:04 +09:00
Abseil Team
b050d6c4b0 Googletest export
Internal change

PiperOrigin-RevId: 378672633
2021-06-11 10:42:17 -07:00
Abseil Team
aa533abfd4 Googletest export
Add CNAME file for custom domain

PiperOrigin-RevId: 378384525
2021-06-09 08:45:19 -04:00
Abseil Team
94bb786f0e Googletest export
Update broken link

PiperOrigin-RevId: 378272186
2021-06-09 08:45:11 -04:00
Abseil Team
5bcd8e3bb9 Googletest export
Add CNAME file for custom domain

PiperOrigin-RevId: 377604116
2021-06-08 18:36:38 -04:00
Abseil Team
53495a2a7d Googletest export
Create new Testing API reference

PiperOrigin-RevId: 376969148
2021-06-02 17:55:09 -04:00
Abseil Team
5f6a14c846 Googletest export
Create new Mocking Reference

PiperOrigin-RevId: 376951575
2021-06-02 17:55:01 -04:00
Abseil Team
2bd3481666 Googletest export
Fix broken link

PiperOrigin-RevId: 375995669
2021-06-02 17:54:53 -04:00
Abseil Team
d5d6ff940b Googletest export
Create Assertions Reference

PiperOrigin-RevId: 375824718
2021-06-02 17:54:45 -04:00
Abseil Team
a3460d1aee Googletest export
Add Google Analytics & footer

PiperOrigin-RevId: 375539689
2021-05-25 13:34:39 -04:00
Abseil Team
9741c42200 Googletest export
Add missing link

PiperOrigin-RevId: 374774097
2021-05-21 13:58:11 -07:00
Abseil Team
f8519738b0 Googletest export
Remove inapplicable example

PiperOrigin-RevId: 374762004
2021-05-21 13:58:03 -07:00
Abseil Team
aa9b44a186 Googletest export
Fix a comment in a code snippet.

PiperOrigin-RevId: 374504337
2021-05-19 13:10:13 -07:00
Abseil Team
eb6e9273dc Googletest export
Docs: Clarify that expectations must be set before mocks are exercised
PiperOrigin-RevId: 373644072
2021-05-18 13:48:14 -07:00
Abseil Team
d69a112956 Googletest export
Fix code in googletest parameterized name example.

PiperOrigin-RevId: 373262838
2021-05-13 15:08:49 -04:00
Abseil Team
97f96cbc8a Googletest export
Clean up heading levels and mention `::testing` namespace in Matchers Reference

PiperOrigin-RevId: 373242122
2021-05-13 15:08:41 -04:00
Abseil Team
5cfc63ddd5 Googletest export
Fix links in Matchers Reference

PiperOrigin-RevId: 372436732
2021-05-13 15:08:33 -04:00
Abseil Team
7e5a3a574e Googletest export
Move actions reference into independent document

PiperOrigin-RevId: 371828549
2021-05-13 15:08:09 -04:00
Abseil Team
065a0c8140 Googletest export
Clean up links to Matchers Reference

PiperOrigin-RevId: 370821457
2021-04-29 10:40:37 -04:00
Abseil Team
680a5aa337 Googletest export
Move matchers reference from cheat sheet into its own document

PiperOrigin-RevId: 370749693
2021-04-29 10:40:29 -04:00
Abseil Team
719fd2d36f Googletest export
Update the `DescribeTo` signature in the code example at the Writing New Polymorphic Matchers section in gmock_cook_book.

`os` should be a pointer to be consistent with the implementation, which dereference it as `*os`.

PiperOrigin-RevId: 370693387
2021-04-29 10:40:21 -04:00
Abseil Team
6e8a8623fb Googletest export
internal change

PiperOrigin-RevId: 370503556
2021-04-29 10:40:14 -04:00
Derek Mauro
11da093e04 Merge pull request #3174 from sebkraemer:issue-15644
PiperOrigin-RevId: 369696657
2021-04-26 14:07:16 -04:00
Sebastian Krämer
124e87a303 Apply missing suggestions from code review for GTEST_SKIP
Co-authored-by: Eric Schmidt <shibumi@google.com>
2021-04-15 22:28:41 +02:00
Sebastian Krämer
1de97fd1c3 Apply suggestions from code review for GTEST_SKIP documentation
Extended example and some rewording by @ericschmidtatwork, thank you.

Co-authored-by: Eric Schmidt <shibumi@google.com>
2021-04-15 22:28:41 +02:00
Sebastian Krämer
c4ed56eb75 Add subsection for GTEST_SKIP documentation
A subsection "Skipping test execution" was added to document GTEST_SKIP
and where it can be used.

relates issue #1544
2021-04-15 22:28:41 +02:00
Abseil Team
486a4a6be5 Googletest export
Adds a warning about anonymous namespaces in relation to private testing.

PiperOrigin-RevId: 367730808
2021-04-12 20:14:27 -07:00
Abseil Team
6a5eb80749 Googletest export
Update the example for Notify to use a lambda.
It is much less boilerplate and easier to remember.

PiperOrigin-RevId: 367284222
2021-04-07 23:39:39 -07:00
Abseil Team
8a65bc0303 Googletest export
Docs: Add examples for `FieldsAre` matcher
PiperOrigin-RevId: 367263024
2021-04-07 23:39:32 -07:00
Abseil Team
54689b1935 Googletest export
Docs: Clarifying matcher in `Pointwise` and `UnorderedPointwise`
PiperOrigin-RevId: 367059198
2021-04-07 23:39:10 -07:00
Abseil Team
c0dd0817cf Googletest export
Clarify explanation of mocking free functions

PiperOrigin-RevId: 364943561
2021-03-25 13:43:43 -07:00
Abseil Team
66836f0a90 Googletest export
Minor formatting updates

PiperOrigin-RevId: 364935205
2021-03-25 13:43:36 -07:00
Abseil Team
6dabd081e9 Googletest export
Code style cleanup in docs

PiperOrigin-RevId: 364907938
2021-03-25 13:43:28 -07:00
Abseil Team
5142ccd2d4 Googletest export
Update advanced.md

PiperOrigin-RevId: 364839958
2021-03-25 13:43:21 -07:00
Abseil Team
4595745f72 Googletest export
Update explanation of `EXPECT_EQ(NULL, ptr)` in FAQ

PiperOrigin-RevId: 364626422
2021-03-25 13:43:09 -07:00
Abseil Team
53cc7cd1ec Googletest export
Code style cleanups in cheat sheet

PiperOrigin-RevId: 364465553
2021-03-25 13:43:01 -07:00
Abseil Team
d4e3b8cedf Googletest export
Add CMake quickstart

PiperOrigin-RevId: 364437779
2021-03-25 13:42:53 -07:00
Abseil Team
32ad3c8c36 Googletest export
Add Bazel quickstart

PiperOrigin-RevId: 364419540
2021-03-25 13:42:45 -07:00
Abseil Team
e8512bc38c Googletest export
Add missing period and use "that" in restrictive clause.

PiperOrigin-RevId: 361941663
2021-03-10 08:49:41 -08:00
Abseil Team
32983d211b Googletest export
Fix enum names in a value-parameterized test example.

PiperOrigin-RevId: 360559723
2021-03-04 12:07:32 -05:00
Abseil Team
de41f8223c Googletest export
Add Supported Platforms page to docs

PiperOrigin-RevId: 360307129
2021-03-04 12:07:25 -05:00