summaryrefslogtreecommitdiffstats
path: root/googletest
Commit message (Collapse)AuthorAgeFilesLines
* Address fallout from -Wsign-conversion work on WindowsEnji Cooper2019-04-262-3/+4
| | | | | | | | Some Windows users builds were broken after a0d60be. This change addresses the lingering -Wsign-conversion issues with those platforms by adding some missing `static_cast` calls as needed. Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
* Googletest exportAbseil Team2019-04-244-6/+37
| | | | | | | | Add GTEST_FAIL_AT, an equivalent to ADD_FAILURE_AT but that spawns a fatal failure rather than a non-fatal, eg. the equivalent of an ASSERT* failure rather than an EXPECT* failure. PiperOrigin-RevId: 244746609
* Googletest exportmisterg2019-04-181-2/+2
| | | | | | Fixes https://github.com/google/googletest/issues/2232 PiperOrigin-RevId: 244237560
* Googletest exportmisterg2019-04-183-12/+18
| | | | | | Expose more information in SuiteApiResolver diagnostic output PiperOrigin-RevId: 244179347
* Merge pull request #2170 from ngie-eign:issue-2146-ver2Gennadiy Civil2019-04-1812-68/+90
|\ | | | | | | PiperOrigin-RevId: 244069956
| * clang: fix `-Wsign-conversion` errorsEnji Cooper2019-04-0512-60/+78
| | | | | | | | | | | | | | | | | | | | | | Cast some values as their unsigned equivalents or `size_t` to match the parameter type used for the template object under test. Also, provide UInt32 equivalent delegate methods for some callers (with int-equivalents for backwards compatibility). This closes #2146. Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
* | Googletest exportAbseil Team2019-04-161-1/+1
| | | | | | | | | | | | [googletest] Fix death test condition. PiperOrigin-RevId: 243742424
* | Googletest exportAbseil Team2019-04-161-2/+6
| | | | | | | | | | | | | | | | | | Migrate ZX_WAIT_ASYNC_REPEATING to ZX_WAIT_ASYNC_ONCE ZX_WAIT_ASYNC_REPEATING is deprecated so convert code to use ZX_WAIT_ASYNC_ONCE instead. PiperOrigin-RevId: 243707147
* | Sort Haiku platform definition alphabetically.Calvin Hill2019-04-121-2/+2
| | | | | | | | | | Fixes a minor ordering issue when defining the platform macro. Also fixes a minor typo: 'Max OS X' -> 'Mac OS X'.
* | Merge pull request #2226 from davidben:msvc-5046Gennadiy Civil2019-04-111-2/+9
|\ \ | | | | | | | | | PiperOrigin-RevId: 243121568
| * | MSVC C5046 warning is unavailable in MSVC 2015.David Benjamin2019-04-091-2/+9
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Merge pull request #2229 from return:haiku-supportGennadiy Civil2019-04-113-32/+36
|\ \ | | | | | | | | | PiperOrigin-RevId: 243104604
| * | Add Haiku platform support.Calvin Hill2019-04-112-3/+7
| |/ | | | | | | | | This allows googletest to recognize the Haiku operating system when running tests in other projects.
* | replace test case with test suite in the primerRong Ou2019-04-111-19/+19
| |
* | add missing periodRong Ou2019-04-091-1/+1
|/
* Merge pull request #2148 from ngie-eign:clang-add-explicit-c++11-rtti-flagGennadiy Civil2019-04-051-0/+1
|\ | | | | | | PiperOrigin-RevId: 242038269
| * clang: explicitly enable/disable RTTI support with the compilerEnji Cooper2019-04-031-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add `-frtti` to the compiler with the base flags case so that RTTI is enabled by default with clang. Add its inverse analog, `cxx_no_rtti_flags` in order to test the case with RTTI off, similar to gcc. This reduces the amount of testing/support overhead needed in the non-RTTI case with clang, as the tests currently fail when these two features are off with version 1.8.1. This something I used in when investigating test failures on FreeBSD, as the tests that rely on RTTI were failing with googletest 1.8.1 on the OS platform. More investigation is being done to determine how this should be fixed on FreeBSD 11.2-RELEASE with ports, as the package doesn't currently compile the tests, and when enabled (based on my WIP diff), the tests fail in similar ways. Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
* | Googletest exportAbseil Team2019-04-051-5/+5
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [fdio] Improve fdio_pipe_half signature, step 3. The return value on fdio_pipe_half conflated two things: the error code on failure (as a zx_status_t) or a file descriptor on success. This technically worked, because they're both ints, the error code was always negative, and the file descriptor always positive. However, the stated return type of zx_status_t was misleading. This changes the signature such that it always returns an actual zx_status_t, and the file descriptor is returned through a pointer argument. Also remove the last argument, since it was always given the same value. This needs to be done as a soft transition because it's called from the Dart runtime, from googletest, and from Crashpad, and Crashpad and Chromium both depend on googletest on Fuchsia. The steps are as follows: 1) Add fdio_pipe_half2. 2) Update Dart to use fdio_pipe_half2. 3) Update googletest to use fdio_pipe_half2. 4) Roll updated googletest into Chronium. 5) Update Crashpad to use fdio_pipe_half2 and roll updated googletest into it. 6) Update fdio_pipe_half to match fdio_pipe_half2. 7) Update Dart to use fdio_pipe_half again. 8) Update googletest to use fdio_pipe_half again. 9) Roll updated googletest into Chronium. 10) Update Crashpad to use fdio_pipe_half again and roll updated googletest into it. 11) Remove fdio_pipe_half2. This is step 3. PiperOrigin-RevId: 241957137
* Merge pull request #2203 from ngie-eign:issue-2189Gennadiy Civil2019-04-037-5/+150
|\ | | | | | | PiperOrigin-RevId: 241803437
| * Handle GTEST_SKIP() when calling `Environment::SetUp()`Enji Cooper2019-03-306-5/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gtest prior to this change would completely ignore `GTEST_SKIP()` if called in `Environment::SetUp()`, instead of bailing out early, unlike `Test::SetUp()`, which would cause the tests themselves to be skipped. The only way (prior to this change) to skip the tests would be to trigger a fatal error via `GTEST_FAIL()`. Desirable behavior, in this case, when dealing with `Environment::SetUp()` is to check for prerequisites on a system (example, kernel supports a particular featureset, e.g., capsicum), and skip the tests. The alternatives prior to this change would be undesirable: - Failing sends the wrong message to the test user, as the result of the tests is indeterminate, not failed. - Having to add per-test class abstractions that override `SetUp()` to test for the capsicum feature set, then skip all of the tests in their respective SetUp fixtures, would be a lot of human and computational work; checking for the feature would need to be done for all of the tests, instead of once for all of the tests. For those reasons, making `Environment::SetUp()` handle `GTEST_SKIP()`, by not executing the testcases, is the most desirable solution. In order to properly diagnose what happened when running the tests if they are skipped, print out the diagnostics in an ad hoc manner. Update the documentation to note this change and integrate a new test, gtest_skip_in_environment_setup_test, into the test suite. This change addresses #2189. Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
* | Googletest exportAbseil Team2019-04-032-4/+4
| | | | | | | | | | Typos: "more then" -> "more than". PiperOrigin-RevId: 241483698
* | Googletest exportAbseil Team2019-04-013-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Googletest exportAbseil Team2019-04-0114-442/+8
|/ | | | | | | | 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
* Googletest exportAbseil Team2019-03-285-336/+518
| | | | | | Update XML and JSON output to be consistent with the standard. PiperOrigin-RevId: 239833242
* Update Xcode project fileSyohei YOSHIDA2019-03-261-16/+4
| | | | | - Remove files which no longer exists - Add newer file
* Merge pull request #2193 from antismap/patch-1Gennadiy Civil2019-03-211-0/+2
|\ | | | | Note about INSTANTIATE_TEST_SUITE_P / INSTANTIATE_TEST_CASE_P
| * Update googletest/docs/advanced.mdGennadiy Civil2019-03-211-1/+1
| | | | | | Co-Authored-By: antismap <michael.thenault@gmail.com>
| * Note about INSTANTIATE_TEST_SUITE_P / INSTANTIATE_TEST_CASE_P keyword changeantismap2019-03-211-0/+2
| | | | | | See https://github.com/google/googletest/issues/2065
* | Merge pull request #2180 from twam:masterGennadiy Civil2019-03-211-4/+6
|\ \ | | | | | | | | | PiperOrigin-RevId: 239404016
| * | Remove old_crtdbg_flag_ member if not requiredTobias Müller2019-03-191-4/+6
| |/
* | Googletest exportAbseil Team2019-03-212-7/+3
|/ | | | | | Remove mention of unused type ProtocolMessage. PiperOrigin-RevId: 239242706
* Merge pull request #2158 from CarloWood:masterGennadiy Civil2019-03-051-1/+1
|\ | | | | | | PiperOrigin-RevId: 236716851
| * Minor build system fixes.Carlo Wood2019-03-011-1/+1
| |
* | Googletest exportAbseil Team2019-03-053-98/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Googletest exportAbseil Team2019-03-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Build gmock cleanly with clang -Wextra-semi and -Wextra-semi-stmt Extends 56ef07a20308 to take -Wc++98-compat-extra-semi (https://reviews.llvm.org/D43162) and -Wextra-semi-stmt (https://reviews.llvm.org/D52695) into account. For https://crbug.com/926235. PiperOrigin-RevId: 236643095
* | Googletest exportAbseil Team2019-03-012-1/+10
|/ | | | | | | | | | | | | | 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
* Googletest exportAbseil Team2019-02-256-2883/+134
| | | | | | Replace more pump'd code with variadic templates. PiperOrigin-RevId: 235584585
* Fix grammatical error in primer.mdRyan Sinnet2019-02-251-1/+1
|
* Merge pull request #2147 from ↵Gennadiy Civil2019-02-221-1/+1
|\ | | | | | | | | | | ngie-eign:gtest-test-death-test-dont-hardcode-test-name PiperOrigin-RevId: 235248114
| * Don't hardcode the filename in ↵Enji Cooper2019-02-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `CxxExceptionDeathTest.PrintsMessageForStdException` Due to some caveats in the FreeBSD build system and the fact that the source file is used to compile 2 different death tests with different flags, I needed (as a shortterm workaround) to copy the test to 2 differently named files. While this works for compiling the test, as I discovered, this doesn't work with running `CxxExceptionDeathTest.PrintsMessageForStdException`, as the testcase hardcodes `googletest-death-test_ex_test.cc`. Use `__FILE__` when looking for failures, as opposed to looking for the hardcoded name as it can vary depending on how the test was built. Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
* | Merge pull request #2126 from ngie-eign:clang-add-more-strict-warningsGennadiy Civil2019-02-221-0/+1
|\ \ | |/ |/| | | PiperOrigin-RevId: 235220570
| * Add `cxx_strict_flags` for clang to match FreeBSD's WARNS flagsEnji Cooper2019-02-131-0/+1
| | | | | | | | Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
* | Merge pull request #2137 from ngie-eign:clang-ignore-sign-conversionGennadiy Civil2019-02-213-8/+7
|\ \ | | | | | | | | | PiperOrigin-RevId: 235012245
| * | Ignore `-Wsign-conversion` issuesEnji Cooper2019-02-181-1/+1
| |/ | | | | | | | | | | | | | | | | | | clang++ compilation when `-Wsign-conversion` is currently broken and the issues within the code are varied and widespread. For the time being ignore `-Wsign-conversion` issues, even though some of them are valid and bleed over into issues that would be found with `-Wtautological-compare`, et al. Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
* | Merge pull request #2061 from samolisov:building-with-bazel-as-a-dll-on-windowsGennadiy Civil2019-02-202-6/+7
|\ \ | | | | | | | | | PiperOrigin-RevId: 234845565
* \ \ Merge pull request #2123 from ngie-eign:clang-inconsistent-missing-overrideGennadiy Civil2019-02-201-1/+1
|\ \ \ | | |/ | |/| | | | PiperOrigin-RevId: 234840107
* | | Googletest exportAbseil Team2019-02-201-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | Update gtest-death-test to use new Fuchsia API Fuchsia has renamed this API and removed the need for several parameters. We now use the newer, simpler API. PiperOrigin-RevId: 234617715
* | | Avoid array index out of rangeDiomidis Spinellis2019-02-201-1/+1
|/ / | | | | | | Issue: #2140
* | Merge pull request #2112 from knuto:pr/fix_null_pointerGennadiy Civil2019-02-132-5/+6
|\ \ | | | | | | | | | PiperOrigin-RevId: 233825166
| * | Stop TestInfo::Run() calling a function through null pointerJonathan Wakely2019-02-111-1/+3
| | | | | | | | | | | | | | | | | | | | | If the object was never created then trying to call &Test::DeleteSelf_ will dereference a null pointer, with undefined behaviour. Fixes #845
OpenPOWER on IntegriCloud