cr2/run, thermal: consider all classes when setting global basetime

We can't rely on the fact that there will be always a Thermal object with
elements in its data_frame. Instead create the global basetime as the
minimum of the basetimes of all classes which have elements in their data
frame, i.e. the time_array in BaseThermal::__parse_into_dataframe is
non-empty. In case that there is no element with a non-empty data_frame,
the global basetime is set to 0.

The trace file trace_empty.txt contains 100 traces which do not carry one of
the unique words of the Run::classes. It is intended for boundary tests, e.g.
to test the basetime calculation of the Run class in such a situation.

Add two tests to class TestRun. The patch is further tested by existing
TestRun::test_run_normalize_time.

Change-Id: I312dd6ffbb3ec60a9cfa2d3318e509b69135d36a
Signed-off-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
diff --git a/cr2/thermal.py b/cr2/thermal.py
index 1a1751e..cc45326 100644
--- a/cr2/thermal.py
+++ b/cr2/thermal.py
@@ -170,9 +170,14 @@
 
     def normalize_time(self, basetime):
         """Substract basetime from the Time of the data frame"""
-        self.data_frame.reset_index(inplace=True)
-        self.data_frame["Time"] = self.data_frame["Time"] - basetime
-        self.data_frame.set_index("Time", inplace=True)
+        if basetime:
+            self.data_frame.reset_index(inplace=True)
+            self.data_frame["Time"] = self.data_frame["Time"] - basetime
+            self.data_frame.set_index("Time", inplace=True)
+
+    def get_basetime(self):
+        """ Return the base time of the data frame"""
+        return self.data_frame.index[0] if not self.data_frame.empty else 0
 
 class Thermal(BaseThermal):
     """Process the thermal framework data in a ftrace dump"""