| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|\ \
| | |
| | |
| | | |
PiperOrigin-RevId: 243121568
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Per the MSVC documentation the warning is new as of Visual Studio 2017,
version 15.8.
https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/c5046?view=vs-2019
GTest users building on MSVC 2015 or older versions of 2017 will, when
C4616 is enabled, see a warning like:
[...]gtest-matchers.h(53): error C2220: warning treated as error - no 'object' file generated
[...]gtest-matchers.h(53): warning C4619: #pragma warning: there is no warning number '5046'
Guard the mention of 5046 by an _MSC_VER check. VS2017 15.8 corresponds
to an _MSC_VER of 1915.
https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros?view=vs-2019
|
|\ \
| |/
|/|
| | |
PiperOrigin-RevId: 243104604
|
|/
|
|
|
| |
This allows googletest to recognize the Haiku operating system when
running tests in other projects.
|
|
|
|
|
| |
Typos: "more then" -> "more than".
PiperOrigin-RevId: 241483698
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add HWASan annotations.
These mirror existing ASan annotations.
HWASan uses memory (address) tagging to detect memory errors:
https://clang.llvm.org/docs/HardwareAssistedAddressSanitizerDesign.html
It inserts a random tag in the MSB of heap and stack allocation addresses. This tag dominates pointer comparison in StackGrowsDown(), making the result non-deterministic, and entirely unrelated to the actual stack growth direction. The function attribute disables this behavior.
The annotations in gtest-printers are there because the printers are used to basically dump memory. The sanitizers may have ideas why this memory should not be accessed, and that is counter productive. In particular, the test may access only part of an array, but in case of a test failure gtest will dump the entire array which may contain uninitialized bytes - that's what SANITIZE_MEMORY annotation is for. There are similar reasons for ADDRESS and THREAD annotations. HWADDRESS in its current implementation can not cause issues there, I believe, but it falls under the same umbrella of tools whose checking should not apply to test printers because it is not the code under test.
PiperOrigin-RevId: 241379822
|
|
|
|
|
|
|
|
| |
Remove support for "global" ::string and ::wstring types.
This support existed for legacy codebases that existed from before namespaces
where a thing. It is no longer necessary.
PiperOrigin-RevId: 241335738
|
|
|
|
|
|
| |
Remove mention of unused type ProtocolMessage.
PiperOrigin-RevId: 239242706
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix emission of -Wzero-as-null-pointer-constant when comparing integers.
The following code fails to compile:
#pragma clang diagnostic error "-Wzero-as-null-pointer-constant"
void foo() {
EXPECT_EQ(0, 0);
}
This happens because gtest checks the first argument to EXPECT_EQ and
ASSERT_EQ is a null pointer constant. The magic it does to do this causes the
warning to be emitted.
This patch removes that check. It replaces the explicit check with a Compare
overload that can only be selected when 0 or nullptr is passed on the LHS
with a pointer on the right.
This patch does not suppress -Wzero-as-null-pointer-constant when users
are actually using it as NULL.
PiperOrigin-RevId: 236654634
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Let embedders customize GTEST_INTERNAL_DEPRECATED().
GTEST_INTERNAL_DEPRECATED is currently used to nudge googletest users to migrate off old TEST_CASE macros to the new TEST_SUITE macros. This move is non-trivial for Chromium (see https://crbug.com/925652), and might be difficult for other big projects with many dependencies.
This CL facilitates moving off of deprecated APIs by making it possible for an embedder to define GTEST_INTERNAL_DEPRECATED() in gtest/internal/custom/gtest-port.h. Example usage:
1) #define GTEST_INTERNAL_DEPRECATED() to nothing, to disable deprecation warnings while migrating off googletest's deprecated APIs. This can be preferable to having to disable all deprecation warnings (-Wno-error=deprecated or -Wno-deprecated-declarations).
2) #define GTEST_INTERNAL_DEPRECATED() for an unsupported compiler.
PiperOrigin-RevId: 236171043
|
|
|
|
|
|
| |
Replace more pump'd code with variadic templates.
PiperOrigin-RevId: 235584585
|
|
|
|
|
|
|
|
|
|
| |
As noted in the patch description:
* Add DragonFly and GNU/kFreeBSD support.
* Implement GetThreadCount() for BSDs.
1. https://svnweb.freebsd.org/ports/head/devel/googletest/files/patch-bsd-defines?revision=488934
Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
|
|
|
|
|
|
| |
Internal changes.
PiperOrigin-RevId: 232953166
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix matcher comparisons for std::reference_wrapper.
The googletest docs indicate that std::reference_wrapper should be used to for
objects that should not be copied by the matcher (in fact, the ByRef() function
is basically the same as a call to std::cref).
However, for many types (such as std::string), the overloaded operator== will
not resolve correctly. Specifically, this is problematic if operator== depends
on template argument deduction, where the same type is named on LHS and RHS.
Because template argument deduction happens before any implict conversions for
purposes of overload resolution, attempting to compare T with
std::reference_wrapper<T> simply looks like a comparison of unlike types.
For exapmle, std::reference_wrapper<std::string> is implicitly convertible to
'const std::string&', which would be able to choose an overload specialization
of operator==. However, the implicit conversion can only happen after template
argument deduction for operator==, so a specialization that would other be an
applicable overload is never considered.
Note also that this change only affects matchers. There are good reasons that
matchers may need to transparently hold a std::reference_wrapper. Other
comparisons (like EXPECT_EQ, et. al.) don't need to capture a reference: they
don't need to defer evaluation (as in googlemock), and they don't need to avoid
copies (as the call chain of matchers does).
PiperOrigin-RevId: 232499175
|
|
|
|
|
|
|
|
| |
Address -Wgnu-zero-variadic-macro-arguments
Originally in OSS PR #2063 https://github.com/google/googletest/pull/2063
Fix regression in INSTANTIATE_TEST_SUITE_P macro to accept function pointers properly.
PiperOrigin-RevId: 232316698
|
|
|
|
|
|
| |
Mark legacy _TEST_CASE_ macros as deprecated
PiperOrigin-RevId: 232303251
|
|
|
|
|
|
|
| |
Update example code in gtest.h to prefer override over virtual now
that it is widely available in C++11.
PiperOrigin-RevId: 232057792
|
|\
| |
| |
| | |
PiperOrigin-RevId: 231456275
|
|\ \
| |/
| |
| | |
PiperOrigin-RevId: 231434457
|
| | |
|
|\ \
| |/
|/|
| | |
PiperOrigin-RevId: 230554814
|
| | |
|
| | |
|
| |\ |
|
| | |
| | |
| | |
| | |
| | |
| | | |
Improved flexibility by removing the Arduino entry points in favor of manual calls to setup/loop that the user can call from their entry point. This is the more common use case for Arudino.
Also added the gtest/gmock_main files to the PlatformIO ignore list since we are not supporting that feature.
|
| | |
| | |
| | |
| | |
| | |
| | | |
Add move-only argument support to almost all remaining matchers.
PiperOrigin-RevId: 229030728
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Deduplicate testing::ReferenceWrapper with std::reference_wrapper.
Minor cleanups in matchers_test.
PiperOrigin-RevId: 229022872
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Fix warning about deprecation of implicit operations such as copy constructors or assignment operators.
Specifically:
MatcherBase's default copy constructor, assignment operator, move operator, and move assignment operator are now declared explicitly rather than depending on the compiler implicit generation (which is disallowed/warned against due to MatcherBase's declaration of the destructor).
PiperOrigin-RevId: 228573333
|
|\ \ \
| | | |
| | | |
| | | | |
PiperOrigin-RevId: 228337465
|
| | |/
| |/| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Replace testing::internal::ImplicitlyConvertible with std::is_convertible
Fixes #2054
PiperOrigin-RevId: 228334305
|
|/ /
| |
| |
| |
| |
| | |
Fix GTEST_IS_NULL_LITERAL_ for types that have magic implicit conversions.
PiperOrigin-RevId: 227879345
|
| |
| |
| |
| |
| |
| | |
Fixes #1261
PiperOrigin-RevId: 227740670
|
| |
| |
| |
| |
| |
| | |
TestCase->TestSuite refactoring
PiperOrigin-RevId: 227702164
|
| |
| |
| |
| |
| |
| | |
Internal Change
PiperOrigin-RevId: 227575279
|
| |
| |
| |
| |
| |
| |
| |
| | |
Remove the #ifs for old, unsupported and buggy compilers:
* old versions of GCC & MSVC
* Symbian
PiperOrigin-RevId: 227116941
|
| |
| |
| |
| | |
PiperOrigin-RevId: 227030722
|
| |
| |
| |
| |
| |
| | |
Add public entry point testing::RegisterTest.
PiperOrigin-RevId: 226350937
|
| |
| |
| |
| |
| |
| | |
Unifdef c++11-related macros from googletest now that it requires C++11.
PiperOrigin-RevId: 225905601
|
|/
|
|
|
|
| |
Remove GTEST_REFERENCE_TO_CONST_ usage from GMock. In C++11, it's redundant.
PiperOrigin-RevId: 225719210
|
|
|
|
|
|
| |
Internal Change
PiperOrigin-RevId: 225231727
|
|\
| |
| |
| | |
PiperOrigin-RevId: 224054240
|
|/ |
|
|
|
|
|
|
| |
Applied fixes for ClangTidy modernize-use-override and modernize-use-using.
PiperOrigin-RevId: 223800219
|
|
|
|
|
|
| |
Accept gmock matchers in EXPECT_EXIT and friends to allow matches other than simple regex matches on death output.
PiperOrigin-RevId: 223035409
|
|
|
|
|
|
| |
Internal Change
PiperOrigin-RevId: 222123106
|
|
|
|
|
|
| |
Point IWYU at an existent path.
PiperOrigin-RevId: 221797154
|
|
|
|
|
|
| |
Move the Matcher<T> interface to googletest so I can use it to extend death test regex matching in a subsequent change.
PiperOrigin-RevId: 221675910
|
| |
|
| |
|