From b9086dbbe5746264dc7c3e29f983d0d9afba34d1 Mon Sep 17 00:00:00 2001 From: mrg Date: Fri, 26 Mar 2021 06:56:58 -0700 Subject: [PATCH] Add unit test times to output. --- compiler/tests/testutils.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/compiler/tests/testutils.py b/compiler/tests/testutils.py index ed24f8cf..987b64e4 100644 --- a/compiler/tests/testutils.py +++ b/compiler/tests/testutils.py @@ -12,11 +12,19 @@ from globals import OPTS import debug import pdb import traceback +import time class openram_test(unittest.TestCase): """ Base unit test that we have some shared classes in. """ + def setUp(self): + self.start_time = time.time() + + def tearDown(self): + duration = time.time() - self.start_time + print('%s: %.3fs' % (self.id(), duration)) + def fail(self, msg): import inspect s = inspect.stack()