| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
This also adds the dependencies of rules_cc to WORKSPACE.
bzlmod automatically pulls in dependencies.
skylib is removed as it is pulled in by a deps function.
PiperOrigin-RevId: 808659470
Change-Id: Idc41cad7b05019793d4a1898bdb80bc4797da5cf
|
|
|
|
|
|
|
| |
with the standard and the latest Abseil
PiperOrigin-RevId: 806260850
Change-Id: Ie973be4a3aaf7e174cd692ce6df7a82c8f261bf7
|
|
|
|
|
|
|
| |
<= 23.
PiperOrigin-RevId: 786394374
Change-Id: I5188b55ae8ae6d3188e6492f3865b21ae6d2285e
|
|\
| |
| |
| |
| | |
PiperOrigin-RevId: 775667059
Change-Id: I07edd44ae368ae640d7b985800ffee8cc663c07f
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
There are two cases that prompt this behavior:
- All test cases in the binary are disabled.
- There are more shards defined than test cases, so some shards are empty.
The result in each case is the same: the test runner needs to spin up
additional processes that do nothing, which is wasteful, especially when tests
need expensive resources.
PiperOrigin-RevId: 769176856
Change-Id: Ifa399a0b7b68e4add5a94ca148b32b2938a8666d
|
| |
| |
| |
| |
| |
| |
| |
| | |
The length part (only) of each range is optional when equal to one.
See http://www.gnu.org/software/diffutils/manual/html_node/Detailed-Unified.html
PiperOrigin-RevId: 765326445
Change-Id: I4aec68e82f889e3b4f01861d3b6a16a8b2785ce6
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
While ConditionalPrintAsText gets a char pointer and the string length, it used to only pass the pointer to operator<<. That does not work for strings that are not zero terminated, because operator<< has to resort to strlen, which happily overflows the string buffer.
This CL wraps the char pointer and the length in a string_view and passes that to operator<< to fix that issue.
PiperOrigin-RevId: 765137769
Change-Id: Ie97067ce9d5b23175a512945fee943a8b95a94ff
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This is a followup to a previous change switching std::u8string,
std::u16string, and std::u32string to print as string literals instead
of an array of characters. Also update the PrintCharsAsStringTo<Char>()
helper to handle cases where the pointer to the string data is null;
unlike std::basic_string<Char>, std::basic_string_view<Char>'s data()
is allowed to return nullptr.
The new PrintTo overloads complicate the PrintTo(internal::StringView)
overload, which needs to be disabled if internal::StringView is an alias
for std::string_view to avoid multiple definitions with the same
overload. Simply omitting the unconditional PrintTo(std::string_view)
overload is a worse option though, as this results in std::string_view
not printing nicely if internal::StringView is not an alias for
std::string_view.
PiperOrigin-RevId: 762020327
Change-Id: I92f5bdbacba89e97bbcc0fef3ca9261ea5a788d3
|
| |
| |
| |
| |
| |
| |
| |
| | |
and std::variant now that the absl types are aliases of the
std types
PiperOrigin-RevId: 761136061
Change-Id: I702c3e1e8c58d003b8f4da99e7c84c9e5dbe1863
|
| |
| |
| |
| |
| |
| |
| | |
This helps avoid a situation where someone sets up a parameterized test but forgets to actually use the parameter.
PiperOrigin-RevId: 758455362
Change-Id: Ie4db03e82b6a4e1787be96f154b3fbb25657ae64
|
| |
| |
| |
| |
| |
| |
| | |
functor. This allows the use of classes that do not have a converting ctor to the desired type.
PiperOrigin-RevId: 733383835
Change-Id: I6fbf79db0509b3d4fe8305a83ed47fceaa820e47
|
| |
| |
| |
| |
| | |
PiperOrigin-RevId: 732204780
Change-Id: I2c4ccabd123e3b79c3dd8bc768a4cd9a576d282c
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Bazel sets the environment variable TEST_WARNINGS_OUTPUT_FILE
https://bazel.build/reference/test-encyclopedia#initial-conditions
If no tests are linked and the new flag --gtest_fail_if_no_test_linked
is not true (which is the current default), we can still warn the user
as this may be a programming error without failing the test (which would
break existing users).
PiperOrigin-RevId: 731402363
Change-Id: Ia481689efd4bd18889feaaa38bc56049a3f651cd
|
| |
| |
| |
| |
| |
| |
| |
| | |
to fail the test program if no test case is linked in
(a common programmer mistake).
PiperOrigin-RevId: 730571311
Change-Id: I1dab04adfe35581274d0b4ec79a017014d50e1ea
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* Use `[[nodiscard]]` instead of GTEST_MUST_USE_RESULT_
* Use `[[maybe_unused]]` instead of GTEST_INTERNAL_ATTRIBUTE_MAYBE_UNUSED
* Use `[[deprecated]]` instead of `GTEST_INTERNAL_DEPRECATED`
* Remove `GTEST_INTERNAL_NEED_REDUNDANT_CONSTEXPR_DECL`
PiperOrigin-RevId: 729523519
Change-Id: Ia1b901cf9c0a0e148eec419ada0e0b56aba2dd3d
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Policy information:
https://opensource.google/documentation/policies/cplusplus-support#c_language_standard
https://github.com/google/oss-policies-info/blob/main/foundational-cxx-support-matrix.md
Some small fixes are included for C++17 compatibility.
We had no tests for MSVC C++17 or C++20, so those tests that failed
and had no obvious fix are disabled and a tracking bug has been filed.
PiperOrigin-RevId: 726090558
Change-Id: I4d37d47e87c11f85bfd572deb10f67ca3eb2a9b5
|
| |
| |
| |
| |
| |
| |
| | |
It look like this may be a copy-paste bug from the root BUILD file.
PiperOrigin-RevId: 724062332
Change-Id: I8eda2275d996dd14693aee569254db28d9bc4f9d
|
|/
|
|
|
|
|
|
| |
With this change, arbitrary property names in the testsuite no longer
cause the produced XML output to be ill-formed.
PiperOrigin-RevId: 721549090
Change-Id: Iedffa89bf914478f563c8f3b82cd50557762a665
|
|
|
|
|
|
|
|
|
|
|
| |
XML/JSON
This surfaces useful information about the environment failure in a structured form.
As we can see from the updated test, previously unsurfaced information is now present.
PiperOrigin-RevId: 709892315
Change-Id: I2656294d50c33f995bef5c96195a66cff3c4b907
|
|
|
|
|
|
|
|
| |
Adds feature test macro for C++20 <compare> header, a pretty-printer, and tests.
Inexplicably, these types aren't enums, so can't be handled with a switch.
PiperOrigin-RevId: 704783038
Change-Id: I29688989d18f43520fe610c12a447a20d2f98c95
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
such that `ASSERT_NEAR(inf, inf, 0)` passes. This makes the behavior more consistent with `ASSERT_EQ(inf, inf)` which succeeds.
Some examples of asserts that now pass:
```
ASSERT_NEAR(inf, inf, 0)
ASSERT_NEAR(-inf, inf, inf)
ASSERT_NEAR(inf, x, inf) // x is any finite floating point value
```
PiperOrigin-RevId: 685748133
Change-Id: I7b3af377773e8e0031e4c6b86830cbbf76bf20c6
|
|
|
|
|
|
|
| |
<= 21.
PiperOrigin-RevId: 643076477
Change-Id: Id9486b7d73c3b17851df1eaf8f5ab2085238bf75
|
|
|
|
|
|
|
| |
-Wused-but-marked-unused warnings
PiperOrigin-RevId: 625430612
Change-Id: Ia9d2e47984e1e6f91966afae8a6750119ae69446
|
|\
| |
| |
| |
| | |
PiperOrigin-RevId: 622929007
Change-Id: Ifaf5a701baee74503e6845f32ebc27425882e950
|
| |
| |
| |
| | |
Fix the gap between JSON and XML output.
|
|/
|
|
|
|
|
|
|
| |
* Applies for `std::index_sequence`, `std::make_index_sequence`, and `std::index_sequence_for` replacing `IndexSequence`, `MakeIndexSequence` and IndexSequenceFor`
* Also deleted implementation helper `DoubleSequence`
* The standard interfaces [have been in the standard library since C++14](https://en.cppreference.com/w/cpp/utility/integer_sequence), which [is the minimum supported C++ version by Google Test](https://github.com/google/oss-policies-info/blob/main/foundational-cxx-support-matrix.md)
PiperOrigin-RevId: 621939977
Change-Id: Id264266f08da66c0fa2a6e6fbb8f86fd3cb3a421
|
|\
| |
| |
| |
| | |
PiperOrigin-RevId: 616931521
Change-Id: Iffbb24e3f9add4e7acf8f1988a03afc8628b0733
|
|/ |
|
|
|
|
|
|
|
|
| |
_Exit is standardized since C99, whereas _exit is POSIX-only.
Fixes: #4447
PiperOrigin-RevId: 605000352
Change-Id: Ibfa84edaa043bd003a21383e8148bf45be7217f6
|
|
|
|
|
|
|
|
|
|
|
| |
Destruction in static teardown causes issues for Environments which own threads and try to join them in their destruction.
This may be a breaking change for users who call RUN_ALL_TESTS multiple times in the same main function if they also install environments, or those who access registered environments after RUN_ALL_TESTS.
The easiest fix is to only call RUN_ALL_TESTS once as the last line of the main function. Another potential fix is to re-register new instances of the Environment once before each call to RUN_ALL_TESTS.
PiperOrigin-RevId: 604800795
Change-Id: I37c44d4aca4a238052649f45a4b6b9cfb5355b71
|
|
|
|
|
| |
PiperOrigin-RevId: 603034597
Change-Id: I4d716ed67f80f41075bfa266d975460d2ac27eb6
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Stack traces in assertion failures are an extremely useful tool for
developers tasked with investigating failing tests. It's difficult to
understate this. In contrast to ordinary test assertions (e.g.,
ASSERT_TRUE or EXPECT_FALSE), SUCCEED() is a developer-authored
directive that indicates a success codepath. In fact, the documentation
states that this directive doesn't generate any output. Generating stack
traces for uses of SUCCEED() is wasted work since they are never
printed. If this were to change one day in the future, they still would
not be useful since any emitted message would include the file and line
number where SUCCEED was used. In addition to being noise in the output
in this case, symbolization of stack traces is not free. In some
Chromium configurations, symbolization for use of SUCCEED() can incur a
cost in excess of 25 seconds for a test that otherwise takes 0-1ms; see
https://crbug.com/1517343.
In this CL, we suppress generation and emission of stack traces for
kSuccess messages to reduce the overhead of SUCCEED().
PiperOrigin-RevId: 602832162
Change-Id: I557dd6a1d3e6ed6562daf727d69fd01fe914827b
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Stack traces in assertion failures are an extremely useful tool for
developers tasked with investigating failing tests. It's difficult to
understate this. In contrast to ordinary test assertions (e.g.,
ASSERT_TRUE or EXPECT_FALSE), GTEST_SKIP is a developer-authored
directive to skip one or more tests. Stack traces emitted in skip
messages do not give the developer useful information, as the skip
message itself contains the code location where GTEST_SKIP was used. In
addition to being noise in the output, symbolization of stack traces is
not free. In some Chromium configurations, symbolization in a skipped
test can incur a cost in excess of 25 seconds for a test that otherwise
takes 0-1ms; see https://crbug.com/1517343#c9.
In this CL, we suppress generation and emission of stack traces for
kSkip messages to reduce the output noise and overhead of GTEST_SKIP().
PiperOrigin-RevId: 598899010
Change-Id: I46926fed452c8d7edcb3d636d8fed42cb6c0a9e9
|
|
|
|
|
|
|
|
|
| |
This is a somewhat recent change for Android (I'm not clear on whether it's a recent change for NetBSD, or if Android was just very behind on its implementation), so while this worked fine as recently as API 32 devices, REG_GNU is required for API 34 (API 33 untested).
A test actually caught this, but https://github.com/google/googletest/pull/4334 "fixed" the test rather than the implementation. This CL also reverts the test change so it can catch the failure.
PiperOrigin-RevId: 571126374
Change-Id: I420dfcedea58f2c8b605f699515d744006c0a9d9
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
Fixes #4318
PiperOrigin-RevId: 560089120
Change-Id: I9d0d098140033520266747a1689e953ee8307c47
|
|\
| |
| |
| |
| | |
PiperOrigin-RevId: 557197748
Change-Id: I55b86353f5351bbcbdf8e6bca70e82d7383a5080
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| | |
guide](https://google.github.io/styleguide/pyguide#316-naming)
PiperOrigin-RevId: 557133618
Change-Id: I27202ee91ee81b3d2e4c28102190d2bde8efba05
|
| |
| |
| |
| |
| |
| |
| | |
`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
|
|\ \
| | |
| | |
| | |
| | | |
PiperOrigin-RevId: 557122083
Change-Id: I77fb7fe99baf9cbf341ad37d4b651a0ac606b549
|
| |/
| |
| |
| |
| |
| |
| |
| | |
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>
|
|/
|
|
|
| |
PiperOrigin-RevId: 557116814
Change-Id: I91e06b0d6001952366c50201b67491475a1f98af
|
|\
| |
| |
| |
| |
| |
| | |
pgawro:gtest_ExpectThrowTest_DoesNotGenerateUnreachableCodeWarning
PiperOrigin-RevId: 553485739
Change-Id: I6581215e6db514397177af39381eea4d121f32bd
|
| |
| |
| |
| | |
Modified test ExpectThrowTest.DoesNotGenerateUnreachableCodeWarning
|
| |
| |
| |
| |
| |
| |
| | |
It appears to have been unintentionally left out
PiperOrigin-RevId: 553141410
Change-Id: I8adac55a3df0ec12d6fe03446f71858fc702e178
|
|/
|
|
|
|
|
| |
This allows types that provide an AbslStringify definition to be streamed into GoogleTest macros.
PiperOrigin-RevId: 552914482
Change-Id: I5fb386980d4d24873f95f0a8ef83067a6a3c86ac
|
|
|
|
|
|
|
| |
Fixes #4314
PiperOrigin-RevId: 549986457
Change-Id: Iff74f02ab1c106696f288540e9c623d56b76e3f7
|
|
|
|
|
|
|
| |
attempt to instantiate the incomplete `testing::internal::Secret` type.
PiperOrigin-RevId: 543799815
Change-Id: Ic0a4f48d825bef26cb8cc74d8a0117b3a5ef3f14
|