[oe-commits] [openembedded-core] 14/16: Add extra timing

git at git.openembedded.org git at git.openembedded.org
Sun Jul 15 15:38:04 UTC 2018


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit e739a8d8921262ed3e873f052f37da0cc5e2e756
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
AuthorDate: Fri Jul 13 09:33:10 2018 +0000

    Add extra timing
    
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/lib/oeqa/selftest/case.py | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/meta/lib/oeqa/selftest/case.py b/meta/lib/oeqa/selftest/case.py
index 7a90a6b..8b2b854 100644
--- a/meta/lib/oeqa/selftest/case.py
+++ b/meta/lib/oeqa/selftest/case.py
@@ -12,6 +12,12 @@ import oeqa.utils.ftools as ftools
 from oeqa.utils.commands import runCmd, bitbake, get_bb_var
 from oeqa.core.case import OETestCase
 
+import time
+
+def logit(msg):
+    print(str(time.time()) + " " + msg)
+    sys.stdout.flush()
+
 class OESelftestTestCase(OETestCase):
     def __init__(self, methodName="runTest"):
         self._extra_tear_down_commands = []
@@ -148,11 +154,15 @@ to ensure accurate results.")
         # but if they overwrite this one they have to call
         # super each time, so let's give them an alternative
         self.setUpLocal()
+        logit("Starting %s" % self.id())
+        self.starttime = time.time()
 
     def setUpLocal(self):
         pass
 
     def tearDown(self):
+        self.endtime = time.time()
+        logit("Finishing %s (%ss)" % (self.id(), "{0:.2f}".format(self.endtime - self.starttime)))
         if self._extra_tear_down_commands:
             failed_extra_commands = []
             for command in self._extra_tear_down_commands:

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list