summaryrefslogtreecommitdiffstats
path: root/googletest/src
Commit message (Collapse)AuthorAgeFilesLines
* Googletest exportAbseil Team2019-12-131-0/+60
| | | | | | | | | | | 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
* Merge pull request #2609 from kuzkry:revert-2596Mark Barolak2019-12-061-8/+3
|\ | | | | | | PiperOrigin-RevId: 284041013
| * Revert "unify googletest and googlemock main functions"Krystian Kuzniarek2019-11-271-8/+3
| | | | | | | | This reverts commit a909becdc599c46bcb57346b6123cb57cd07d15d.
* | Googletest exportAbseil Team2019-12-061-10/+29
|/ | | | | | | | | | 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
* Merge pull request #2596 from kuzkry:remove-workaround_msvc-wmain-link-errorGennadiy Rozental2019-11-261-3/+8
|\ | | | | | | PiperOrigin-RevId: 282589492
| * unify googletest and googlemock main functionsrefs/pull/2596/headKrystian Kuzniarek2019-11-221-3/+8
| |
* | Merge pull request #2570 from xieyubo:1.10Gennadiy Civil2019-11-221-0/+3
|\ \ | | | | | | | | | PiperOrigin-RevId: 281971090
| * | Fix internal memory leak in Windows _Crt report.refs/pull/2571/headrefs/pull/2570/headxyb2019-11-161-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We use "MemoryIsNotDeallocated" to aovid internal expected leak reported in Windows _Crt report, like: { #ifdef _MSC_VER MemoryIsNotDeallocated memory_is_not_deeallocated; #endif static ThreadIdToThreadLocals* map = new ThreadIdToThreadLocals(); return map; } But int the above code, only "new ThreadIdToThreadLocals()" is protected, if we invoke "insert()" function of the return value, the memory allocated in "insert()" will be reported to _Crt report also. This change try to fix this issue.
* | | Googletest exportAbseil Team2019-11-223-61/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Merge pull request #2521 from Sinclair-John:masterAndy Getz2019-11-151-1/+4
|\ \ \ | | | | | | | | | | | | PiperOrigin-RevId: 280666222
| * | | Fix Issue 2418refs/pull/2521/headSinclair-John2019-10-181-1/+4
| | | |
* | | | Googletest exportAbseil Team2019-11-081-1/+1
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clone+exec death test allocates a single page of stack to run chdir + exec on. This is not enough when gtest is built with ASan and run on particular hardware. With ASan on x86_64, ExecDeathTestChildMain has frame size of 1728 bytes. Call to chdir() in ExecDeathTestChildMain ends up in _dl_runtime_resolve_xsavec, which attempts to save register state on the stack; according to cpuid(0xd) XSAVE register save area size is 2568 on my machine. This results in something like this in all death tests: Result: died but not with expected error. ... [ DEATH ] AddressSanitizer:DEADLYSIGNAL [ DEATH ] ================================================================= [ DEATH ] ==178637==ERROR: AddressSanitizer: stack-overflow on address ... PiperOrigin-RevId: 278709790
* | | Merge pull request #2453 from kuzkry:gtest-port-clean-up_kMaxBiggestIntXiaoyi Zhang2019-11-041-15/+16
|\ \ \ | | | | | | | | | | | | PiperOrigin-RevId: 278008286
* \ \ \ Merge pull request #2453 from kuzkry:gtest-port-clean-up_kMaxBiggestIntvslashg2019-11-011-16/+15
|\ \ \ \ | |/ / / | | | | | | | | PiperOrigin-RevId: 277979766
| * | | remove BiggestIntrefs/pull/2453/headKrystian Kuzniarek2019-10-241-4/+4
| | | |
* | | | Merge pull request #2515 from ciband:feat/support_esp8266vslashg2019-10-253-2/+14
|\ \ \ \ | | | | | | | | | | | | | | | PiperOrigin-RevId: 276333426
| * | | | Add ESP8266 configs to PlatformIO buildChris Johnson2019-10-112-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | Added various conditional compliations for ESP8266 to stub out missing functionality.
| * | | | feat: Add support for ESP8266 platformChris Johnson2019-10-113-2/+4
| | |/ / | |/| | | | | | | | | | | | | | | | | | Added support for ESP8266 Arduino platform. Refactored Arduino defines to use the GTEST_OS_* model.
* | | | [googletest] Output skip messagerefs/pull/2517/headAlexey Spiridonov2019-10-171-3/+1
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Closes #2208 Previously, skip messages were invisible, so debugging skips was hard. Now we have this: ``` $ ./googletest/gtest_skip_test Running main() from /home/lesha/github/snarkmaster/googletest/googletest/src/gtest_main.cc [==========] Running 3 tests from 2 test suites. [----------] Global test environment set-up. [----------] 1 test from SkipTest [ RUN ] SkipTest.DoesSkip /home/lesha/github/snarkmaster/googletest/googletest/test/gtest_skip_test.cc:38: Skipped skipping single test [ SKIPPED ] SkipTest.DoesSkip (0 ms) [----------] 1 test from SkipTest (1 ms total) ... ```
* | | Merge pull request #2497 from thejcannon:handle_null_filenameGennadiy Civil2019-10-101-1/+5
|\ \ \ | |_|/ |/| | | | | PiperOrigin-RevId: 273585229
| * | Use FormatFileLocation for streaming file and linerefs/pull/2497/headJoshua Cannon2019-10-071-1/+2
|/ /
* | Googletest exportAbseil Team2019-09-271-7/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Use a more portable path for Android to write temp files to. /sdcard is *not* guaranteed to be available, but /data/local/tmp is. In some emulated situations, /sdcard may not be mounted, may not be R/W, or mounting may be delayed until *after* the test process begins. This is fairly common location to use. See e.g.: https://reviews.llvm.org/D9569 PiperOrigin-RevId: 270909282
* | Merge pull request #2387 from kuzkry:iffShaindel Schwartz2019-09-124-116/+113
|\ \ | |/ |/| | | PiperOrigin-RevId: 268693457
| * restore mistakenly removed iffs in their explicit formrefs/pull/2387/headKrystian Kuzniarek2019-08-204-95/+100
| | | | | | | | | | Due to confusion arisen from "iff" standing for "if and only if", this commit uses the latter.
* | Googletest exportAbseil Team2019-09-062-3/+3
|/ | | | | | | | | | | Extend gtest-port and stubs for ESP_PLATFORM ESP_PLATFORM is the macro used to indicate compilation for the ESP32 using the esp-idf. This isn't a fully posix compatible system so various features of google test need to be stubbed out in order for it to work. It's oddly similar to the GTEST_OS_WINDOWS_PHONE setup. PiperOrigin-RevId: 267471968
* Fix #2371: Redirect Windows CRT assertions to stderrrefs/pull/2372/headAntoine Pitrou2019-08-061-5/+15
|
* Googletest exportAbseil Team2019-08-011-2/+2
| | | | | | | Fix signed conversion warning for wchar_t -> wint_t. Fixes Github issue #2300 PiperOrigin-RevId: 261045497
* Googletest exportmisterg2019-08-011-9/+49
| | | | | | Internal Change PiperOrigin-RevId: 260939845
* fix typosrefs/pull/2356/headKrystian Kuzniarek2019-07-304-61/+61
|
* Googletest exportAbseil Team2019-07-261-17/+24
| | | | | | | | Adds ISO8601 timestamps to XML output and RFC3339 timestamps to JSON output. Adds timestamps to testsuites, testsuite and testcases structured JSON/XML output for better reporting how/where time is spent on tests. PiperOrigin-RevId: 260039817
* Googletest exportAbseil Team2019-07-161-24/+34
| | | | | | | | | [Fuchsia] Update exception APIs used by death test. Migrates to the new channel-based exception APIs as the port APIs are deprecated and will be removed. PiperOrigin-RevId: 258175830
* Googletest exportAbseil Team2019-06-051-1/+1
| | | | | | fdio_pipe_half is now the same as fdio_pipe_half2. We can switch back to the cleaner name. PiperOrigin-RevId: 251633832
* Googletest exportAbseil Team2019-05-301-0/+9
| | | | | | Add a safety nullptr check to catch the case where the /tmp file used for capturing a stream cannot be created. PiperOrigin-RevId: 250523012
* unbreak windows buildrefs/pull/2260/headLingfeng Yang2019-05-221-1/+1
| | | | | windows msvc toolchain with werror and wconversion will break if converting long to DWORD.
* Fix -Wsign-conversion error by adding static_castrefs/pull/2245/headdaquexian2019-05-021-1/+1
|
* Address fallout from -Wsign-conversion work on Windowsrefs/pull/2241/headEnji 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 exportmisterg2019-04-181-2/+2
| | | | | | Fixes https://github.com/google/googletest/issues/2232 PiperOrigin-RevId: 244237560
* Merge pull request #2170 from ngie-eign:issue-2146-ver2Gennadiy Civil2019-04-186-44/+58
|\ | | | | | | PiperOrigin-RevId: 244069956
| * clang: fix `-Wsign-conversion` errorsEnji Cooper2019-04-066-36/+49
| | | | | | | | | | | | | | | | | | | | | | 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
* 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-031-3/+17
|\ | | | | | | PiperOrigin-RevId: 241803437
| * Handle GTEST_SKIP() when calling `Environment::SetUp()`refs/pull/2203/headEnji Cooper2019-03-301-3/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-012-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-014-91/+2
|/ | | | | | | | 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-281-12/+40
| | | | | | Update XML and JSON output to be consistent with the standard. PiperOrigin-RevId: 239833242
* Remove old_crtdbg_flag_ member if not requiredTobias Müller2019-03-191-4/+6
|
* 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-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