Dino Radakovic
d9a4bbcaf2
Update googletest's test docker containers
...
PiperOrigin-RevId: 511500508
Change-Id: Ib686f93d317b95ac9b9bcb0a5566500316ba1929
2023-02-22 08:18:38 -08:00
Sergey
10493e3854
Fix error in_death_test_child_process: undeclared identifier
...
The error occurs if !GTEST_HAS_DEATH_TEST on Windows.
2023-02-21 13:29:20 -07:00
Tom Hughes
750d67d809
Remove int64_t cast in RecordProperty
...
Historically, calls to RecordProperty with values that are convertible to
int64_t have been casted to int64_t. The result was that types like float or
double would be truncated when printed (e.g., 4.75 -> 4). This change removes
the cast so that the types are printed in a more appropriate manner.
PiperOrigin-RevId: 511238685
Change-Id: I80de5db14462da2a3e1f476086025ae514383a17
2023-02-21 10:25:39 -08:00
Vũ Phạm
810fb81153
Fix typo
2023-02-19 21:59:23 +07:00
Darryl Pogue
fe5b7ef71e
Set CMP0069 policy to avoid warnings
...
When googletest and googlemock are included as a git submodule and referenced
as part of an existing CMake project, multiple warnings are printed out due to
not setting a value for the CMP0069 policy.
2023-02-17 23:22:27 -08:00
Abseil Team
7a7231c442
Fix link in ReportUninterestingCall message
...
This CL changes the link in the ReportUninterestingCall message from
.../gmock_cook_book.md#knowing-when-to-expect to
.../gmock_cook_book.md#knowing-when-to-expect-useoncall. This is necessary
following https://github.com/google/googletest/commit/31ff597 .
PiperOrigin-RevId: 510138974
Change-Id: Ic98c84b07751d27dfc95eddbe7874f76d68b456f
2023-02-16 07:33:48 -08:00
Abseil Team
f063cd25c9
Remove strdup usage
...
PiperOrigin-RevId: 509947007
Change-Id: I31e1274afa889776829c877c40c9af589298dcf2
2023-02-15 15:22:10 -08:00
Abseil Team
2057566e4e
Remove some filesystem APIs and tests under !GTEST_HAS_FILE_SYSTEM
...
PiperOrigin-RevId: 509537606
Change-Id: I68f7054e34b1fe76c1fd85099fffa4ee3c2b00c0
2023-02-14 08:33:42 -08:00
Abseil Team
b80a07ffe6
Avoid reliance on <any> header without RTTI on MSVC
...
Fixes : #4144
PiperOrigin-RevId: 509322023
Change-Id: I52bdf6c25ff433327e174d3f9583b3d50b872d58
2023-02-13 13:46:03 -08:00
Yonggang Luo
097f64e986
Revert "Fix gmock_output_test when using MSVC"
...
This reverts commit 0a3b403fe037ff80daa1826ae99eed41e94dea05.
2023-02-09 15:29:01 +08:00
Tom Hughes
b73f27fd16
Fix _MSC_VER check
...
Use "#if defined(_MSC_VER)" instead of "#if _MSC_VER" to be consistent
with other usages in googletest and to work with the "-Wundef" warning.
PiperOrigin-RevId: 508087630
Change-Id: I29c16fd2fa51a9dfecd55e10362a020318318956
2023-02-08 08:29:54 -08:00
Tom Hughes
0570e2d930
Remove GTEST_USES_PCRE references
...
Nothing defines GTEST_USES_PCRE anymore. It was only meant for
internal use, so nothing public should be relying on it:
https://github.com/google/googletest/issues/2735#issuecomment-644849438 .
Found when compiling with "-Wundef".
Fixes #2735 .
PiperOrigin-RevId: 507823660
Change-Id: Ie19e576ff01dc3b16381338578ece92adccfc09b
2023-02-07 10:38:08 -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
Abseil Team
3d568bdda5
Add support for the alternative base64 encoding in RFC 4648 section 5 to WhenBase64Unescaped
.
...
PiperOrigin-RevId: 507527786
Change-Id: Ie5e088b1814981f6c760d7e25418a430172705ec
2023-02-06 11:00:05 -08:00
Ben Yang
3f9c7fcaa3
Update testing.md
...
Fixed Parameter Generator table
2023-02-02 13:14:43 -08:00
Tom Hughes
2f2e72bae9
Fix compiler flags in Linux presubmit
...
CXX_FLAGS should be CXXFLAGS and the quoting was wrong.
As a result, "-Werror -Wdeprecated" was not being applied.
https://cmake.org/cmake/help/latest/envvar/CXXFLAGS.html
PiperOrigin-RevId: 506656655
Change-Id: Ic5e861be3b9c32257eb9aabb845c931f3cba7122
2023-02-02 10:16:20 -08:00
Tom Hughes
deaf5615f1
Fix -Wsign-conversion warnings
...
googletest/test/gtest_xml_outfile2_test_.cc:48:39:
warning: implicit conversion turns floating-point number into integer:
'float' to 'int64_t' (aka 'long') [-Wfloat-conversion]
RecordProperty("TestFloatProperty", float_prop);
~~~~~~~~~~~~~~ ^~~~~~~~~~
googletest/test/gtest_xml_outfile2_test_.cc:51:40:
warning: implicit conversion turns floating-point number into integer:
'double' to 'int64_t' (aka 'long') [-Wfloat-conversion]
RecordProperty("TestDoubleProperty", double_prop);
~~~~~~~~~~~~~~ ^~~~~~~~~~~
googletest/test/gtest_xml_outfile2_test_.cc:57:39:
warning: implicit conversion changes signedness:
'size_t' (aka 'unsigned long') to 'int64_t' (aka 'long') [-Wsign-conversion]
RecordProperty("TestSizetProperty", size_t_prop);
~~~~~~~~~~~~~~ ^~~~~~~~~~~
PiperOrigin-RevId: 506644143
Change-Id: I9c2cd5f52daebe25e73bb97f696687797ed2cabf
2023-02-02 09:31:44 -08:00
Tom Hughes
4f7c63d991
Remove unneccessary "#if _MSC_VER"
...
The GTEST_DISABLE_MSC_WARNINGS macros already have an _MSC_VER check.
This change also adds a missing GTEST_DISABLE_MSC_WARNINGS_POP_ in
gtest-typed-test_test.cc.
PiperOrigin-RevId: 506636248
Change-Id: Ifdc044528f5448fbf0175887d1671f1e1f3040b9
2023-02-02 09:02:17 -08:00
Abseil Team
6f21175f57
Add a trailing decimal point to FormatTimeInMillisAsSeconds() output when input
...
is an exact N seconds.
PiperOrigin-RevId: 506610898
Change-Id: Idcd705c719e0e721148c350c8a14f27b9eb5c4f7
2023-02-02 07:15:23 -08:00
Tom Hughes
ebedaa18c7
Fix include order
...
PiperOrigin-RevId: 506424617
Change-Id: If7f0beb92022589523db204a6b5cbe9249cebf62
2023-02-01 14:32:28 -08:00
Tom Hughes
394a8a568c
Remove GMOCK_RENAME_MAIN
...
GMOCK_RENAME_MAIN appears unused.
PiperOrigin-RevId: 506387823
Change-Id: I732c1f64f9038991a5c9aea1f2ad6fff07622afa
2023-02-01 12:14:47 -08:00
Tom Hughes
fd36851c8d
Build gmock Python tests when building with cmake
...
Fixes #4124 .
PiperOrigin-RevId: 506379032
Change-Id: Ibc44ffce1012bbf313565728a3d9e5e6e56ba660
2023-02-01 11:44:56 -08:00
Tom Hughes
0a3b403fe0
Fix gmock_output_test when using MSVC
...
std::pair is printed as "struct std::pair<int,bool>" when using MSVC
vs "std::pair<int,bool>" with other compilers. Switch to "std::tuple", which
is the same for all compilers.
See
https://learn.microsoft.com/en-us/cpp/standard-library/pair-structure
https://learn.microsoft.com/en-us/cpp/standard-library/tuple-class
PiperOrigin-RevId: 506340295
Change-Id: Ib4ce2f74d54888a4e4173f42da1b55cc5583f7d4
2023-02-01 09:33:23 -08:00
Tom Hughes
d9251171f5
Fix sign conversion warning from clang:
...
googletest/samples/prime_tables.h:81:57: error:
implicit conversion changes signedness: 'int' to 'unsigned long'
[-Werror,-Wsign-conversion]
: is_prime_size_(max + 1), is_prime_(new bool[max + 1]) {
~~~ ~~~~^~~
PiperOrigin-RevId: 506065360
Change-Id: Ida4550562531012c089e2f9fcf530b3a78889fa3
2023-01-31 11:37:10 -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
Tom Hughes
f1c05d4544
Use explicit short to fix MSVC compiler warning
...
warning C4244: 'initializing': conversion from 'int' to 'short', possible
loss of data
PiperOrigin-RevId: 505774670
Change-Id: I3524040334a4b265bae12cfacdd2b615cbb1cfc8
2023-01-30 12:58:34 -08:00
Copybara-Service
e3dbee4b35
Merge pull request #4115 from SunBlack:codespell
...
PiperOrigin-RevId: 505740434
Change-Id: I963f6a6b667a030c87f211173f578f7c35733e68
2023-01-30 10:55:07 -08:00
Tom Hughes
b72202078d
Test current behavior of doubles and floats in RecordProperty
...
PiperOrigin-RevId: 505104193
Change-Id: I4c2758f22ee1321ed6b6662ab2668f6c5b6aa661
2023-01-27 06:38:52 -08:00
Tom Hughes
403a968d3c
Fix formatting in Python files
...
PiperOrigin-RevId: 504890435
Change-Id: Ia9a89d0d7a07fe70c12f7f0202c8256c94d2f118
2023-01-26 11:06:14 -08:00
Tom Hughes
0194f90d0e
Fix Python docstrings to match style guide
...
https://google.github.io/styleguide/pyguide.html#s3.8.3-functions-and-methods
PiperOrigin-RevId: 504857416
Change-Id: I7815ce27e454a120b3974ae7e2bea952108b836c
2023-01-26 09:04:40 -08:00
Abseil Team
4b4c56aff6
Make document and example code more clear in the caveat section for potential memory leak with SetUpTestSuite
.
...
PiperOrigin-RevId: 504706717
Change-Id: I5842a4569f81f6c0d636099b5cdaabe778996949
2023-01-25 17:43:53 -08:00
Tom Hughes
b495f72f1f
Use more specific assertLess instead of assertTrue
...
PiperOrigin-RevId: 504670738
Change-Id: Ib68b676403204098e89f536f9b8317f9f717c24d
2023-01-25 15:01:21 -08:00
Tom Hughes
f47d75faf3
Fix pylint warning
...
Possible unbalanced tuple unpacking with sequence defined at line N:
left side has 1 label(s), right side has 0 value(s)
[unbalanced-tuple-unpacking]
PiperOrigin-RevId: 504640001
Change-Id: If8d6038a9acf74a409cb6b6ee30cea7745b4b303
2023-01-25 13:03:31 -08:00
Tom Hughes
137dcd18cc
Remove pylint disable comments that no longer trigger warnings
...
PiperOrigin-RevId: 504633130
Change-Id: I3fdbc83975fea97aa53f7325d323adead0a30e24
2023-01-25 12:35:34 -08:00
Abseil Team
643862d8ad
Mention DescribeMatcher
in matchers.md
...
PiperOrigin-RevId: 504591836
Change-Id: I48c93490d0c3b7c6bfaceceb1cef5eedeacfe6c6
2023-01-25 10:04:20 -08:00
Tom Hughes
d1ad27e0a4
Fix formatting in subset of Python files
...
These files were formatted with automated tools. The remaining Python
files require some manual fix ups, so they will be fixed separately.
PiperOrigin-RevId: 504579820
Change-Id: I3923bd414bffe3ded6163ec496cd09ace3951928
2023-01-25 09:14:26 -08:00
Tom Hughes
6c65a1ca35
Replace numeric lints with their string equivalent
...
PiperOrigin-RevId: 504570278
Change-Id: Iab9c988b3a781eaafbdd97c924a74c2269125799
2023-01-25 08:32:19 -08:00
Tom Hughes
2491710524
Fix formatting of C++ files
...
PiperOrigin-RevId: 504325204
Change-Id: Iaa1d6d0ab1dccaaeef26f9cb109d530835499240
2023-01-24 11:10:09 -08:00
Tom Hughes
408471e20c
Fix formatting of Markdown files
...
PiperOrigin-RevId: 504308485
Change-Id: Ia4ae97b2173b44b89aa5d987ddefd6e0c1488386
2023-01-24 10:13:03 -08:00
Derek Mauro
544c96ed5b
Remove FloatingPoint::Max() in favor of std::numeric_limits::max()
...
In #4113 a user says Max clashes with a macro. Since it is only used in
a test, use std::numeric_limits::max() instead.
Note that in headers, the macro issue can be mitigated with
parenthesis like this: `(std::numeric_limits<T>::max)()`
PiperOrigin-RevId: 504284906
Change-Id: Ibf430caec1a6afdf6b303534fec6a4fd00a6373f
2023-01-24 08:41:35 -08:00
Abseil Team
ec25eea8f8
Mention using MockFunction as a way to mock free functions.
...
PiperOrigin-RevId: 502901538
Change-Id: I0cf351b9ad1411ae9c45e09550c24e006a24e179
2023-01-18 09:43:56 -08:00
Tom Hughes
bdb3b0a493
Replace deprecated python calls
...
assert_ -> assertTrue/assertFalse/assertIn/assertNotIn
assertEquals -> assertEqual
PiperOrigin-RevId: 502654909
Change-Id: I25d30095a83c3806606cb80d676b3c979495e6bd
2023-01-17 12:16:29 -08:00
Dino Radakovic
bba28fa8b2
Announce that GitHub actions are not GoogleTest's canonical CI
...
PiperOrigin-RevId: 502654465
Change-Id: I51269e8c389ad63f3737132feec1b6d20dc4c314
2023-01-17 12:14:32 -08:00
Tom Hughes
5cd81a7848
Fix -Wimplicit-int-float-conversion warning
...
We're intentionally losing precision in this case, so add a cast.
googletest/googletest/include/gtest/gtest-printers.h:532:9: error:
implicit conversion from 'int32_t' (aka 'int') to 'float' may lose precision
[-Werror,-Wimplicit-int-float-conversion]
if (static_cast<int32_t>(val * mulfor6 + 0.5) / mulfor6 == val) return 6;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~
googletest/googletest/include/gtest/gtest-printers.h:544:9: error:
implicit conversion from 'int32_t' (aka 'int') to 'float' may lose precision
[-Werror,-Wimplicit-int-float-conversion]
if (static_cast<int32_t>(val / divfor6 + 0.5) * divfor6 == val) return 6;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~
PiperOrigin-RevId: 502646042
Change-Id: I05989ee42675b531a9907616c9582a5a7c77bed6
2023-01-17 11:44:46 -08:00
Derek Mauro
9d697cc81c
Update documentation for v1.13.0
...
PiperOrigin-RevId: 502644180
Change-Id: Id20b5e4eec22035da278f1767002657f66dbe79c
2023-01-17 11:38:05 -08:00
Derek Mauro
b796f7d446
Bump version to 1.13.0 in preparation for release
...
PiperOrigin-RevId: 502626077
Change-Id: I3aad27a8b725cf73163e52ef2e28e6cdfc13082b
v1.13.0-pre
v1.13.0
2023-01-17 10:36:43 -08:00
Abseil Team
ac7a126f39
gmock_output_test: normalize golden file output to unix line endings
...
When checked out on Windows, the repo might use \r\n line endings,
and so the golden output has them. Adjust for that.
PiperOrigin-RevId: 502577222
Change-Id: Iabfe537f6d95a49bf6bdcb934e855d28c65f6f89
2023-01-17 07:12:50 -08:00
Tom Hughes
356fc30125
Fix -Wshadow warnings
...
../googlemock/test/gmock-actions_test.cc:687:36: warning: declaration of ‘v’ shadows a member of ‘testing::{anonymous}::ReturnTest_SupportsReferenceLikeReturnType_Test::TestBody()::Result’ [-Wshadow]
687 | Result(const std::vector<int>& v) : v(&v) {} // NOLINT
| ~~~~~~~~~~~~~~~~~~~~~~~~^
../googlemock/test/gmock-actions_test.cc:686:29: note: shadowed declaration is here
686 | const std::vector<int>* v;
| ^
../googlemock/test/gmock-actions_test.cc: In constructor ‘testing::{anonymous}::ReturnTest_PrefersConversionOperator_Test::TestBody()::Out::Out(int)’:
../googlemock/test/gmock-actions_test.cc:720:28: warning: declaration of ‘x’ shadows a member of ‘testing::{anonymous}::ReturnTest_PrefersConversionOperator_Test::TestBody()::Out’ [-Wshadow]
720 | explicit Out(const int x) : x(x) {}
| ~~~~~~~~~~^
../googlemock/test/gmock-actions_test.cc:718:9: note: shadowed declaration is here
718 | int x;
| ^
PiperOrigin-RevId: 501580618
Change-Id: I584710fbbe440ec724f88746e51f3be5653c32d5
2023-01-12 09:04:13 -08:00
Derek Mauro
b5401fef68
Add an explicit #error that C++ versions less than C++14 are not supported
...
PiperOrigin-RevId: 501568410
Change-Id: I0f78cd96dc9204c8ec97a1cdd09a9d63a613cc5b
2023-01-12 08:10:36 -08:00
Derek Mauro
a652ae0575
Update GoogleTest dependencies
...
PiperOrigin-RevId: 501282034
Change-Id: I0314ac566dc5e117db5a06c97d303e5cf8822d61
2023-01-11 07:57:13 -08:00