Tom Hughes
783d00fd19
Use '=default' to define trivial constructor/destructors
...
https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-equals-default.html
PiperOrigin-RevId: 526079054
Change-Id: Ia4db21e3e5f58b90de05d52fd94b291ed06d785d
2023-04-21 10:41:25 -07:00
Derek Mauro
3656c2713e
Fix redundant redeclaration warning
...
Fixes #4200
PiperOrigin-RevId: 520017094
Change-Id: Id707a1c0489edde083771ccd412d7035612474dc
2023-03-28 07:03:07 -07:00
Abseil Team
1a727c27aa
Internal Code Change
...
PiperOrigin-RevId: 514678702
Change-Id: I5b0089d905152ccb85022be395ed340e42586234
2023-03-07 03:06:06 -08:00
Martijn Vels
ee33b34bec
Fix GTEST_HAS_ABSL define check for [-Werror=undef] compilations
...
PiperOrigin-RevId: 507788664
Change-Id: Ib8cfbf3102a38e210fdae8a548fd84f0723ccc10
2023-02-07 08:28:15 -08:00
Tom Hughes
4fb7039fda
Use GTEST_DISABLE_MSC_WARNINGS macros to disable warnings
...
Prior to this change we had a mixture of pragmas and
GTEST_DISABLE_MSC_WARNINGS; this change consolidates all instances
to use the macros.
PiperOrigin-RevId: 505786926
Change-Id: I2be8f6304387393995081af42ed32c2ad1bba5a7
2023-01-30 13:45:46 -08:00
Abseil Team
a16bfcfda1
Disables -Wunused-member-function
and -Wused-but-marked-unused
that trigger via MOCK_METHOD()
and EXPECT_THAT()
macros.
...
Fixes : #4052 , #4055
PiperOrigin-RevId: 491647393
Change-Id: I8e2ad838156fa8c7e9dccd1740af797e694992b6
2022-11-29 08:44:15 -08:00
Abseil Team
d29b143bda
Workaround for Visual C++ error C2039 with std::tuple_element_t.
...
Fixes #3931
PiperOrigin-RevId: 480659507
Change-Id: I6fabef63b1285189a06375227273d9de2456e37a
2022-10-12 10:31:07 -07:00
Abseil Team
0f6885405c
Remove obsolete MSVC warning pragmas for Invalid<T>()
...
Remove the MSVC pragmas for disabling warning C4717 (infinite recursion) for
Invalid<T>() because that warning has been fixed in cl/441474979.
PiperOrigin-RevId: 473012585
Change-Id: I5f1bf88379bd4f2bf005e029c04766ac4caadd84
2022-09-08 09:42:31 -07:00
Abseil Team
733f875989
Replace infinite recursion call (intentionally invoking undefined behavior to indicate unreachability) with explicit unreachability marker.
...
PiperOrigin-RevId: 441474979
Change-Id: I1fcbb437026631212fec954c663482bb7e1cf819
2022-04-13 07:28:00 -07:00
Derek Mauro
25dcdc7e8b
Use the Abseil flags library when Abseil is present
...
When built with `--define=absl=1` under Bazel, GoogleTest
flags use ABSL_FLAG instead of GoogleTest's own implementation.
There are some minor behavior differences in this mode.
The most notable difference is that unrecognized flags result
in a flag parsing error, and are not returned to the user though
a modified argc/argv, unless they appear after the positional
argument delimiter ("--").
For example, to pass a non-Abseil flag, you would have to do
./mytest --gtest_color=false -- --myflag=myvalue
The documentation at https://abseil.io/docs/cpp/guides/flags
may be helpful in understanding the behavior.
There are some other minor differences. For example,
passing --help results in the program returning 1 instead of 0.
https://github.com/google/googletest/issues/3646
PiperOrigin-RevId: 439312700
Change-Id: Id696a25f50f24a5b1785c45ca8fa59794f86fd5c
2022-04-04 07:39:03 -07:00
Abseil Team
b007c54f29
Running clang-format over all of GoogleTest
...
A few tests are examining code locations and looking af the resulting line
numbers to verify that GoogleTest shows those to users correctly. Some of those
locations change when clang-format is run. For those locations, I've wrapped
portions in:
// clang-format off
...
// clang-format on
There may be other locations that are currently not tickled by running
clang-format.
PiperOrigin-RevId: 434844712
Change-Id: I3a9f0a6f39eff741c576b6de389bef9b1d11139d
2022-03-15 13:42:11 -07:00
Abseil Team
100f6fbf5f
Consistently apply IWYU pragmas across googletest and googlemock headers
...
PiperOrigin-RevId: 422559250
Change-Id: I9f630f2186724950e5e9fbd7093d5264e8bf0a71
2022-01-18 08:11:11 -08:00
Abseil Team
6b74da4757
Include the param names in the generated description of the MATCHER_P matchers.
...
PiperOrigin-RevId: 418497526
Change-Id: Ie53c3c0810c10a32cbcb941e3ca1ee8fb1ddd9f9
2021-12-27 08:05:24 -08:00
Abseil Team
d61d4d8e64
Support std::reference_wapper as a smart pointer type in gmock
...
PiperOrigin-RevId: 413963503
Change-Id: I33440780bf087698f4e4325399227405885430b3
2021-12-03 10:14:13 -08:00
Abseil Team
de34ef4e4c
Internal change
...
PiperOrigin-RevId: 397651677
2021-09-23 23:31:03 +00:00
Abseil Team
6202251f09
Googletest export
...
Introduce GMOCK_FLAG_GET and GMOCK_FLAG_SET macros.
PiperOrigin-RevId: 396649214
2021-09-15 13:33:42 -04:00
Derek Mauro
0134d73a49
Merge pull request #3504 from duianto:patch-1
...
PiperOrigin-RevId: 390486428
2021-08-13 12:42:35 -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
duianto
97ff0fec11
Typo, double "the"
2021-07-29 20:32:48 +02:00
Abseil Team
96f4ce02a3
Googletest export
...
Delete GOOGLETEST_CM.* tags from C++ code.
PiperOrigin-RevId: 386268534
2021-07-22 14:54:03 -04:00
Abseil Team
98ca420679
Googletest export
...
Internal change
PiperOrigin-RevId: 362040448
2021-03-16 09:50:49 -04:00
Abseil Team
0a3a3a845e
Googletest export
...
Make include guards conform with https://google.github.io/styleguide/cppguide.html#The__define_Guard , attempt #2
PiperOrigin-RevId: 357056902
2021-02-18 13:26:24 -05:00
Abseil Team
d4144d4ee2
Googletest export
...
Revert include guard fix
PiperOrigin-RevId: 356588893
2021-02-11 12:49:24 -05:00
Abseil Team
36b7792047
Googletest export
...
Make include guards conform with https://google.github.io/styleguide/cppguide.html#The__define_Guard
PiperOrigin-RevId: 355882793
2021-02-11 12:48:43 -05:00
Abseil Team
d114398800
Googletest export
...
Remove uses of GTEST_HAS_TYPED_TEST_P and GTEST_HAS_TYPED_TEST.
PiperOrigin-RevId: 353935996
2021-02-05 10:39:30 -08:00
Abseil Team
997c36c188
Googletest export
...
Stop using pump for generating internal/custom/gmock-generated-actions.h
PiperOrigin-RevId: 352660735
2021-01-26 15:42:55 -05:00
Abseil Team
2c06d021d6
Googletest export
...
Internal change
PiperOrigin-RevId: 352607401
2021-01-26 15:42:30 -05:00
Abseil Team
14098f2015
Googletest export
...
Merge CONTRIBUTORS, delete LICENSEs in googletest/ and googlemock/
PiperOrigin-RevId: 352558822
2021-01-26 15:42:13 -05:00
Abseil Team
a02a591605
Googletest export
...
Add a `Pointer` matcher as an analog to `Pointee`.
Similar to `Pointee`, `Pointer` works with either raw or smart pointers and
allows creating a matcher like Pointer(Eq(foo)) for smart pointers.
PiperOrigin-RevId: 346164768
2020-12-07 18:04:12 -05:00
Abseil Team
a09ea700d3
Googletest export
...
Fix `-Wgnu-zero-variadic-macro-arguments` in GMock
Passing zero arguments to the variadic part of a macro is a GNU
extension and triggers warnings when build projects using GMock with
`-pedantic`.
- Fix uses of `GMOCK_PP_INTERNAL_16TH` to always receive at least 17
arguments. (this was triggered when `GMOCK_PP_NARG` or `GMOCK_PP_HAS_COMMA`
were used with an argument containing no commas).
- Fix `GMOCK_PP_HEAD` to append a dummy unused argument so that
`GMOCK_PP_INTERNAL_HEAD` always has two arguments.
PiperOrigin-RevId: 310414611
2020-05-07 16:15:58 -04:00
Abseil Team
955552518b
Googletest export
...
Rewrite ReturnNew action without using pump.
PiperOrigin-RevId: 308219616
2020-05-01 17:11:34 -04:00
Abseil Team
41b5f149ab
Googletest export
...
Get rid of gmock-generated-matchers.h and gmock-generated-matchers.h.pump.
Stop using pump for MATCHER* macroses generation.
PiperOrigin-RevId: 293878808
2020-02-07 18:20:45 -05:00
Abseil Team
717ce7feb8
Googletest export
...
Use standard C++11 integer types in gtest-port.h.
Remove testing::internal::{Int,Uint}{32,64} in favor of types
guaranteed to be in <cstdint> since C++11.
Tests for built-in integer type coverage are switched from
{Int,Uint}64 to [unsigned] long long, which is guaranteed by
C++11 to exist and be at least 64-bit wide.
PiperOrigin-RevId: 281565263
2019-11-22 16:33:15 -05:00
vslashg
8bab7883a6
Merge pull request #2514 from thejcannon:msvc_macro_issue
...
PiperOrigin-RevId: 276134684
2019-10-23 13:35:26 -04:00
Abseil Team
611a321a6e
Googletest export
...
Remove bool_constant in favor of std::integral_constant<bool, ...>;
The one non-trivial use of bool_constant has been changed to have significantly
fewer template specializations.
PiperOrigin-RevId: 275842490
2019-10-22 09:38:12 -04:00
Joshua Cannon
e1b67b07f7
Avoid recursive macros
2019-10-11 17:13:24 -05:00
Joshua Cannon
3e813465a4
Removing extraneous parenthesis
2019-10-11 12:37:59 -05:00
Joshua Cannon
f8961b99f4
Evaluate and cat NARG in different macros
2019-10-11 12:13:15 -05:00
Joshua Cannon
d935e8e3ed
Fix preprocessor tests
2019-10-11 10:41:47 -05:00
Joshua Cannon
c081ceebfb
Workaround MSVC VA_ARGS weirdness
2019-10-11 09:28:25 -05:00
Abseil Team
ed78e54f38
Googletest export
...
Fix the O(n^2) number of instantiations in ElemFromList.
It is now O(n). It still has O(1) instantiation depth.
PiperOrigin-RevId: 273980821
2019-10-11 07:06:56 -04:00
Krystian Kuzniarek
7c2bd3af98
square away the stuff that hasn't been merged in a manual review
...
This fixes up ab8f346b (a manual merge) that has abandoned some things
from PR #2395 .
2019-09-16 19:21:37 +02:00
kuzkry
f2fb48c3b3
Googletest export
...
Merge 3bdefdb473d304803d2a38e2a2cd5cdc1827c3bd into fb49e6c164490a227bbb7cf5223b846c836a0305
Closes #2407
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/googletest/pull/2407 from kuzkry:StaticAssertTypeEq 3bdefdb473d304803d2a38e2a2cd5cdc1827c3bd
PiperOrigin-RevId: 269255328
2019-09-16 11:47:35 -04:00
Shaindel Schwartz
c7a03daa99
Merge pull request #2387 from kuzkry:iff
...
PiperOrigin-RevId: 268693457
2019-09-12 12:10:51 -04:00
kuzkry
ab8f346b07
Googletest export
...
Merge 7f4f58da20e1066a888d3e4bcbef541db798a605 into 90a443f9c2437ca8a682a1ac625eba64e1d74a8a
Closes #2395
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/googletest/pull/2395 from kuzkry:custom-type-traits-remove_reference 7f4f58da20e1066a888d3e4bcbef541db798a605
PiperOrigin-RevId: 266189044
2019-09-06 08:00:03 -04:00
Gennadiy Civil
fdd6a1dc8c
Merge pull request #2382 from kuzkry:dead-metafunction
...
PiperOrigin-RevId: 265730482
2019-08-27 16:59:59 -04:00
kuzkry
db1b739943
Googletest export
...
Merge b8ca465e73ac0954a0c9eec2a84bdd8913d5763b into 90a443f9c2437ca8a682a1ac625eba64e1d74a8a
Closes #2396
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/googletest/pull/2396 from kuzkry:custom-type-traits-true/false_type-and-bool_constant b8ca465e73ac0954a0c9eec2a84bdd8913d5763b
PiperOrigin-RevId: 265064856
2019-08-23 16:39:13 -04:00
Xiaoyi Zhang
46525e1e5d
Merge pull request #2394 from kuzkry:custom-type-traits-duplication-of-custom-index_sequence
...
PiperOrigin-RevId: 264863984
2019-08-23 16:39:04 -04:00
Xiaoyi Zhang
fb49e6c164
Merge pull request #2393 from kuzkry:custom-type-traits-remove_const
...
PiperOrigin-RevId: 264652890
2019-08-21 17:13:34 -04:00
Krystian Kuzniarek
7bd4a7f3e9
restore mistakenly removed iffs in their explicit form
...
Due to confusion arisen from "iff" standing for "if and only if",
this commit uses the latter.
2019-08-20 12:14:22 +02:00
Gennadiy Civil
d5e9e0c38f
Merge pull request #2397 from kuzkry:custom-type-traits-is_reference
...
PiperOrigin-RevId: 264193098
2019-08-19 14:20:11 -04:00
Krystian Kuzniarek
44de869783
remove a dead metafunction
2019-08-16 07:04:49 +02:00
Abseil Team
d44b137fd1
Googletest export
...
Remove legacy support for signed wchar_t and unsigned wchar_t.
Clang now errors out on these types as well by default. Rather than making the
condition for these types even more complicated, just remove the tests covering
these types since they don't seem to justify the maintenance burden. We
can reasonably expect these types to work in compilers that support them
without needing specific tests for them since they are treated as standard
integral types.
PiperOrigin-RevId: 263577673
2019-08-15 17:34:34 -04:00
Krystian Kuzniarek
6a015ca1cb
reuse IndexSequence from googletest
2019-08-14 14:21:32 +02:00
Krystian Kuzniarek
ec49fbca4c
remove custom implementations of std::is_same
2019-08-14 14:00:44 +02:00
Krystian Kuzniarek
da76d01b98
remove a custom implementation of std::is_reference
2019-08-14 13:33:13 +02:00
Krystian Kuzniarek
364839ab14
remove a custom implementation of std::remove_const
2019-08-14 00:34:04 +02:00
Krystian Kuzniarek
bf6df7eaee
fix typos
2019-07-30 12:52:27 +02:00
Peter Levine
711fccf831
Don't allow signed/unsigned wchar_t in gcc 9 and later
2019-06-04 01:07:18 -04:00
Abseil Team
0adeadd283
Googletest export
...
Refactor the `Invoke` and `InvokeWithoutArgs` actions:
- Replace pump'd classes and functions with templates.
- Make the polymorphic actions be polymorphic functors instead.
- Fix Invoke(Callback*) to work with subclasses of the callbacks, instead of trying to diagnose that in gmock_doctor.
PiperOrigin-RevId: 229604112
2019-01-17 14:41:08 -05:00
Abseil Team
216c37f057
Googletest export
...
Drop generated file gmock-generated-internal-utils.h.
PiperOrigin-RevId: 228232195
2019-01-08 11:50:56 -05:00
misterg
14c2fba734
Googletest export
...
Internal Change
PiperOrigin-RevId: 227575279
2019-01-02 16:51:40 -05:00
Abseil Team
f8b1c1af17
Googletest export
...
Remove the #ifs for old, unsupported and buggy compilers:
* old versions of GCC & MSVC
* Symbian
PiperOrigin-RevId: 227116941
2019-01-02 16:51:33 -05:00
Abseil Team
e26a3fa13c
Googletest export
...
Unifdef c++11-related macros from googletest now that it requires C++11.
PiperOrigin-RevId: 225905601
2018-12-20 14:09:31 -05:00
Abseil Team
5dab7be70d
Googletest export
...
Validate spec modifiers.
PiperOrigin-RevId: 221810235
2018-11-20 13:29:40 -05:00
Abseil Team
e46e87bb1f
Googletest export
...
Unify implementation of GMOCK_PP_REPEAT and GMOCK_PP_FOREACH.
PiperOrigin-RevId: 221659669
2018-11-20 13:29:02 -05:00
Abseil Team
c5f08bf919
Googletest export
...
One macro to rule them all.
PiperOrigin-RevId: 221462515
2018-11-15 16:11:19 -05:00
Robin Lindén
826656b25f
Remove workarounds for unsupported MSVC versions
2018-11-10 15:20:26 +01:00
misterg
80b43d900b
Googletest export
...
Remove linked_ptr and use std::shared_ptr instead
PiperOrigin-RevId: 219129336
2018-10-29 13:46:16 -04:00
Abseil Team
b57c703963
Googletest export
...
Remove linked_ptr and use std::shared_ptr instead
PiperOrigin-RevId: 218618184
2018-10-26 14:19:59 -04:00
misterg
a50e4f05b3
Googletest export
...
Remove linked_ptr and use std::shared_ptr instead
PiperOrigin-RevId: 218571466
2018-10-26 14:19:51 -04:00
Abseil Team
7d3b73c85a
Unconditionally use std::tuple.
...
Remove all mention of TR1 tuple and our own implementation of tuple.
PiperOrigin-RevId: 216395043
2018-10-09 16:25:58 -04:00
Gennadiy Civil
265efde9a5
Comments changes, no functionality changes.
2018-08-14 15:04:11 -04:00
Gennadiy Civil
a3c0dd0f4d
Comments changes, no functionality changes
2018-08-14 14:04:07 -04:00
Gennadiy Civil
c203bee245
formatting custom/README.md
2018-08-13 22:45:53 -04:00
Gennadiy Civil
9060e19c87
formatting for new READMEs
2018-08-13 16:23:17 -04:00
Gennadiy Civil
63baab8924
Move instructions into custom/README files
2018-08-13 14:31:56 -04:00
Gennadiy Civil
18c940d13a
comment cleanup
2018-08-13 13:17:38 -04:00
Gennadiy Civil
984cba30ed
Formatting changes for automatic code management
2018-07-27 11:15:08 -04:00
duxiuxing
5b19054b02
Merge branch 'master' into googletest_for_asam
2018-07-19 18:38:20 +08:00
Gennadiy Civil
7e73a7ae6e
Formatting and a link
2018-07-18 11:17:19 -04:00
duxiuxing
65a49a73f0
Fix warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss
2018-07-17 15:46:47 +08:00
David Sunderland
2d3024f5bd
Fix friend declaration to use GTEST_API_ decl spec.
2018-04-19 01:11:50 -04:00
David Sunderland
b2f97ab317
Revert useless use of GTEST_API_ on WithoutMatchers decl.
2018-04-19 01:10:22 -04:00
David Sunderland
1c79ad7a56
Add GTEST_API_ tag to WithoutMatchers class. Hopefully that fixes the problem on MSVC?
2018-04-18 20:59:49 -04:00
David Sunderland
d5725da968
Mark new GetWithoutMatchers method as part of the exported API, to address MSVC linker errors.
2018-04-18 20:25:31 -04:00
David Sunderland
f437f8ca0d
Clone of unsubmitted cr/176529515. Introduce parameterless expectations.
2018-04-18 19:28:56 -04:00
Gennadiy Civil
5cd213ea5e
..and this should be it
2018-04-11 10:10:24 -04:00
Gennadiy Civil
39c58da187
merge
2018-04-10 16:10:34 -04:00
Gennadiy Civil
e1071eb949
RE-Doing the merge, this time with gcc on mac in the PR so I can catch errors before merging the PR
2018-04-10 15:57:16 -04:00
Gennadiy Civil
ca54b67303
Revert "gmock actions 2"
2018-04-09 22:10:12 -04:00
Gennadiy Civil
f5871009e6
yet more
2018-04-09 16:04:48 -04:00
Gennadiy Civil
701e1e5dc1
linkage, fixing MSVC
2018-04-06 16:43:35 -04:00
Gennadiy Civil
c75b76e20a
warnings
2018-04-06 11:00:13 -04:00
Gennadiy Civil
04e31881fc
cont - 2
2018-04-06 10:52:49 -04:00
Gennadiy Civil
32ac949254
cont
2018-04-06 10:43:11 -04:00
Gennadiy Civil
1831ac9361
more warnings
2018-04-06 10:35:09 -04:00
Gennadiy Civil
eb3e4aac2e
deal with MSVC warn, cont 1
2018-04-06 10:24:49 -04:00
Gennadiy Civil
50c0bcd7e3
Cont. deal with MCVS warnings
2018-04-06 10:15:00 -04:00
Gennadiy Civil
b5c87fbcb6
Deal with MCVS warnings
2018-04-06 10:01:40 -04:00