diff options
author | Patrick Bellasi <patrick.bellasi@arm.com> | 2017-06-14 12:31:28 +0100 |
---|---|---|
committer | KP Singh <kpsingh@google.com> | 2017-06-15 00:19:00 +0200 |
commit | 1954b37df094fce96ed345344da920dd248597d9 (patch) | |
tree | aca852a9607dc24f7f6f5688cd185598c9eb898f /tests/test_base.py | |
parent | 658d4cc50a81cc0234bd4cdb3fa87f38782223b1 (diff) | |
download | trappy-1954b37df094fce96ed345344da920dd248597d9.tar.gz |
trappy/tests: add a new test for new line number parsing
Let's test that the parsed events have the proper line number reported
in their DF.
Signed-off-by: Joel Fernandes <joelaf@google.com>
Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
Reviewed-by: KP Singh <kpsingh@google.com>
Diffstat (limited to 'tests/test_base.py')
-rw-r--r-- | tests/test_base.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/test_base.py b/tests/test_base.py index 3311f11..96b8d96 100644 --- a/tests/test_base.py +++ b/tests/test_base.py @@ -203,6 +203,19 @@ class TestBase(utils_tests.SetupDirectory): self.assertEquals(round(thrm.data_frame.index[0], 7), 0) self.assertEquals(round(last_time - expected_last_time, 7), 0) + def test_line_num(self): + """TestBase: Test line number functionality""" + trace = trappy.FTrace() + self.assertEquals(trace.lines, 804) + + df = trace.thermal.data_frame + self.assertEquals(df.iloc[0]['__line'], 0); + self.assertEquals(df.iloc[-1]['__line'], 792); + + df = trace.thermal_governor.data_frame + self.assertEquals(df.iloc[0]['__line'], 11); + self.assertEquals(df.iloc[-1]['__line'], 803) + def test_equals_in_field_value(self): """TestBase: Can parse events with fields with values containing '='""" trace = trappy.FTrace("trace_equals.txt", events=['equals_event']) |