Home | History | Annotate | Download | only in test

Lines Matching refs:output

32 """Tests the text output of Google C++ Mocking Framework.
65 def RemoveReportHeaderAndFooter(output):
66 """Removes Google Test result report's header and footer from the output."""
68 output = re.sub(r'.*gtest_main.*\n', '', output)
69 output = re.sub(r'\[.*\d+ tests.*\n', '', output)
70 output = re.sub(r'\[.* test environment .*\n', '', output)
71 output = re.sub(r'\[=+\] \d+ tests .* ran.*', '', output)
72 output = re.sub(r'.* FAILED TESTS\n', '', output)
73 return output
76 def RemoveLocations(output):
77 """Removes all file location info from a Google Test program's output.
80 output: the output of a Google Test program.
83 output with all file location info (in the form of
89 return re.sub(r'.*[/\\](.+)(\:\d+|\(\d+\))\:', 'FILE:#:', output)
92 def NormalizeErrorMarker(output):
95 return re.sub(r' error: ', ' Failure\n', output)
98 def RemoveMemoryAddresses(output):
99 """Removes memory addresses from the test output."""
101 return re.sub(r'@\w+', '@0x#', output)
104 def RemoveTestNamesOfLeakedMocks(output):
105 """Removes the test names of leaked mock objects from the test output."""
107 return re.sub(r'\(used in test .+\) ', '', output)
110 def GetLeakyTests(output):
113 # findall() returns a list of all matches of the regex in output.
114 # For example, if '(used in test FooTest.Bar)' is in output, the
116 return re.findall(r'\(used in test (.+)\)', output)
119 def GetNormalizedOutputAndLeakyTests(output):
120 """Normalizes the output of gmock_output_test_.
123 output: The test output.
126 A tuple (the normalized test output, the list of test names that have
130 output = ToUnixLineEnding(output)
131 output = RemoveReportHeaderAndFooter(output)
132 output = NormalizeErrorMarker(output)
133 output = RemoveLocations(output)
134 output = RemoveMemoryAddresses(output)
135 return (RemoveTestNamesOfLeakedMocks(output), GetLeakyTests(output))
141 return gmock_test_utils.Subprocess(cmd, capture_stderr=False).output
145 """Runs a command and returns its normalized output and a list of leaky tests.
158 (output, leaky_tests) = GetNormalizedCommandOutputAndLeakyTests(COMMAND)
163 # The normalized output should match the golden file.
164 self.assertEquals(golden, output)
166 # The raw output should contain 2 leaked mock object errors for
175 (output, _) = GetNormalizedCommandOutputAndLeakyTests(COMMAND)
177 golden_file.write(output)