Add option (default to disabled) to make C++ type parameterized tests (TYPED_TEST_P) fail when they're not instantiated.
When an un-instantiated TYPED_TEST_P is found, a new test will be inserted that emits a suitable message. For now, that is just a notice, but the hope it to flip the bit to make it fail by default.
PiperOrigin-RevId: 286408038
Use C++11 variadic templates for InvokeArgumentAdl in gmock-generated-actions.h.
Make InvokeArgumentAdl use variadic templates to generate its overloads instead
of using pump.py syntax.
PiperOrigin-RevId: 286267615
Use C++11 variadic templates for InvokeArgumentAdl in gmock-generated-actions.h.
Make InvokeArgumentAdl use variadic templates to generate its overloads instead
of using pump.py syntax.
PiperOrigin-RevId: 286148805
Don't use fully qualified ::std types in code examples.
Having a nested user-defined 'std' namespace anywhere in a program is a minefield and shouldn't be either explicitly supported or implicitly condoned.
PiperOrigin-RevId: 285790182
This reverts commit 20b5b8ecc7.
Reason for revert: Breaks existing applications, such as ANGLE
(angleproject.org), requires adding an extra prefix that needs to be
typed for no reason (when testing from command line) and increases the
logs' sizes by a non-trivial amount due to the very large number of
tests ANGLE runs.
Original commit message:
Add a compile time check to ensure that the parameters to TEST_P and
INSTANTIATE_TEST_SUITE_P are not empty. Some compilers already fail
in that case and, even where it works, it's likely to result in
technically invalid code by virtue of creating reserved identifiers:
https://en.cppreference.com/w/cpp/language/identifiers
First, every project is perfectly capable of adding a prefix if they
want to support such a compiler. This change penalizes every
project.
Second, using a prefix such as `_p` also results in reserved
identifiers, so this change is not really solving the problem. For that
matter, instead of generating `gtest_##prefix##...`, you can generate
`gtest_x##prefix##...` to correctly fix the issue, including when empty
prefixes are used.
This reverts commit 4c25e2b87f.
Reason for revert: Reverting the commit that disallows empty prefixes.
Original commit message:
Remove a test case rendered obsolete by disallowing empty argument for INSTANTIATE_TEST_SUITE_P.
Remove the code that it was testing.
Empty arguments can be passed to macros per C99 and C++11 specs, which
can then be forwarded to other macros.
Visual Studio's compiler has a bug in the following situation:
#define A(x) #x
#define B(x, y) A(x)
B(, b)
In the above case, Visual Studio first expands x to nothing, then
complains that A is not invoked with the right amount of arguments.
However, x in A(x) is still one argument, even if it expands to no
preprocessing tokens. See also https://stackoverflow.com/a/7674214.
Use C++11 variadic templates for ActionHelper in gmock-generated-actions.h.
Make ActionHelper use variadic templates to generate Perform static member function specializations instead of using pump.py syntax.
PiperOrigin-RevId: 284988441
Detect when C++ parametric tests (TEST_P) are not instantiated.
When an un-instantiated TEST_P is found, a new test will be inserted that will emit a warning message.
This can be made to error with minor code edits.
In the future, that is intended to be the default.
PiperOrigin-RevId: 284901666
Change googletest to notice failures during SetUpTestSuite() and TearDownTestSuite().
Previously, errors that occurred during those functions were logged but otherwise ignored. After this change, such failures will cause the test to fail and a brief summary will be printed at the bottom of the test log.
See https://github.com/google/googletest/issues/2330.
PiperOrigin-RevId: 284033342
Clarify use of IsTrue and IsFalse matchers.
These matchers are subtle and confusing: what are they for?
The docs in the code are clear, but not very accessible.
googletest/googlemock/include/gmock/gmock-more-matchers.h
PiperOrigin-RevId: 283393275
Make generating goldens work with Python 3
golden_file.write(output) fails with Python 3 with:
TypeError: a bytes-like object is required, not 'str'
PiperOrigin-RevId: 282316101
Use standard C++11 integer types in gtest-port.h.
Remove testing::internal::{Int,Uint}{32,64} in favor of types
guaranteed to be in <cstdint> since C++11.
Tests for built-in integer type coverage are switched from
{Int,Uint}64 to [unsigned] long long, which is guaranteed by
C++11 to exist and be at least 64-bit wide.
PiperOrigin-RevId: 281565263