Adds instructions for how to add gtest and gmock to
another CMake project directly. Downloading of the
googletest sources happens as configure time, allowing
it to be added to the main build directly via the
add_subdirectory() command. This ensures googletest is
built with the same compiler settings, etc. and will
typically result in a more robust and more convenient
build arrangement.
Put occurrences of "#include" in a code span so they are not interpreted
as headers.
Other documents were not broken because the #include was not at the
start of the line, but put them in code spans anyway just in case the
text gets refilled in the future.
The helper needs to be templated because its argument type can’t be
known. FloatingPointTest is instantiated with RawType = float and
RawType = double, so Bits will be an unsigned 32-bit or 64-bit type.
size_t will be either 32 or 64 bits depending on the system’s
definition, typically based on pointer size.
This fixes these warnings:
…\gtest\googletest\test\gtest-port_test.cc(78) : error C2220: warning treated as error - no 'object' file generated
…\gtest\googletest\test\gtest-port_test.cc(78) : warning C4309: 'static_cast' : truncation of constant value
…\gtest\googletest\test\gtest-port_test.cc(79) : warning C4309: 'static_cast' : truncation of constant value
…\gtest\googlemock\test\gmock-matchers_test.cc(2712) : error C2220: warning treated as error - no 'object' file generated
…\gtest\googlemock\test\gmock-matchers_test.cc(2706) : while compiling class template member function 'testing::gmock_matchers_test::FloatingPointTest<float>::FloatingPointTest(void)'
…\gtest\googlemock\test\gmock-matchers_test.cc(2896) : see reference to function template instantiation 'testing::gmock_matchers_test::FloatingPointTest<float>::FloatingPointTest(void)' being compiled
…\gtest\googlemock\test\gmock-matchers_test.cc(2896) : see reference to class template instantiation 'testing::gmock_matchers_test::FloatingPointTest<float>' being compiled
…\gtest\googlemock\test\gmock-matchers_test.cc(2712) : warning C4267: 'argument' : conversion from 'size_t' to 'const unsigned int', possible loss of data
…\gtest\googlemock\test\gmock-matchers_test.cc(2714) : warning C4267: 'argument' : conversion from 'size_t' to 'const unsigned int', possible loss of data
…\gtest\googlemock\test\gmock-matchers_test.cc(2716) : warning C4267: 'argument' : conversion from 'size_t' to 'const unsigned int', possible loss of data
…\gtest\googlemock\test\gmock-matchers_test.cc(2717) : warning C4267: 'argument' : conversion from 'size_t' to 'const unsigned int', possible loss of data
…\gtest\googlemock\test\gmock-matchers_test.cc(2718) : warning C4267: 'argument' : conversion from 'size_t' to 'const unsigned int', possible loss of data
…\gtest\googlemock\test\gmock-matchers_test.cc(2721) : warning C4267: 'argument' : conversion from 'size_t' to 'const unsigned int', possible loss of data
…\gtest\googlemock\test\gmock-matchers_test.cc(2723) : warning C4267: 'argument' : conversion from 'size_t' to 'const unsigned int', possible loss of data
These tuples are created with make_tuple, which is given temporaries.
The make_tuple is in a function argument list.
A possibly overzealous static_assert in libc++'s std::tuple ctor
is firing in our 'Perform(make_tuple("hi"))' calls, so
we can't use its make_tuple here. Instead we will use
explicitly-constructed tuples constructed from non-temporary strings.
Workaround for llvm bug:
https://llvm.org/bugs/show_bug.cgi?id=20855
An alternative to https://github.com/google/googletest/pull/580 .