From 0c6293230d480b899cab0de28887a3bbc4b82f56 Mon Sep 17 00:00:00 2001 From: Ole Troan Date: Thu, 28 Nov 2019 14:48:44 +0100 Subject: tests: add test run time. Type: feature Signed-off-by: Ole Troan Change-Id: Id7b30b5fe63e68ae88f3a42aa77d2614ccda724d --- test/framework.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'test') 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) -- cgit 1.2.3-korg