instead of reading more like reversing the former "expected" and "actual"
roles of the LHS and RHS arguments.
This patch is manually applied from internal version (125109873)
It's not necessary, as the target_link_libraries command contains an
absolute path already, and the path given doesn't exist anymore,
leading only to linker warnings like:
ld: warning: directory not found for option
'-L/Users/travis/build/google/googletest/build/googlemock/gtest/src'
As mentioned in issue #360:
"Now that all the platforms gtest supports work with value-parameterized
tests, we should remove the uses of the GTEST_HAS_PARAM_TESTS macro from
the codebase everywhere."
https://github.com/google/googletest/issues/360
When using INSTANTIATE_TEST_CASE_P with a lambda function which uses
'info' as parameter name, GCC complains that this would shadow
parameter 'info' used in the macro's VA_ARGS call.
If the user's cmakelists.txt first look for threads using
find_package(Threads), then set(gtest_disable_pthreads ON),
and then include googletest. GoogleTest will not look for
threads. But since they have already been found before in
user's cmakelists, it will use them regardless.
This helped me fix build issue in darktable-org/rawspeed
on windows/MSYS2, even though there are threads, and they
are usable, googletest build was failing with issues
about AutoHandle. I was first looking for threads, and only
then including googletest, so no matter the value of
gtest_disable_pthreads, it failed.
The other obvious solution is for user to first include
googletest, and only then look for threads by himself.
On single-configuration build systems as Makefile Generators, there is
no subdirectory for the configuration in the build tree - therefore ask
cmake for the subdir by using CMAKE_CFG_INTDIR, which is just '.' on
single-configuration build systems (Linux et al.).
This change speeds up the runtime of a value-parameterized test I have
which has lots of values with large strings full of unprintable
characters by 2x. I profiled it and traced most of the slowness during
googletest startup down to the way String::FormatHexInt was creating and
destroyed a stringstream for each character in the string for each
value.
VS2010 solution only to simplify old users (who used these solutions) upgrading to new gtest/gmock, new users should use CMake generated solutions. VS2010 solution can be opened in any new VS.
This policy setting will silence a warning when using with a visibility settings on targets. Due to the forced `cmake_minimum_version`, policy settings in CMakeLists calling this one (including the main CMakeLists) are lost, forcing the change to be made here.
Modify library install destinations to install .dll's to the correct
location (`bin`, not `lib`), and to install other artifacts to the
correct platform-dependent location by using GNUInstallDirs. This is
required for some distributions (e.g. Fedora) and will fix an issue that
otherwise requires those distributions to patch the upstream sources.
Also, add options to suppress installation, which may be useful for
projects that embed Google Test.
Since Google Test is trying to support archaic versions of CMake, a
brain-dead fallback (which requires that the user set either LIB_SUFFIX
or CMAKE_INSTALL_LIBDIR themselves) is included for versions that
predate GNUInstallDirs.
Fixes#1161.
Co-Authored-By: d3x0r <d3x0r@users.noreply.github.com>
MSVC has an optional warning which flags when 32-bit pointers get cast
into a 64-bit value. This is a little overaggressive I think, but to
ease compiling in projects with aggressive warnings, fix this by just
casting to const void * directly. Modern GCCs seem to compile it just
fine.
The rest of the (covered) codebase is already integer overflow clean.
This is a cherry-pick of an internal change.
TESTED=gtest_shuffle_test goes from fail to pass with -fsanitize=integer
The documentation of former versions is available in the history (e.g.
by checking out the appropriate git tags), so there is no need to keep
them in parallel to the current documentation.
Use `EXCLUDE_FROM_ALL` in `add_subdirectory` to prevent `make install` from including lots of headers from gtest/gmock.
```
add_subdirectory(${CMAKE_BINARY_DIR}/googletest-src
${CMAKE_BINARY_DIR}/googletest-build
EXCLUDE_FROM_ALL)
```
Re-use existing background color for Widows' console window.
This fixes a problem where the background color for ColoredPrintf would be BLACK even if the user's console is using a different BG color.
This merges a Google-internal change (117235625).
Original CL description:
This CL was created manually in about an hour with sed, a Python script
to find all the places unqualified 'string' was mentioned, and some help
from Emacs to add the "std::" qualifications, plus a few manual tweaks.
This upstreams a Google-internal change.
Original CL description:
The C++ standard says that function pointers are not implicitly
convertible to object pointers. Visual Studio disregards that and allows
implicit conversion between function pointers and object points, and
enough code relies on this that clang follows suit in
Microsoft-compatibility mode.
However, clang emits a -Wmicrosoft-cast warning when such a conversion
is done:
E:\b\c\b\win_clang\src\sandbox\win\src\sync_dispatcher.cc(42,7):
warning: implicit conversion between pointer-to-function and
pointer-to-object is a Microsoft extension [-Wmicrosoft-cast]
This change fixes this warning in gtest, while hopefully not changing
any behavior. The change does two things:
1. It replaces the if in DefaultPrintTo with SFINAE
2. In C++11 mode, it uses enable_if<is_function<>> instead of
ImplicitlyConvertible<T*, const void*> to check if the
explicit cast is needed.
With this change, functions will use the branch with the reintpret_casts
with Visual Studio and clang/win, and clang no longer needs to warn
that it implicitly converts a function pointer to a void pointer.
Fixes the following errors:
hash_map(17): error C2338: <hash_map> is deprecated and will be REMOVED. Please use <unordered_map>. You can define _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS to acknowledge that you have received this warning. [googlemock\gtest\gtest-printers_test.vcxproj]
hash_set(17): error C2338: <hash_set> is deprecated and will be REMOVED. Please use <unordered_set>. You can define _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS to acknowledge that you have received this warning. [googlemock\gtest\gtest-printers_test.vcxproj]
googletest\test\gtest_catch_exceptions_test_.cc(152): error C2220: warning treated as error - no 'object' file generated
googletest\test\gtest_catch_exceptions_test_.cc(152): warning C4297: 'CxxExceptionInDestructorTest::~CxxExceptionInDestructorTest': function assumed not to throw an exception but does
googletest\test\gtest_catch_exceptions_test_.cc(152): note: destructor or deallocator has a (possibly implicit) non-throwing exception specification
There were already some checks for _MSC_VER in the code, so this commit
continues in that vein.
`gtest-config --version` reports wrong version.
Made against master branch but please note that this affects tag release-1.8.0 and the distribution tarballs.