release-1.11.0
版本发布时间: 2021-06-12 11:08:40
google/googletest最新发布版本:v1.15.2(2024-07-31 21:36:23)
Release Notes
GoogleTest will not accept patches of new features to v1.11.0.
We recommend building GoogleTest from the latest commit instead.
Exceptional critical bug fixes may be considered.
Documentation
- Contents significantly updated
- Files moved into docs (https://github.com/google/googletest/commit/489283524e3726b7adb9692763c2fb61b235d41a)
- Now using GitHub pages (https://github.com/google/googletest/commit/1a5a78b9a9c6c285a7897a411cb96bb2ab36d277, https://github.com/google/googletest/commit/d9c309fdab807b716c2cf4d4a42989b8c34f712a, https://github.com/google/googletest/commit/c3fc92f0b7ad49ce59d804dc644dcb5ecbc0c29c)
- Added Bazel quickstart (https://github.com/google/googletest/commit/32ad3c8c36382165274385a28a23addbea581f5d)
- Added CMake quickstart (https://github.com/google/googletest/commit/d4e3b8cedf4f57922efa586cb3c796c8fee2d3f3)
Mocking
-
MOCK_METHOD
now handles noexcept correctly (https://github.com/google/googletest/pull/2498) -
MOCK_METHOD
now supports ref-qualifiers (https://github.com/google/googletest/commit/d89b36302116233b8c6377e6e891083f41ee51c5) -
MOCK_METHOD
now supports returning function pointers (https://github.com/google/googletest/commit/1f9edcd9698162b48d94e1ef2e6a2ab7ab4e6c56) -
DoAll
now accepts move-only arguments (https://github.com/google/googletest/commit/48ec64092a38621210ecd835fde61d76861269c1) -
MockFunction
can now be used for mockingstd::function
(https://github.com/google/googletest/pull/2350) -
MockFunction
is now templated for use with other function classes, besidesstd::function
(https://github.com/google/googletest/commit/662fe38e44900c007eccb65a5d2ea19df7bd520e) -
ACTION
macros now support more than 10 arguments (https://github.com/google/googletest/commit/63713e1ce49019da205daa1ca91b73fcfc9b333f)
Matchers
-
New matchers
-
IsNan
(https://github.com/google/googletest/commit/bbe4b7363bbaa7c9e07dbacde11602a4c69504d3) -
FieldsAre
(https://github.com/google/googletest/commit/a4621888650aaae118de93f9faf8ef5a18cab303) -
Pointer
(https://github.com/google/googletest/commit/a02a591605dfef9addde49634bf010dbe8f95c50) -
Address
(https://github.com/google/googletest/commit/e5644f5f12ff3d5b2232dabc1c5ea272a52e8155) -
Throws
andThrowsMessage
(https://github.com/google/googletest/pull/2904)
-
- New actions
- Added
Matcher<std::string_view>
specialization that internally stores astring
instead ofstring_view
(https://github.com/google/googletest/commit/6f5fd0d7199b9a19faa9f499ecc266e6ae0329e7) - String matchers now accept
string_view
input (https://github.com/google/googletest/commit/13a433a94dd9c7e55907d7a9b75f44ff82f309eb) -
DoubleNearPredFormat
matcher now fails on impractically small epsilons (https://github.com/google/googletest/commit/b5687db554a295e697f5d459cf6d3f343d2ca179) -
Truly
matcher now explains failures (https://github.com/google/googletest/commit/0c400f67fcf305869c5fb113dd296eca266c9725) - Matchers can now be implemented without extending
MatcherInterface
(https://github.com/google/googletest/commit/c13c27a513ecd1cbf5700a45fe590e85e8ae6770) - Added output messages for skipped tests (https://github.com/google/googletest/pull/2517, https://github.com/google/googletest/pull/2767)
Behavior
-
New flags
-
--gtest_brief
shows only test failures in output (https://github.com/google/googletest/pull/2751) -
--gtest_fail_fast
stops test execution on first failure (https://github.com/google/googletest/commit/1ced315a483f4ecac21893ce6ceeb502afb82eff)
-
- Failures in
SetUpTestSuite
andTearDownTestSuite
now cause tests to fail rather than log (https://github.com/google/googletest/commit/9ed99c6c837ae1cbfcabd36959fc802ebb5ae07f) - Uninstantiated
TEST_P
andTYPED_TEST_P
now fail unless allowlisted usingGTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST
(https://github.com/google/googletest/commit/d442089d53cecbba59b2d8f35d06eac01f1e46da, https://github.com/google/googletest/commit/a13a0626188b4e7d22d63a4c9fcfe9f441c81e4a, https://github.com/google/googletest/commit/0b024bd91a14a77a7e7d6072ccd88e09c86ddeaa, https://github.com/google/googletest/commit/3e79d366e380ec85b7de9409211b184bc8529655, https://github.com/google/googletest/commit/ec94d9f24c92a5090fda5567156d6dde99cdbf31)
Output
- Added specialized printing for
std::any
,std::optional
, andstd::variant
(https://github.com/google/googletest/pull/2742) - Added recursive printing for
std::unique_ptr
andstd::shared_ptr
(https://github.com/google/googletest/commit/6b2e74905e9a7e70c7d1017ee0dfe5a8e88a1300) - Printing incomplete types is now supported (https://github.com/google/googletest/commit/f8304d762e0ed119d3d1c72deb1976dc80029db5)
- Start timestamps in XML/JSON output now use millisecond precision (https://github.com/google/googletest/commit/af1e75ce0b3429d70790c049d8dbb0aae3e2480f)
- Added more structured information about test suite to XML/JSON output on environment failures (https://github.com/google/googletest/commit/ac1d60c2b5ae62a06eca1d2c0f9d6dc92cda8711)
Build & Test
- CMake minimum increased to 2.8.12 (https://github.com/google/googletest/pull/3094)
- GoogleTest is now using Kokoro CI instead of Travis and AppVeyor
Misc
- Removed support for
GTEST_HAS_STD_STRING
(https://github.com/google/googletest/pull/2456) - Replaced pump code generation with variadic templates (https://github.com/google/googletest/pull/2388, https://github.com/google/googletest/commit/d8eeb9760afcab45dbdd887c2b6d106887c1739d, https://github.com/google/googletest/commit/4b9c1691c4b7f01fbd9d37d86c88cdad298d48e9, https://github.com/google/googletest/commit/fbf67a70d07543f40832d0cd7a58f304bc6ab1d1, https://github.com/google/googletest/commit/41b5f149ab306e96b5b2faf523505d75acffd98a, https://github.com/google/googletest/commit/710f9c11ca79e578bb38d98d10ab9b70d41d5e07, https://github.com/google/googletest/commit/997c36c1881105bd7ce482a1ec93759badf64ce6, https://github.com/google/googletest/commit/59dea67b815a046122d77113d5c6df1df66076bb)