aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Fernandes <joelaf@google.com>2017-06-14 17:06:23 -0700
committerKP Singh <kpsingh@google.com>2017-06-21 22:04:46 +0200
commitc32717c10198902f40bbdc4e34b252e28c0c4b4d (patch)
treee51e139686fae8f4f8586aaf9be9922376498303
parent16ad8df451f9280ba91f3bc03f91c781b4f4596a (diff)
downloadtrappy-c32717c10198902f40bbdc4e34b252e28c0c4b4d.tar.gz
tests: Add a test for line numbers in systrace
I promised @derkling I would write this so here you go. Signed-off-by: Joel Fernandes <joelaf@google.com> Reviewed-by: KP Singh <kpsingh@google.com>
-rw-r--r--tests/test_systrace.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/test_systrace.py b/tests/test_systrace.py
index 0442458..550bddb 100644
--- a/tests/test_systrace.py
+++ b/tests/test_systrace.py
@@ -64,6 +64,15 @@ class TestSystrace(utils_tests.SetupDirectory):
self.assertTrue(dfr['func'].iloc[2], 'notifyFramePending')
self.assertTrue(dfr['data'].iloc[-2], 'HW_VSYNC_0')
+ def test_systrace_line_num(self):
+ """Test for line numbers in a systrace"""
+ trace = trappy.SysTrace("trace_sf.html")
+ dfr = trace.sched_switch.data_frame
+ self.assertEquals(trace.lines, 2506)
+ self.assertEquals(dfr['__line'].iloc[0], 0)
+ self.assertEquals(dfr['__line'].iloc[1], 6)
+ self.assertEquals(dfr['__line'].iloc[-1], 2505)
+
class TestLegacySystrace(utils_tests.SetupDirectory):
def __init__(self, *args, **kwargs):