Files
Yu-hsin Wang 540e6515de ext: upgrade to googletest 1.12.0
Upgrade googletest to 1.12.0
upstream commit: 15460959cbbfa20e66ef0b5ab497367e47fc0a04

sha1sum e1e4ab7f4add6d403c37970a83a596b3081077d6 generated by command:
find . -type f ! -name SConscript ! -path "./.*" -print0 \
| sort -z | xargs -0 sha1sum | sha1sum

This upgrade is mainly for solving the infinite-recursion warning from
g++12

ext/googletest/googlemock/include/gmock/internal/gmock-internal-utils.h: In function ‘testing::internal::Invalid<gem5::Port&>()gem5::Port&’:
ext/googletest/googlemock/include/gmock/internal/gmock-internal-utils.h:296:10: error: infinite recursion detected [-Werror=infinite-recursion]
  296 | inline T Invalid() {
      |          ^~~~~~~
ext/googletest/googlemock/include/gmock/internal/gmock-internal-utils.h:301:20: note: recursive call
  301 |   return Invalid<T>();
      |          ~~~~~~~~~~^~
ext/googletest/googlemock/include/gmock/internal/gmock-internal-utils.h: In function ‘testing::internal::Invalid<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&>()std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&’:
ext/googletest/googlemock/include/gmock/internal/gmock-internal-utils.h:296:10: error: infinite recursion detected [-Werror=infinite-recursion]
  296 | inline T Invalid() {
      |          ^~~~~~~
ext/googletest/googlemock/include/gmock/internal/gmock-internal-utils.h:301:20: note: recursive call
  301 |   return Invalid<T>();
      |          ~~~~~~~~~~^~

Change-Id: I14594f7bc148281784043b3f715173316e6d62d4
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/65211
Maintainer: Gabe Black <gabeblack@google.com>
Reviewed-by: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-11-03 02:44:51 +00:00
..
2022-01-20 01:16:02 +00:00
2022-01-20 01:16:02 +00:00
2022-11-03 02:44:51 +00:00
2022-11-03 02:44:51 +00:00
2022-11-03 02:44:51 +00:00

Googletest Mocking (gMock) Framework

Overview

Google's framework for writing and using C++ mock classes. It can help you derive better designs of your system and write better tests.

It is inspired by:

It is designed with C++'s specifics in mind.

gMock:

  • Provides a declarative syntax for defining mocks.
  • Can define partial (hybrid) mocks, which are a cross of real and mock objects.
  • Handles functions of arbitrary types and overloaded functions.
  • Comes with a rich set of matchers for validating function arguments.
  • Uses an intuitive syntax for controlling the behavior of a mock.
  • Does automatic verification of expectations (no record-and-replay needed).
  • Allows arbitrary (partial) ordering constraints on function calls to be expressed.
  • Lets a user extend it by defining new matchers and actions.
  • Does not use exceptions.
  • Is easy to learn and use.

Details and examples can be found here:

GoogleMock is a part of GoogleTest C++ testing framework and a subject to the same requirements.