Commit Graph

4319 Commits

Author SHA1 Message Date
Michael Hirshleifer
d1467f5813 GoogleTest FAQ: minor punctuation fixes
PiperOrigin-RevId: 565411290
Change-Id: I57e94c679183e39eec2a2835f330b52fc9302767
2023-09-14 10:37:04 -07:00
Michael Hirshleifer
728ec52d21 Remove Googletest FAQ entry for obsolete ProtocolMessageEquals and ProtocolMessageEquiv
* These long-dead variants of the proto matchers don't exist in the current version of Googletest.
* No evidence of external usage: [the only external references I see](https://www.google.com/search?q=%22protocolmessageequals%22+OR+%22protocolmessageequals%22) are copies of this guide. Possibly they were already removed by the time Googletest was publicly released.

PiperOrigin-RevId: 565358401
Change-Id: I61379b7333fa8ee19cd5520caedf2c539f54c2d7
2023-09-14 07:13:20 -07:00
Copybara-Service
af5ddbde4d Merge pull request #4342 from tanzislam:prefer-tmpdir-on-android
PiperOrigin-RevId: 565230380
Change-Id: I6e91eea46d05413d4d87e73a11941786604d9f27
2023-09-13 19:36:52 -07:00
Copybara-Service
eab0e7e289 Merge pull request #4365 from tanzislam:fix-thread-count-after-thread-creation
PiperOrigin-RevId: 564472305
Change-Id: I8db9bc0ba0768e7ab9c67f36d9db87edbbf14f10
2023-09-11 12:46:26 -07:00
Tanzinul Islam
b86bf840d1 Count threads after thread-creation while still holding mutex lock
The `Mutex` is locked with the `MutexLock` before spawning the thread, so that the thread is prevented from completing (by being blocked on `Mutex`) before the new thread count is obtained. However, the existing bug (introduced in 22e6055) releases `Mutex` before obtaining the new thread count, which allows the thread to run to completion in the meantime.

Also, since the `(thread_count_after_create != starting_count + 1)` condition (line 328) skips the remainder of the `for`-loop body on every iteration, `thread_count_after_join` stays uninitialized.

I believe this is why [this test failed][1] on the macOS CI with this trace:

```
[----------] 1 test from GetThreadCountTest
[ RUN      ] GetThreadCountTest.ReturnsCorrectValue
googletest/test/googletest-port-test.cc:350: Failure
Expected equality of these values:
  thread_count_after_create
    Which is: 1
  starting_count + 1
    Which is: 2

googletest/test/googletest-port-test.cc:351: Failure
Expected equality of these values:
  thread_count_after_join
    Which is: 140493185949400
  starting_count
    Which is: 1

[  FAILED  ] GetThreadCountTest.ReturnsCorrectValue (2 ms)
[----------] 1 test from GetThreadCountTest (2 ms total)
```

[1]: https://github.com/google/googletest/actions/runs/6064919420/job/16453860690?pr=3049
2023-09-03 16:46:02 +01:00
Tanzinul Islam
edf9b4964d Reuse TempDir() function 2023-08-26 08:53:45 +01:00
Dino Radakovic
8a6feabf04 googletest: Add universal printer for std::span
Fixes #4318

PiperOrigin-RevId: 560089120
Change-Id: I9d0d098140033520266747a1689e953ee8307c47
2023-08-25 07:46:02 -07:00
Copybara-Service
460ae98267 Merge pull request #4349 from sthd:httpToHttps
PiperOrigin-RevId: 559452348
Change-Id: I6f72001fd6b8e5a739c34121c8847c281d563b0f
2023-08-23 09:30:13 -07:00
sthd
f0eae4b399 changed http to https 2023-08-22 20:58:34 +03:00
Copybara-Service
cb5cd96bca Merge pull request #4343 from sthd:http-to-https
PiperOrigin-RevId: 559151399
Change-Id: I8eb2c7c5222d0fd0935db531a0abe5792633fe7e
2023-08-22 10:24:02 -07:00
Dino Radakovic
c374da15c5 googletest: Replace http with https in links to docs
This is a prerequisite for #4341

PiperOrigin-RevId: 559132807
Change-Id: Iadc961913e0ff107c5333dae17be5f8638663836
2023-08-22 09:21:04 -07:00
Derek Mauro
61332bd7e8 CI: Update the Linux hybrid-latest docker container used for testing
The following are the major updates
  * LLVM 17 branch (https://github.com/llvm/llvm-project b744f4c99cf91155c74a3c92db6f1335232ff3d)
  * GCC 13.2
  * CMake 3.27.1
  * Bazel 6.2.1

PiperOrigin-RevId: 558818264
Change-Id: Ib08d8331e2a8b2d68a702670451beaaac5d266f4
2023-08-21 09:50:40 -07:00
Abseil Team
762d3a7f66 Clean up typos: Exhaused => Exhausted
PiperOrigin-RevId: 558801066
Change-Id: Ia225d12014748db87639414f4c8c28a0d0e9e489
2023-08-21 08:47:54 -07:00
Elior Schneider
c759a58a2d
Merge branch 'google:main' into http-to-https 2023-08-20 09:39:17 +03:00
Elior Schneider
722daa3da6
Update advanced.md
http to https
2023-08-20 09:38:57 +03:00
Copybara-Service
9fce548044 Merge pull request #4322 from pgawro:ansi_colors
PiperOrigin-RevId: 558224853
Change-Id: Ib2d8ad41fcc4d38f58aa5702b537467d8867d82e
2023-08-18 12:59:42 -07:00
Tanzinul Islam
14d05f4708 Prefer $TMPDIR to /data/local/tmp on Android
Newer devices can have the latter location read-only. (I observed this with Termux on a non-rooted Pixel 6.)
2023-08-18 19:44:48 +01:00
Elior Schneider
5e47c767ff
Merge branch 'google:main' into http-to-https 2023-08-18 16:34:00 +03:00
Abseil Team
f42da0e443 Improve error message for invalid parameterized test names.
PiperOrigin-RevId: 557910190
Change-Id: Ia965a6c96e4cc5997d8af2611abc62c42e81653e
2023-08-17 12:56:29 -07:00
Patryk Gawroński
e24cced08d googletest: ansi color fix
Adds prevents from returning
nullptr by choosing default color.

Issue: #4321
2023-08-17 00:11:28 +02:00
Copybara-Service
987e225614 Merge pull request #4333 from ngie-eign:gtest_help_test-fix-FreeBSD
PiperOrigin-RevId: 557197748
Change-Id: I55b86353f5351bbcbdf8e6bca70e82d7383a5080
2023-08-15 11:39:35 -07:00
Dino Radakovic
dd9a956904 gtest_help_test: Make method names snake_case, conforming with [the style guide](https://google.github.io/styleguide/pyguide#316-naming)
PiperOrigin-RevId: 557133618
Change-Id: I27202ee91ee81b3d2e4c28102190d2bde8efba05
2023-08-15 08:00:31 -07:00
Dino Radakovic
6513d0272d gtest_help_test: Inline test helper functions
`TestNonHelpFlag` is only a few asserts with no logic, which is easier to read in line, and helper `TestHelpFlag` is used in a single test case.

PiperOrigin-RevId: 557122793
Change-Id: I7367424abfbb883c10c260fae066a2071e5dfa0e
2023-08-15 07:11:58 -07:00
Copybara-Service
fc234d6d18 Merge pull request #4334 from ngie-eign:fix-RETest-non-ABSL
PiperOrigin-RevId: 557122083
Change-Id: I77fb7fe99baf9cbf341ad37d4b651a0ac606b549
2023-08-15 07:08:30 -07:00
Dino Radakovic
d76e9e0dd9 gtest_help_test: Delete obsolete helper TestUnknownFlagWithAbseil
PiperOrigin-RevId: 557116814
Change-Id: I91e06b0d6001952366c50201b67491475a1f98af
2023-08-15 06:42:46 -07:00
sthd
8ca57f194a Changed 2 public links from http to https 2023-08-11 11:26:59 +03:00
sthd
5b5ef29950 Changed 3 public links from http to https 2023-08-11 11:21:47 +03:00
sthd
622ee5cf29 Changed 2 public links from http to https 2023-08-11 11:06:25 +03:00
sthd
619601c5e2 Changed 3 public links from http to https 2023-08-11 11:01:14 +03:00
Abseil Team
7e33b6a1c4 Specify SetUpTestSuite is required to be public.
PiperOrigin-RevId: 555578256
Change-Id: I9366fc99ae953c29e468fcddb4be203c9c05661b
2023-08-10 11:27:05 -07:00
Copybara-Service
89b25572db Merge pull request #4330 from IncludeGuardian:remove-iomanip
PiperOrigin-RevId: 554867591
Change-Id: Ib32da50384951532419cb54fb70f8ab0920178d7
2023-08-08 10:26:39 -07:00
Enji Cooper
77485ff004 Fix RETest/1.ImplicitConstructorWorks on non-ABSL platforms
The last regular expression specified in the test is not technically
POSIX compatible. Use `[[:alnum:]_]` instead of `\w+`; the latter is a
Perl-compatible regular expression.

Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
2023-08-07 21:37:54 -07:00
Enji Cooper
22eb2de1ef Fix GTestHelpTest.TestHelpFlag on FreeBSD
The test supported a variety of BSDs, including kFreeBSD, but not FreeBSD.

Move the BSD checks to a separate function and support checking for
FreeBSD, in addition to kFreeBSD.

Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
2023-08-07 20:18:01 -07:00
Copybara-Service
46db91ef6f Merge pull request #4328 from robert-shade:suppress_unreachable_warning
PiperOrigin-RevId: 554578443
Change-Id: Ib5b03605c30fc2974b9597860577ff89532eedcd
2023-08-07 13:39:47 -07:00
Dino Radakovic
6abc9e3d79 Make references to #includes consistent across docs
PiperOrigin-RevId: 554561504
Change-Id: Ia02ab6ac646bf6637d6f500a4aaedd14e0a04798
2023-08-07 12:44:53 -07:00
Elliot Goodrich
9ef5e82269 Remove public includes of <iomanip>
This commit removes `<iomanip>` from public GoogleTest header files.

As `<iomanip>` is not a common included file, its content is unlikely
to be included in translation units other than through GoogleTest
includes.

By reducing the number of include directives public headers in
GoogleTest, this may reduce the time taken to compile tests as it would
reduce the amount of work that the preprocessor and compiler front-end
need to do.
2023-08-03 22:14:38 +01:00
Copybara-Service
455fcb7773 Merge pull request #4323 from pgawro:gtest_ExpectThrowTest_DoesNotGenerateUnreachableCodeWarning
PiperOrigin-RevId: 553485739
Change-Id: I6581215e6db514397177af39381eea4d121f32bd
2023-08-03 08:32:42 -07:00
Robert Shade
429432e341 Avoid unreachable code warning 2023-08-02 14:09:54 -04:00
Derek Mauro
843976e4f5 Update documentation to refer to v1.14
PiperOrigin-RevId: 553172719
Change-Id: Ie09afa3788c8ed5c95913d8ca0b436f1df28241a
2023-08-02 09:45:10 -07:00
Derek Mauro
f8d7d77c06 Bump version to v1.14 in preparation for release
PiperOrigin-RevId: 553152072
Change-Id: I0bfbb2da6b3902fc3e41a8e1c4aacb291ffdd098
2023-08-02 08:24:53 -07:00
Derek Mauro
96683ee668 Remove the GTEST_HAS_DOWNCAST_ customization point.
PiperOrigin-RevId: 553150809
Change-Id: I10d19a45a85c5f63a5e65dc322413307116e1c25
2023-08-02 08:19:45 -07:00
Derek Mauro
58e37f7e99 Add googletest-message-test to the Bazel tests
It appears to have been unintentionally left out

PiperOrigin-RevId: 553141410
Change-Id: I8adac55a3df0ec12d6fe03446f71858fc702e178
2023-08-02 07:40:55 -07:00
Phoebe Liang
e7fd109b53 Make testing::Message support streamed AbslStringify values
This allows types that provide an AbslStringify definition to be streamed into GoogleTest macros.

PiperOrigin-RevId: 552914482
Change-Id: I5fb386980d4d24873f95f0a8ef83067a6a3c86ac
2023-08-01 14:01:41 -07:00
Derek Mauro
717d8ab5e0 Update GoogleTest dependencies
PiperOrigin-RevId: 552912819
Change-Id: If1b6278f7fe5a8fc41fc3bc390356a94387d0091
2023-08-01 13:56:57 -07:00
Copybara-Service
6f6ab4212a Merge pull request #4325 from juliencombattelli:main
PiperOrigin-RevId: 552577282
Change-Id: I2b4d20d155ad5746e36711c039293d5c996a332e
2023-07-31 13:32:19 -07:00
Julien Combattelli
efe6bb1db8 Use #if and not #ifdef to check filesystem support 2023-07-29 15:54:54 +02:00
Abseil Team
c875c4e224 Adjust includes to use <> instead of "", consistent with quickstart pages.
Right now, gtest documentation uses different #include syntax. The quickstart
pages (e.g., http://google.github.io/googletest/quickstart-bazel.html#create-and-run-a-binary) are checked in with `#include <gtest/gtest.h>` However, other
documentation (such as the primer) uses `#include "gtest/gtest.h"` (e.g.,
https://google.github.io/googletest/primer.html#writing-the-main-function).

PiperOrigin-RevId: 551878641
Change-Id: Iab93cc1da3ef4870a07b624071b75d6e9d3568c1
2023-07-28 09:51:41 -07:00
Patryk Gawroński
2f83a6e8f8 gtest: Supress warning about set unused variable
Modified test ExpectThrowTest.DoesNotGenerateUnreachableCodeWarning
2023-07-27 01:49:57 +02:00
Copybara-Service
40412d8512 Merge pull request #4317 from mrfeod:patch-1
PiperOrigin-RevId: 550585850
Change-Id: I727f74aeb6f1da5bbbf5a5f49f06c4cfea40a73b
2023-07-24 09:31:31 -07:00
Abseil Team
01e18376ef Make AbslStringify usage public in GoogleTest
Fixes #4314

PiperOrigin-RevId: 549986457
Change-Id: Iff74f02ab1c106696f288540e9c623d56b76e3f7
2023-07-21 10:36:25 -07:00