Lines Matching refs:output

32 r"""Tests the text output of Google C++ Mocking Framework.
64 def RemoveReportHeaderAndFooter(output):
65 """Removes Google Test result report's header and footer from the output."""
67 output = re.sub(r'.*gtest_main.*\n', '', output)
68 output = re.sub(r'\[.*\d+ tests.*\n', '', output)
69 output = re.sub(r'\[.* test environment .*\n', '', output)
70 output = re.sub(r'\[=+\] \d+ tests .* ran.*', '', output)
71 output = re.sub(r'.* FAILED TESTS\n', '', output)
72 return output
75 def RemoveLocations(output):
76 """Removes all file location info from a Google Test program's output.
79 output: the output of a Google Test program.
82 output with all file location info (in the form of
88 return re.sub(r'.*[/\\](.+)(\:\d+|\(\d+\))\:', 'FILE:#:', output)
91 def NormalizeErrorMarker(output):
94 return re.sub(r' error: ', ' Failure\n', output)
97 def RemoveMemoryAddresses(output):
98 """Removes memory addresses from the test output."""
100 return re.sub(r'@\w+', '@0x#', output)
103 def RemoveTestNamesOfLeakedMocks(output):
104 """Removes the test names of leaked mock objects from the test output."""
106 return re.sub(r'\(used in test .+\) ', '', output)
109 def GetLeakyTests(output):
112 # findall() returns a list of all matches of the regex in output.
113 # For example, if '(used in test FooTest.Bar)' is in output, the
115 return re.findall(r'\(used in test (.+)\)', output)
118 def GetNormalizedOutputAndLeakyTests(output):
119 """Normalizes the output of gmock_output_test_.
122 output: The test output.
125 A tuple (the normalized test output, the list of test names that have
129 output = ToUnixLineEnding(output)
130 output = RemoveReportHeaderAndFooter(output)
131 output = NormalizeErrorMarker(output)
132 output = RemoveLocations(output)
133 output = RemoveMemoryAddresses(output)
134 return (RemoveTestNamesOfLeakedMocks(output), GetLeakyTests(output))
140 return gmock_test_utils.Subprocess(cmd, capture_stderr=False).output
144 """Runs a command and returns its normalized output and a list of leaky tests.
158 (output, leaky_tests) = GetNormalizedCommandOutputAndLeakyTests(COMMAND)
166 # The normalized output should match the golden file.
167 self.assertEqual(golden, output)
169 # The raw output should contain 2 leaked mock object errors for
182 (output, _) = GetNormalizedCommandOutputAndLeakyTests(COMMAND)
184 golden_file.write(output)