From b312260be301948b4972e27d658f10245aad3733 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Sun, 3 May 2020 10:51:45 +1000 Subject: [PATCH] autotest: add timestamp to progress message --- Tools/autotest/common.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Tools/autotest/common.py b/Tools/autotest/common.py index feec781c3f..a5193f9e9b 100644 --- a/Tools/autotest/common.py +++ b/Tools/autotest/common.py @@ -709,6 +709,10 @@ class AutoTest(ABC): _show_test_timings=False, force_ahrs_type=None): + self.start_time = time.time() + global __autotest__ # FIXME; make progress a non-staticmethod + __autotest__ = self + if binary is None: raise ValueError("Should always have a binary") @@ -748,7 +752,9 @@ class AutoTest(ABC): @staticmethod def progress(text): """Display autotest progress text.""" - print("AUTOTEST: " + text) + global __autotest__ + delta_time = time.time() - __autotest__.start_time + print("AT-%06.1f: %s" % (delta_time,text)) # following two functions swiped from autotest.py: @staticmethod