Currently MacOS falls back to generic /tmp, but
for all intents and purposes it should behave like
other Unixes using the TEST_TMPDIR environment variable
if available (this environment variable is set in bazel,
which sets up a unique temp directory for the test
process).
While at it, remove an incorrect #endif comment, that
looks like a leftover from some older implementation.
PiperOrigin-RevId: 446108391
Change-Id: I118eacf6e86a41d26cb81a130f7c54cccc0c5665
Rather than branching on whether the return type is ByMoveWrapper within
ReturnAction itself, hoist the distinction to outside. This allows the main
class template to be modified without worrying about this special case, which
means we can stop using a shared pointer to the value (introduced as a
linked_ptr in commit 3d1c78b2bf to support ByMove) in this commit and simplify
the class template further in a future commit with the eventual aim of directly
supporting move-only result types.
PiperOrigin-RevId: 445938943
Change-Id: I7bc71ea301d5e493ac6ecbe57d62738a48a2721a
Commit a070cbd91c added an implicit cast to this path but didn't leave a very
clear explanation for why it was desirable, a clear example, or even test
coverage. Add a better comment and a test that fails when the implicit cast is
removed.
PiperOrigin-RevId: 444871311
Change-Id: I127982fa8d5bce9b6d1b68177c12dc0709449164
bazel build --define=absl=1 ...
A dependency on RE2 is now required when building GoogleTest with Abseil.
Using RE2 will provide a consistent cross-platform regex experience.
Users will need to add the com_googlesource_code_re2, bazel_skylib,
and platforms repository to their WORKSPACE files. See our WORKSPACE
file in the root directory of this project for an example of how to
add the dependencies.
Please note that the com_googlesource_code_re2 dependency must use a
commit from the `abseil` branch of the project:
https://github.com/google/re2/tree/abseil
PiperOrigin-RevId: 444650118
Change-Id: I45c55b26684c0c50d721a05b81c5f8a0c092400f
This is necessary for generic support of these actions, since `DoAll` is a
frequently-used action wrapper.
PiperOrigin-RevId: 444561964
Change-Id: I02edb55e35ab4207fbd71e371255a319c8253136
This provides a type-safe way for an action to express that it wants to be
called only once, or to capture move-only objects. It is a generalization of
the type system-evading hack in ByMove, with the improvement that it works for
_any_ action (including user-defined ones), and correctly expresses that the
action can only be used with WillOnce. I'll make existing actions benefit in a
future commit.
PiperOrigin-RevId: 440496139
Change-Id: I4145d191cca5655995ef41360bb126c123cb41d3
Avoid instantiating functions like std::get<index> for an out of range index
when doing SFINAE on the invocability of the action itself.
PiperOrigin-RevId: 439415110
Change-Id: Ifc20285a6d526c34830870cd1910c2b2b92e1e81
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
The one large test does not link in limited memory environments
Closes#3653
PiperOrigin-RevId: 436753193
Change-Id: Idd59b6509994fc642147b88279ee791cd1d7bdd0
Currently, the "[ DISABLED ]" banner is printed for every test in a suite.
When iterating on a single test gtest_filter this is very noisy.
PiperOrigin-RevId: 436489088
Change-Id: If337087a7a0986b073fabf2b0a55d26485eb5c37
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
This catches when a client creates an action and discards it, thinking that the action has actually been applied to something.
This will help people who make the mistake of defining, for example, both `void Use(Foo*, Bar)` and `ACTION_P(Use, bar) { Use(arg, bar); }` for later application to a Foo. With such an overload, a client may then write `Use(bar);`, selecting the Action<> overload and being confused why nothing happens.
This also catches when a client defines their own action in terms of an ACTION_P()-generated one, invokes the Action<>'s builder, and then fails to invoke the resulting action, thinking it's operating on the outer action's parameters.
PiperOrigin-RevId: 433197479
Change-Id: I98e4389150d01a5e753230113016d9fc38b1d260