Move tests to test Makefile

This commit is contained in:
mrg
2021-11-03 11:36:19 -07:00
parent 6f33e8102f
commit c102ed728c
5 changed files with 29 additions and 80 deletions
+11 -11
View File
@@ -24,24 +24,24 @@ class openram_test(unittest.TestCase):
def tearDown(self):
duration = time.time() - self.start_time
print('%s: %.3fs' % (self.id(), duration))
def fail(self, msg):
import inspect
s = inspect.stack()
base_filename = os.path.splitext(os.path.basename(s[2].filename))[0]
try:
OPENRAM_HOME = os.path.abspath(os.environ.get("OPENRAM_HOME"))
except:
debug.error("$OPENRAM_HOME is not properly defined.", 1)
import shutil
zip_file = "{0}/../{1}_{2}".format(OPENRAM_HOME, base_filename, os.getpid())
debug.info(0, "Archiving failed temp files {0} to {1}".format(OPTS.openram_temp, zip_file))
shutil.make_archive(zip_file, 'zip', OPTS.openram_temp)
# import shutil
# zip_file = "{0}/../{1}_{2}".format(OPENRAM_HOME, base_filename, os.getpid())
# debug.info(0, "Archiving failed temp files {0} to {1}".format(OPTS.openram_temp, zip_file))
# shutil.make_archive(zip_file, 'zip', OPTS.openram_temp)
super().fail(msg)
def local_drc_check(self, w):
self.reset()
@@ -55,7 +55,7 @@ class openram_test(unittest.TestCase):
self.fail("DRC failed: {}".format(w.name))
elif not OPTS.keep_temp:
self.cleanup()
def local_check(self, a, final_verification=False):
self.reset()
@@ -128,7 +128,7 @@ class openram_test(unittest.TestCase):
def cleanup(self):
""" Reset the duplicate checker and cleanup files. """
files = glob.glob(OPTS.openram_temp + '*')
for f in files:
# Only remove the files