Commit Graph

3705 Commits

Author SHA1 Message Date
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
Andy Soffer
5f97ce4c70 Merge pull request #3465 from mbinna:bazel_qnx
PiperOrigin-RevId: 382189077
2021-06-30 13:33:48 -04:00
Andy Soffer
b89480e02c Merge pull request #3457 from alexkaratarakis:wcovered_switch_default
PiperOrigin-RevId: 382188112
2021-06-30 13:33:38 -04:00
Abseil Team
22e6055c75 Googletest export
Make multiple attempts to verify GetThreadCount()

Testing GetThreadCount() is inheritently noisy, as other threads can be started
or destroyed between two calls to GetThreadCount(). This is especially true
under certain analyzer configurations, such as TSAN.

PiperOrigin-RevId: 381951799
2021-06-30 13:33:29 -04:00
Abseil Team
255323cf09 Googletest export
Deleting deprecated file.

PiperOrigin-RevId: 381938709
2021-06-30 13:33:20 -04:00
Manuel Binna
4281d2149c Don't link pthread on QNX
On QNX, pthread is part of libc [1]. There's no separate pthread library
to link.

[1] https://www.qnx.com/developers/docs/7.1/index.html#com.qnx.doc.neutrino.lib_ref/topic/p/pthread_create.html
2021-06-26 13:26:20 +02:00
Alex Karatarakis
1008850435 Fix EXPECT_DEATH() and ASSERT_DEATH() triggering -Wcovered-switch-default
EXPECT_DEATH() and ASSERT_DEATH() have a switch case where every
possible case is covered. This makes the default case unnecessary
and triggers -Wcovered-switch-default.
Due to these being macros, the lines are expanded in user code and
are thus subject to warnings of the target codebase.

Fixes #3456
2021-06-23 14:57:22 -07:00
dinord
355d57d90d Merge pull request #3443 from hyukmyeong:typo
PiperOrigin-RevId: 380705469
2021-06-22 13:30:42 +00:00
dmauro
f7902802f1 Googletest export
Remove -Werror from the CMake compiler flags

We should not force warnings as errors on users.
Sometimes compilers introduce new warnings which
will break builds.

Instead, we manually turn this flag on in our continuous integration
scripts so we can catch these errors, but not force them on our users.

Fixes #3447

PiperOrigin-RevId: 380241852
2021-06-22 13:30:21 +00:00
CJ Johnson
7153098229 Merge pull request #3429 from 1KoT1:master
PiperOrigin-RevId: 379625931
2021-06-17 12:52:27 -04:00
CJ Johnson
22a2e019c4 Merge pull request #3200 from ellert:port-to-GNU/Hurd
PiperOrigin-RevId: 379383941
2021-06-17 12:52:18 -04:00
CJ Johnson
996328bb8e Merge pull request #3183 from georgthegreat:patch-1
PiperOrigin-RevId: 378915968
2021-06-17 12:52:09 -04:00
Vasilii Pochkaenko
5ef9f63a72 feat: make a matcher ElementsAreArray applicable for std ranges 2021-06-15 16:42:40 +07:00
Hyuk Myeong
1745a405eb fix typos 2021-06-13 19:53:04 +09:00
Abseil Team
e2239ee604 Googletest export
Release GoogleTest 1.11.0

PiperOrigin-RevId: 378861756
2021-06-11 10:42:26 -07:00
Abseil Team
b050d6c4b0 Googletest export
Internal change

PiperOrigin-RevId: 378672633
2021-06-11 10:42:17 -07:00
Abseil Team
3c4b3a039e Googletest export
Add feature request issue template

PiperOrigin-RevId: 378552571
2021-06-11 10:42:07 -07:00
dmauro
9f7da89a43 Googletest export
Delete Travis config file

PiperOrigin-RevId: 378483262
2021-06-11 10:41:58 -07:00
Abseil Team
c5be3930f5 Googletest export
cleanup: fix spurious MSAN warnings with Clang 12
PiperOrigin-RevId: 378430614
2021-06-11 10:41:50 -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
Derek Mauro
91e1bd6bfb Merge pull request #3421 from florin-crisan:bugfix/3420-dll-link-failure
PiperOrigin-RevId: 377367006
2021-06-08 18:36:29 -04:00
dmauro
9d698f6905 Googletest export
Fix MSVC warning C4275: non dll-interface class
'testing::MatcherDescriberInterface' used as base for dll-interface
class 'testing::internal::MatcherBase<std::string>'

Fixes #3415

PiperOrigin-RevId: 377352684
2021-06-08 18:36:20 -04:00
Derek Mauro
4feb6c77de Merge pull request #3393 from JC3:patch-1
PiperOrigin-RevId: 377289133
2021-06-08 18:36:11 -04:00
Florin Crișan
26a1569c72 #3420 Declare MarkAsIgnored as a DLL export
This was causing the following linker error on Microsoft Visual C++ when compiling as a DLL:

```
googletest-param-test-test.cc.obj : error LNK2019: unresolved external symbol "public: __cdecl testing::internal::MarkAsIgnored::MarkAsIgnored(char const *)" (??0MarkAsIgnored@internal@testing@@QEAA@PEBD@Z) referenced in function "void __cdecl works_here::`dynamic initializer for 'gtest_allow_ignore_NotInstantiatedTest''(void)" (??__Egtest_allow_ignore_NotInstantiatedTest@works_here@@YAXXZ)
```
2021-06-03 09:12:53 +03:00
Florin Crișan
e1cc005f4c #3420 Properly declare all overloads of testing::internal::PrintTo as DLL exports
This was causing the following linker error on Microsoft Visual C++ when compiling as a DLL:

```
googletest-printers-test.cc.obj : error LNK2019: unresolved external symbol "void __cdecl testing::internal::PrintTo(char16_t const *,class std::basic_ostream<char,struct std::char_traits<char> > *)" (?PrintTo@internal@testing@@YAXPEB_SPEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z) referenced in function "public: static void __cdecl testing::internal::UniversalPrinter<char16_t const *>::Print(char16_t const * const &,class std::basic_ostream<char,struct std::char_traits<char> > *)" (?Print@?$UniversalPrinter@PEB_S@internal@testing@@SAXAEBQEB_SPEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z)
googletest-printers-test.cc.obj : error LNK2019: unresolved external symbol "void __cdecl testing::internal::PrintTo(char32_t const *,class std::basic_ostream<char,struct std::char_traits<char> > *)" (?PrintTo@internal@testing@@YAXPEB_UPEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z) referenced in function "public: static void __cdecl testing::internal::UniversalPrinter<char32_t const *>::Print(char32_t const * const &,class std::basic_ostream<char,struct std::char_traits<char> > *)" (?Print@?$UniversalPrinter@PEB_U@internal@testing@@SAXAEBQEB_UPEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z)
```
2021-06-03 09:12:53 +03: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
dmauro
8ceecc27c7 Googletest export
Updates Linux docker image to use Bazel 4.1.0 and GCC 11.1
Updates Bazel dependencies
Removes the last usage of the deprecated and removed Python2

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

PiperOrigin-RevId: 375539689
2021-05-25 13:34:39 -04:00
Abseil Team
c0777e6565 Googletest export
Remove the dependency on Objective C++ in iOS builds.

252ce9c52d introduced the use of
NSTemporaryDirectory() on iOS, which requires Core Foundation, and
Objective C++.

This CL replaces NSTemporaryDirectory() with an equivalent solution
(according to Apple's documentation at [1]) available to C/C++ code.
Avoiding Objective C++ and Core Foundation makes it easier to integrate
googletest in projects that can't use the supplied Bazel build files.

[1] https://developer.apple.com/library/archive/documentation/Security/Conceptual/SecureCodingGuide/Articles/RaceConditions.html#//apple_ref/doc/uid/TP40002585-SW10

PiperOrigin-RevId: 375474990
2021-05-25 13:34:32 -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
662fe38e44 Googletest export
Support templating MockFunction over function objects besides std::function.

PiperOrigin-RevId: 373586967
2021-05-13 15:08:57 -04: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
durandal
df157130cb Googletest export
Add a note documenting that death test macros accept arbitrary gmock matchers against child-process stderr, not just regexes.

PiperOrigin-RevId: 372365998
2021-05-13 15:08:25 -04:00
Abseil Team
f381758e29 Googletest export
This callsite was previously updated to use ZX_INFO_PROCESS_V2 as a part of a soft transition. It is now time to revert back to `ZX_INFO_PROCESS` (which is now an alias of the former). See fxbug.dev/30751 for more details.

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

PiperOrigin-RevId: 371828549
2021-05-13 15:08:09 -04:00
Jason C
200c7ea1fb
isalnum -> IsAlNum for correct handling of signed chars
I spotted this in 7dd7a053a9 and figured I'd fix it here, too. 

If this is not the right thing to do, please lmk so I can undo it in assimp, too. Seems right, though. It's the only spot in gtest where a ctype call was made directly.
2021-05-04 18:04:13 -04:00
Abseil Team
f5e592d8ee Googletest export
Revert ac3c2a8d04 -- it seems to break some gcc users (#3384)

PiperOrigin-RevId: 370834917
2021-04-29 10:40:44 -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