mirror of
https://github.com/google/googletest.git
synced 2026-07-30 16:26:24 +08:00
Merge eec840f0b623217154d2d5a67c8d6d4c7963a1aa into a0f06a70e3da7afa88da9527c43951bca1f7cef2
This commit is contained in:
commit
918b7bab5b
@ -10,6 +10,9 @@
|
||||
|
||||
option(gmock_build_tests "Build all of Google Mock's own tests." OFF)
|
||||
|
||||
set(gmock_default_mock_behavior "1" CACHE STRING
|
||||
"Controls default mock behavior (0=Nice, 1=Naggy, 2=Strict).")
|
||||
|
||||
# A directory to find Google Test sources.
|
||||
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/gtest/CMakeLists.txt")
|
||||
set(gtest_dir gtest)
|
||||
@ -102,6 +105,9 @@ else()
|
||||
set_target_properties(gmock_main PROPERTIES VERSION ${GOOGLETEST_VERSION})
|
||||
endif()
|
||||
|
||||
target_compile_definitions(gmock PRIVATE
|
||||
GMOCK_DEFAULT_MOCK_BEHAVIOR=${gmock_default_mock_behavior})
|
||||
|
||||
string(REPLACE ";" "$<SEMICOLON>" dirs "${gmock_build_include_dirs}")
|
||||
target_include_directories(gmock SYSTEM INTERFACE
|
||||
"$<BUILD_INTERFACE:${dirs}>"
|
||||
|
||||
@ -38,10 +38,11 @@
|
||||
// uninteresting calls as errors.
|
||||
//
|
||||
// Currently a mock is naggy by default, so MockFoo and
|
||||
// NaggyMock<MockFoo> behave like the same. However, we will soon
|
||||
// switch the default behavior of mocks to be nice, as that in general
|
||||
// leads to more maintainable tests. When that happens, MockFoo will
|
||||
// stop behaving like NaggyMock<MockFoo> and start behaving like
|
||||
// NaggyMock<MockFoo> behave like the same. The default can be
|
||||
// overridden at build time via the GMOCK_DEFAULT_MOCK_BEHAVIOR
|
||||
// CMake option, or at runtime via the --gmock_default_mock_behavior
|
||||
// flag. If the default is set to NiceMock, MockFoo will stop
|
||||
// behaving like NaggyMock<MockFoo> and start behaving like
|
||||
// NiceMock<MockFoo>.
|
||||
//
|
||||
// NiceMock, NaggyMock, and StrictMock "inherit" the constructors of
|
||||
|
||||
@ -44,7 +44,7 @@ GMOCK_DEFINE_string_(verbose, testing::internal::kWarningVerbosity,
|
||||
" warning - prints warnings and errors.\n"
|
||||
" error - prints errors only.");
|
||||
|
||||
GMOCK_DEFINE_int32_(default_mock_behavior, 1,
|
||||
GMOCK_DEFINE_int32_(default_mock_behavior, GMOCK_DEFAULT_MOCK_BEHAVIOR,
|
||||
"Controls the default behavior of mocks."
|
||||
" Valid values:\n"
|
||||
" 0 - by default, mocks act as NiceMocks.\n"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user