Commit Graph

965 Commits

Author SHA1 Message Date
Gennadiy Civil
38d967e889 doc is still valid 2019-06-13 16:48:25 -04:00
Gennadiy Civil
6b8c138154 Removing make and automake. The only supported build systems are Bazel internally and CMake community supported 2019-06-13 13:49:42 -04:00
Matthias Walter
e580d99193 Setting CMP0054 policy to NEW. This allows to use the string "SHARED" without interpreting it as a variable. 2019-06-12 23:50:01 +02:00
Gennadiy Civil
af4c2cb098 Formatting Changes 2019-06-12 13:23:06 -04:00
Gennadiy Civil
076b7f7788 remove obsolete codegear files 2019-06-10 13:20:02 -04:00
Gennadiy Civil
fbcb2eb200 removing obsolete language from docs, CMake and Bazel is the only supporeted build methods 2019-06-10 10:51:41 -04:00
Gennadiy Civil
b93980dda7 removing xcode files , as CMake and Bazel is the only supporeted build methods 2019-06-10 10:33:14 -04:00
Gennadiy Civil
60a6d5fc34 removing msvc solution, as CMake and Bazel is the only supporeted build methods 2019-06-10 10:32:16 -04:00
Gennadiy Civil
da10da05c2
Merge pull request #2268 from kalaxy/fuse_spi_in_header
Fuse gtest-spi.h into the resulting header.
2019-06-07 13:08:18 -04:00
Abseil Team
31200def0d Googletest export
fdio_pipe_half is now the same as fdio_pipe_half2. We can switch back to the cleaner name.

PiperOrigin-RevId: 251633832
2019-06-05 11:52:45 -04:00
misterg
08a68b6fb7 Googletest export
comment change

PiperOrigin-RevId: 251231524
2019-06-05 11:52:33 -04:00
Kalon Mills
6044c267e8 Fuse gtest-spi.h into the resulting header.
Previously this was fused into the source file, but this prevents users of the
fused file from using those utilities directly.
2019-06-03 17:09:08 -07:00
Abseil Team
899c082633 Googletest export
Add a safety nullptr check to catch the case where the /tmp file used for capturing a stream cannot be created.

PiperOrigin-RevId: 250523012
2019-05-29 23:35:59 -04:00
gennadiycivil
7f1c0f6f81 Merge pull request #2260 from 741g:master
PiperOrigin-RevId: 249660276
2019-05-23 16:20:24 -04:00
Lingfeng Yang
2f58f41d1a unbreak windows build
windows msvc toolchain with werror and wconversion
will break if converting long to DWORD.
2019-05-22 08:57:06 -07:00
Enji Cooper
699943fe40 Fix typo introduced in 63be3dcc24 (maintaners -> maintainers)
Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
2019-05-19 23:31:04 -07:00
Gennadiy Civil
f71fb4f9a9
Update advanced.md
Adding back section that was lost in merge
2019-05-17 15:10:47 -04:00
Gennadiy Civil
03273a8982 Merge pull request #2254 from chaoran:master
PiperOrigin-RevId: 248759825
2019-05-17 15:05:44 -04:00
Chaoran Yang
5b4a135f62 add unit test for overload & operator 2019-05-13 15:39:18 +00:00
Gennadiy Civil
9d4cde44a4
Added docs for testing::RegisterTest 2019-05-13 10:35:10 -04:00
Chaoran Yang
2fc2383165 Use std::addressof to instead of plain '&'.
Otherwise the code won't compile if the '&' operater is overloaded and
return something that cannot be casted to void *.
2019-05-12 00:14:54 +00:00
Abseil Team
5299815377 Googletest export
Print the test output on assertion failure.

PiperOrigin-RevId: 247283764
2019-05-10 15:28:12 -04:00
gennadiycivil
bf3ef5c9b7 Merge pull request #2245 from daquexian:fix_wsign_conversion
PiperOrigin-RevId: 246550729
2019-05-03 15:11:30 -04:00
misterg
63be3dcc24 Googletest export
Clarify build system support - CMake and automake community supported

PiperOrigin-RevId: 245821927
2019-05-03 15:11:22 -04:00
daquexian
ca642a925e Fix -Wsign-conversion error by adding static_cast 2019-05-03 00:21:44 +08:00
Gennadiy Civil
9997a830ee Merge pull request #2242 from SylvestreG:master
PiperOrigin-RevId: 245798478
2019-04-29 15:22:54 -04:00
Gennadiy Civil
87348c217f Removing obsolete codegear and msvc 2010 2019-04-29 14:39:48 -04:00
misterg
82f9c8d65d Googletest export
Internal Change

PiperOrigin-RevId: 245788057
2019-04-29 14:32:28 -04:00
Sylvestre Gallon
9037e9bda1 Fix compilation on CentOS 7 2019-04-26 13:48:37 +02:00
Enji Cooper
bd47c09b73 Address fallout from -Wsign-conversion work on Windows
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>
2019-04-26 04:08:16 -07:00
Abseil Team
84d986531e Googletest export
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
2019-04-24 09:34:40 -04:00
misterg
0c68c865f3 Googletest export
Fixes https://github.com/google/googletest/issues/2232

PiperOrigin-RevId: 244237560
2019-04-18 15:46:04 -04:00
misterg
fa52cd6363 Googletest export
Expose more information in SuiteApiResolver diagnostic output

PiperOrigin-RevId: 244179347
2019-04-18 15:45:49 -04:00
Gennadiy Civil
a0d60bed4d Merge pull request #2170 from ngie-eign:issue-2146-ver2
PiperOrigin-RevId: 244069956
2019-04-18 09:44:24 -04:00
Abseil Team
9f893b9959 Googletest export
[googletest] Fix death test condition.

PiperOrigin-RevId: 243742424
2019-04-16 16:17:41 -04:00
Abseil Team
6d66818066 Googletest export
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
2019-04-16 16:17:34 -04:00
Calvin Hill
698d45d3a4 Sort Haiku platform definition alphabetically.
Fixes a minor ordering issue when defining the platform macro.
Also fixes a minor typo: 'Max OS X' -> 'Mac OS X'.
2019-04-12 19:26:07 +01:00
Gennadiy Civil
adc8a88ff0 Merge pull request #2226 from davidben:msvc-5046
PiperOrigin-RevId: 243121568
2019-04-11 15:59:46 -04:00
Gennadiy Civil
ea9c49b9cd Merge pull request #2229 from return:haiku-support
PiperOrigin-RevId: 243104604
2019-04-11 14:31:18 -04:00
Calvin Hill
0a00ba64d5 Add Haiku platform support.
This allows googletest to recognize the Haiku operating system when
running tests in other projects.
2019-04-11 17:28:06 +01:00
Rong Ou
f658dcbaa0
replace test case with test suite in the primer 2019-04-11 09:13:44 -07:00
David Benjamin
8e9297b503 MSVC C5046 warning is unavailable in MSVC 2015.
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
2019-04-09 18:13:32 -05:00
Rong Ou
d622dfe8ab
add missing period 2019-04-09 10:04:58 -07:00
Enji Cooper
3829b84e99 clang: fix -Wsign-conversion errors
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>
2019-04-05 21:30:19 -07:00
Gennadiy Civil
5ba69d5cb9 Merge pull request #2148 from ngie-eign:clang-add-explicit-c++11-rtti-flag
PiperOrigin-RevId: 242038269
2019-04-05 11:46:13 -04:00
Abseil Team
c061ffafd8 Googletest export
[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
2019-04-05 11:46:06 -04:00
Enji Cooper
7475ba5039 clang: explicitly enable/disable RTTI support with the compiler
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>
2019-04-03 21:09:20 -07:00
Gennadiy Civil
1f3b098ef3 Merge pull request #2203 from ngie-eign:issue-2189
PiperOrigin-RevId: 241803437
2019-04-03 17:15:16 -04:00
Abseil Team
c9e0aed90b Googletest export
Typos: "more then" -> "more than".
PiperOrigin-RevId: 241483698
2019-04-03 15:14:17 -04:00
Abseil Team
b617b27718 Googletest export
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
2019-04-01 15:45:51 -04:00
Abseil Team
d982543131 Googletest export
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
2019-04-01 15:05:10 -04:00
Enji Cooper
67c75ff8ba Handle GTEST_SKIP() when calling Environment::SetUp()
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>
2019-03-30 11:38:03 -07:00
Abseil Team
5b752b1947 Googletest export
Update XML and JSON output to be consistent with the standard.

PiperOrigin-RevId: 239833242
2019-03-28 17:56:02 -04:00
Syohei YOSHIDA
c651b45281 Update Xcode project file
- Remove files which no longer exists
- Add newer file
2019-03-26 16:39:34 +09:00
Gennadiy Civil
a18ac392d8
Merge pull request #2193 from antismap/patch-1
Note about INSTANTIATE_TEST_SUITE_P / INSTANTIATE_TEST_CASE_P
2019-03-21 15:43:59 -04:00
Gennadiy Civil
d31151a493
Update googletest/docs/advanced.md
Co-Authored-By: antismap <michael.thenault@gmail.com>
2019-03-21 16:20:07 +01:00
Gennadiy Civil
10e98c4f2a Merge pull request #2180 from twam:master
PiperOrigin-RevId: 239404016
2019-03-21 10:43:14 -04:00
Abseil Team
f1883b1824 Googletest export
Remove mention of unused type ProtocolMessage.

PiperOrigin-RevId: 239242706
2019-03-21 10:43:06 -04:00
antismap
f233360933
Note about INSTANTIATE_TEST_SUITE_P / INSTANTIATE_TEST_CASE_P keyword change
See https://github.com/google/googletest/issues/2065
2019-03-21 14:38:50 +01:00
Tobias Müller
c3ac2655f7 Remove old_crtdbg_flag_ member if not required 2019-03-19 09:29:48 +01:00
Gennadiy Civil
8b6d3f9c4a Merge pull request #2158 from CarloWood:master
PiperOrigin-RevId: 236716851
2019-03-05 08:39:41 -05:00
Abseil Team
3dd2e841c3 Googletest export
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
2019-03-05 08:39:34 -05:00
Abseil Team
a1dd07786b Googletest export
Build gmock cleanly with clang -Wextra-semi and -Wextra-semi-stmt

Extends 56ef07a203 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
2019-03-05 08:39:28 -05:00
Abseil Team
db9b85e275 Googletest export
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
2019-03-01 16:18:24 -05:00
Carlo Wood
fc979623a9 Minor build system fixes. 2019-03-01 08:11:56 +01:00
Abseil Team
efecb0bfa6 Googletest export
Replace more pump'd code with variadic templates.

PiperOrigin-RevId: 235584585
2019-02-25 17:20:00 -05:00
Ryan Sinnet
d70cd4e358
Fix grammatical error in primer.md 2019-02-25 08:03:28 -08:00
Gennadiy Civil
37ae1fc5e6 Merge pull request #2147 from ngie-eign:gtest-test-death-test-dont-hardcode-test-name
PiperOrigin-RevId: 235248114
2019-02-22 16:39:33 -05:00
Gennadiy Civil
b6473fcf90 Merge pull request #2126 from ngie-eign:clang-add-more-strict-warnings
PiperOrigin-RevId: 235220570
2019-02-22 16:18:28 -05:00
Enji Cooper
cd09534dec Don't hardcode the filename in 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>
2019-02-21 12:10:15 -08:00
Gennadiy Civil
7203f37f57 Merge pull request #2137 from ngie-eign:clang-ignore-sign-conversion
PiperOrigin-RevId: 235012245
2019-02-21 13:14:17 -05:00
Gennadiy Civil
1411d27a94 Merge pull request #2061 from samolisov:building-with-bazel-as-a-dll-on-windows
PiperOrigin-RevId: 234845565
2019-02-20 15:22:43 -05:00
Gennadiy Civil
c374893023 Merge pull request #2123 from ngie-eign:clang-inconsistent-missing-override
PiperOrigin-RevId: 234840107
2019-02-20 15:22:28 -05:00
Abseil Team
0e424c7594 Googletest export
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
2019-02-20 13:35:30 -05:00
Diomidis Spinellis
9dc235b59c Avoid array index out of range
Issue: #2140
2019-02-20 00:59:21 +02:00
Enji Cooper
fcf59ca7bf Ignore -Wsign-conversion issues
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>
2019-02-18 19:19:34 -08:00
Enji Cooper
a4af76cf8c Add cxx_strict_flags for clang to match FreeBSD's WARNS flags
Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
2019-02-13 14:38:49 -08:00
Gennadiy Civil
d850e14471 Merge pull request #2112 from knuto:pr/fix_null_pointer
PiperOrigin-RevId: 233825166
2019-02-13 17:04:09 -05:00
Gennadiy Civil
54ec41f000 Merge pull request #2121 from ngie-eign:add-dragonflybsd-and-kfreebsd-support
PiperOrigin-RevId: 233789488
2019-02-13 14:07:33 -05:00
Gennadiy Civil
f73b2fb39e Merge pull request #2114 from knuto:pr/libtool_support
PiperOrigin-RevId: 233773676
2019-02-13 14:07:26 -05:00
Gennadiy Civil
ea43be9d1a Merge pull request #2119 from ngie-eign:clang-wunused-private-field
PiperOrigin-RevId: 233762751
2019-02-13 11:56:43 -05:00
Gennadiy Civil
e5e846da7f Merge pull request #2120 from ngie-eign:clang-compile-with-basic-warns-flags
PiperOrigin-RevId: 233762520
2019-02-13 11:56:17 -05:00
Gennadiy Civil
75c3396099 Merge pull request #2113 from knuto:pr/set_old_gtest_ver
PiperOrigin-RevId: 233748252
2019-02-13 10:24:59 -05:00
Enji Cooper
96826743ea Import patch-bsd-defines from FreeBSD ports [1]
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>
2019-02-12 22:43:07 -08:00
Enji Cooper
1ded83195d Compile clang with -Wall -Wshadow -Werror
It was not compiling any of the code with warnings prior to this.

Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
2019-02-12 16:45:40 -08:00
Enji Cooper
ed2fe122f8 Fix -Wunused-private-field issues with clang
Provide dummy accessors for private values that are set in initializers,
but not actually used.

Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
2019-02-12 16:40:01 -08:00
misterg
c4ccab33aa Googletest export
Internal Change

PiperOrigin-RevId: 233614147
2019-02-12 13:20:40 -05:00
Gennadiy Civil
b68ec344bf Merge pull request #2101 from MaEtUgR:fix-cmake-cygwin
PiperOrigin-RevId: 233096223
2019-02-12 13:20:27 -05:00
Abseil Team
4f79e316ac Googletest export
Internal changes.

PiperOrigin-RevId: 232953166
2019-02-12 13:20:20 -05:00
Abseil Team
28a96d1834 Googletest export
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
2019-02-12 13:20:14 -05:00
Abseil Team
dda0df3b0a Googletest export
Internal change

PiperOrigin-RevId: 232362580
2019-02-12 13:20:05 -05:00
Knut Omang
60cf03313d Set gtest version correctly for older cmake versions
Signed-off-by: Knut Omang <knut.omang@oracle.com>
2019-02-11 20:19:58 +01:00
Knut Omang
f4d3cdb657 Generate a libgtest.la to help libtool managing dependencies
When building and using googletest from an install tree
we want libtool to generate rpath in the dependent binaries
to allow them to be executed from a build without a need
for LD_LIBRARY_PATH or similar.

For libtool based project this happens automatically
as projects generates .la files and install them.
Provide such a file for gtest as well to allow it to
work smoothly with libtool based projects.

Signed-off-by: Knut Omang <knut.omang@oracle.com>
2019-02-11 20:17:34 +01:00
Jonathan Wakely
48e6f1f387 Stop TestInfo::Run() calling a function through null pointer
If the object was never created then trying to call &Test::DeleteSelf_
will dereference a null pointer, with undefined behaviour.

Fixes #845
2019-02-11 20:15:30 +01:00
Keiichi Watanabe
b3679d8565 Fix an invalid example of JSON report in advanced.md
This is just a mistake in the document. Google Test doesn't output
such an invalid JSON report.

Signed-off-by: Keiichi Watanabe <keiichiw@chromium.org>
2019-02-05 21:05:16 +09:00
misterg
50059a12b9 Googletest export
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
2019-02-04 14:19:58 -05:00
misterg
52ea4f7bea Googletest export
Mark legacy _TEST_CASE_ macros as deprecated

PiperOrigin-RevId: 232303251
2019-02-04 14:19:50 -05:00
Abseil Team
876bdfa565 Googletest export
Update example code in gtest.h to prefer override over virtual now
that it is widely available in C++11.

PiperOrigin-RevId: 232057792
2019-02-04 14:19:41 -05:00
Gennadiy Civil
471f5bc433 Merge pull request #2098 from ciband:feat/finish_platformio_support
PiperOrigin-RevId: 232028696
2019-02-04 14:19:31 -05:00
Chris
b2b2462250 fix: Add Arduino to embedded platform list
Added Arduino to the embedded platform list to allow for a stubbed out version
of GetCurrentDir.
2019-01-31 21:56:34 -06:00