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
If this ever turns out to be a performance issue, we could use std::conditional and std::is_same to avoid copying std::strings.
Fixes#3949
PiperOrigin-RevId: 465353572
Change-Id: If2d691bccb626c692c87e006df5afe88a4ed1542
PDB files should be created at the same location as their primary
artifact, which is either static library or a DLL.
On Windows, an artifact location is controlled by:
* RUNTIME_OUTPUT_DIRECTORY is a directory of a DLL artifact.
* ARCHIVE_OUTPUT_DIRECTORY is a directory of a LIB artifact.
A PDB file location is controlled:
* PDB_OUTPUT_DIRECTORY should match a directory of a DLL artifact.
* COMPILE_PDB_OUTPUT_DIRECTORY should match a directory of a LIB artifact.
CMake policy CMP0094 controls a lookup strategy used to find a Python
executable:
* CMP0094=OLD selects a Python executable with a higher version.
* CMP0094=NEW selects a Python executable found earlier in PATH.
NEW behavior is critical in presence of a Python virtual environment
established and activated, i.e. added to the PATH variable.
In case GoogleTest is embedded into a larger project, the result of
`find_package(Python)` affects the whole build, not only GoogleTest
component itself.
v1.12.x is the last branch to support C++11
Future releases will require at least C++14
PiperOrigin-RevId: 458250106
Change-Id: Ibee2248649ff3c13daaa179135887848bf730f3f
Note that this is 1.12.1 as there will be a patch release to fix this
PiperOrigin-RevId: 458216994
Change-Id: Ibca52a8db22ed06cb1a1adc4832be67fce69459a
Some Mock constructors insert the pointer to the Mock itself into a
global registry. Since GCC cannot see how the pointer is used (only as
an identifier), it cannot tell that the object doesn't need to be
initialized at that point at all. Work around this by using uintptr_t
instead.
PiperOrigin-RevId: 452380347
Change-Id: Ia5a493057ed90719de1d0efab71de9a8a08ddf8b
This fixes unused parameter errors under both MSVC and clang (when
`-Werror=unused-parameter` is used, as reported
[here](9d21db9e0a (r74769946))).
Fixes#3858
PiperOrigin-RevId: 451907906
Change-Id: Ic07da19ea6a547eb1797fbbab19cd57cc2a83fe8
Do this by ripping out the "untyped perform action" machinery, which isn't
necessary: we can simply template the entry point on the result type, and use
RAII to avoid the need to special case void. This makes it easier to understand
the code and harder to introduce type-related undefined behavior, to boot.
PiperOrigin-RevId: 451493451
Change-Id: I225305f83164752ca92f2916721972eafba33168
Previously this excluded callables that return non-moveable types. This is the
same as the
[libc++ std::is_invocable_r bug](https://github.com/llvm/llvm-project/issues/55346)
fixed by
[this commit](https://github.com/llvm/llvm-project/commit/c3a24882903d): it's
wrong to use std::is_convertible for checking the return type, since (despite
its name) that doesn't check the standard-defined notion of "implicitly
convertible". Instead we must base the check on whether the source type can be
used as an argument to a function that accepts the destination type.
PiperOrigin-RevId: 451341205
Change-Id: I2530051312a0361ea7a2ce26993ae973c9242089
In order to make the diff more readable in an upcoming commit that requires the
method to be templated on the action's result type.
PiperOrigin-RevId: 451157029
Change-Id: I57beb7544efccd0459efb3a1f039ea45cd7c7602
`Return(x)` can now be used directly with `WillOnce` (the only place it makes
sense in the type system), without using `ByMove`.
PiperOrigin-RevId: 448380066
Change-Id: Ia71cc60ccbc3b99720662731a2d309735a5ce7c8
It doesn't make semantic sense for the conversion to modify the input, and the
fact that it's allowed to do so appears to have just been a historical accident.
PiperOrigin-RevId: 448135555
Change-Id: Id10f17af38cf3947ee25fe10654d97527173ebfc
The way temporary directories were discovered from
environment variables in different operating systems
was inconsistent.
On Windows, only the system-specific environment variable
TEMP was considered, but not the bazel-common TEST_TMPDIR.
On Unix, only TEST_TMPDIR was considered, but not
the otherwise typical system specific TMPDIR.
Now, always consider TEST_TMPDIR first, followed by the
system-typical environment variable (TEMP on Windows, TMPDIR on Unix)
before falling back to a default on that particular system.
Also: the value for the temporary directory coming from the
environment variable was only checked for a trailing directory
separator on Windows (and appended if needed), not on the other
platforms.
Make this also consistent accross the systems: Now always apply
the same logic to all of these (to accomodate
tests that just concatenate TempDir() without directory separator).
PiperOrigin-RevId: 447909830
Change-Id: I9ea17acdf5944eb2a965615fd9cf142878c33a58
Better document requirements, API decisions, and historical accidents. Make an
implicit conversion easier and in a more appropriate place, and ease the burden
of some assertions in the conversion operator. Stop using the legacy
ActionInterface style for defining the action.
PiperOrigin-RevId: 447894892
Change-Id: I179e23ec2abdd9bf05c204ab18dbb492f1372e8e
So that it can be referenced in conversion operators for actions that need to
know the concrete return type.
PiperOrigin-RevId: 447889344
Change-Id: I643d3298bc8effd08741282a956c221f9d67d378
This CL adds a couple missing overrides in the googletest sources.
These were found downstream when -Wsuggest-override and
-Wsuggest-destructor-override were enabled.
PiperOrigin-RevId: 447754883
Change-Id: I7bf35a8757cbc5ae157827037aa3d13f47392406
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