aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValentin Schneider <valentin.schneider@arm.com>2017-09-18 12:36:58 +0100
committerValentin Schneider <valentin.schneider@arm.com>2017-09-18 12:48:38 +0100
commit581f936a426783d289b0b0ff4e9dfafa874dcddd (patch)
tree870194174fd4c266900d32a106afa9627da54b72
parent211eeb5b8c238f6a2934b92b5bc4200b549f0780 (diff)
downloadtrappy-581f936a426783d289b0b0ff4e9dfafa874dcddd.tar.gz
tests/test_ftrace: Add window duration tests
-rw-r--r--tests/test_ftrace.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/test_ftrace.py b/tests/test_ftrace.py
index e6f6319..f07813c 100644
--- a/tests/test_ftrace.py
+++ b/tests/test_ftrace.py
@@ -170,6 +170,22 @@ class TestFTrace(BaseTestThermal):
self.assertEqual(trace.get_duration(), duration)
+ def test_ftrace_duration_window(self):
+ """Test that duration is correct with time window (normalize_time=True)"""
+ trace = trappy.FTrace(normalize_time=True, window=[1, 5])
+
+ duration = trace.thermal_governor.data_frame.index[-1] - trace.thermal.data_frame.index[0]
+
+ self.assertEqual(trace.get_duration(), duration)
+
+ def test_ftrace_duration_window_not_normalized(self):
+ """Test that duration is correct with time window (normalize_time=False)"""
+ trace = trappy.FTrace(normalize_time=False, window=[1, 5])
+
+ duration = trace.thermal_governor.data_frame.index[-1] - trace.thermal.data_frame.index[0]
+
+ self.assertEqual(trace.get_duration(), duration)
+
def test_ftrace_duration_not_normalized(self):
"""Test get_duration: normalize_time=True"""