summaryrefslogtreecommitdiffstats
path: root/test/framework.py
diff options
context:
space:
mode:
authorOle Troan <ot@cisco.com>2019-11-28 14:48:44 +0100
committerPaul Vinciguerra <pvinci@vinciconsulting.com>2019-12-05 13:26:01 +0000
commit0c6293230d480b899cab0de28887a3bbc4b82f56 (patch)
tree165a8fd4afed3ce7f788dfa63e41deb6bc17391f /test/framework.py
parent1ec9fdbf29aedcdd4040feb635971c3f87a1cfdf (diff)
tests: add test run time.
Type: feature Signed-off-by: Ole Troan <ot@cisco.com> Change-Id: Id7b30b5fe63e68ae88f3a42aa77d2614ccda724d
Diffstat (limited to 'test/framework.py')
-rw-r--r--test/framework.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/test/framework.py b/test/framework.py
index affd4481912..80e66a25549 100644
--- a/test/framework.py
+++ b/test/framework.py
@@ -1394,7 +1394,7 @@ class VppTestResult(unittest.TestResult):
test.__class__._header_printed = True
print_header(test)
-
+ self.start_test = time.time()
unittest.TestResult.startTest(self, test)
if self.verbosity > 0:
self.stream.writeln(
@@ -1409,14 +1409,17 @@ class VppTestResult(unittest.TestResult):
"""
unittest.TestResult.stopTest(self, test)
+
if self.verbosity > 0:
self.stream.writeln(single_line_delim)
self.stream.writeln("%-73s%s" % (self.getDescription(test),
self.result_string))
self.stream.writeln(single_line_delim)
else:
- self.stream.writeln("%-73s%s" % (self.getDescription(test),
- self.result_string))
+ self.stream.writeln("%-68s %4.2f %s" %
+ (self.getDescription(test),
+ time.time() - self.start_test,
+ self.result_string))
self.send_result_through_pipe(test, TEST_RUN)