Stack: Fix libmemunreachable stack test

Manually count input stack trace lines that match the regexps instead of
relying on the output of addr2line.  Random changes to the libraries
listed in the test case could cause addr2line to land in an inlined
function and print multiple lines for each input stack frame.

Test: development/scripts/stack_core.py
Change-Id: I87f45466df4e814ec59a4c5f7e201fd1f3ee8419
This commit is contained in:
Colin Cross
2016-07-26 10:15:01 -07:00
parent 92863bc8cb
commit 1127df9e6f

View File

@@ -467,13 +467,15 @@ class LibmemunreachablePatternTests(unittest.TestCase):
tc.UpdateAbiRegexes()
header_lines = 0
trace_lines = 0
for line in lines:
tc.ProcessLine(line)
if re.search(tc.unreachable_line, line) is not None:
header_lines += 1
if tc.MatchTraceLine(line) is not None:
trace_lines += 1
self.assertEquals(header_lines, 3)
self.assertEquals(len(tc.trace_lines), 2)
self.assertEquals(trace_lines, 2)
tc.PrintOutput(tc.trace_lines, tc.value_lines)
if __name__ == '__main__':