32 """Tests that leaked mock objects can be caught be Google Mock.""" 34 __author__ =
'wan@google.com (Zhanyong Wan)' 37 import gmock_test_utils
41 TEST_WITH_EXPECT_CALL = [PROGRAM_PATH,
'--gtest_filter=*ExpectCall*']
42 TEST_WITH_ON_CALL = [PROGRAM_PATH,
'--gtest_filter=*OnCall*']
43 TEST_MULTIPLE_LEAKS = [PROGRAM_PATH,
'--gtest_filter=*MultipleLeaked*']
45 environ = gmock_test_utils.environ
46 SetEnvVar = gmock_test_utils.SetEnvVar
53 SetEnvVar(gmock_test_utils.PREMATURE_EXIT_FILE_ENV_VAR,
None)
62 env=environ).exit_code)
66 env=environ).exit_code)
72 [
'--gmock_catch_leaked_mocks=0'],
73 env=environ).exit_code)
77 [
'--gmock_catch_leaked_mocks=0'],
78 env=environ).exit_code)
84 [
'--gmock_catch_leaked_mocks'],
85 env=environ).exit_code)
89 [
'--gmock_catch_leaked_mocks'],
90 env=environ).exit_code)
96 [
'--gmock_catch_leaked_mocks=1'],
97 env=environ).exit_code)
103 [
'--gmock_catch_leaked_mocks'],
104 env=environ).exit_code)
107 if __name__ ==
'__main__':
def testCatchesLeakedMockWhenEnabled(self)
def testCatchesMultipleLeakedMocks(self)
def GetTestExecutablePath(executable_name)
def testCatchesLeakedMockWhenEnabledWithExplictFlagValue(self)
def testCatchesLeakedMockByDefault(self)
def testDoesNotCatchLeakedMockWhenDisabled(self)