tests: add test run time.

Type: feature
Signed-off-by: Ole Troan <ot@cisco.com>
Change-Id: Id7b30b5fe63e68ae88f3a42aa77d2614ccda724d
This commit is contained in:
Ole Troan
2019-11-28 14:48:44 +01:00
committed by Paul Vinciguerra
parent 1ec9fdbf29
commit 0c6293230d

View File

@ -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)