Add descriptive exceptions along with cleanup in unit test checking.

This commit is contained in:
Matt Guthaus 2018-01-31 10:35:51 -08:00
parent 51a72e26c7
commit 1175f515c8
1 changed files with 19 additions and 3 deletions

View File

@ -26,8 +26,23 @@ class openram_test(unittest.TestCase):
a.gds_write(tempgds) a.gds_write(tempgds)
import verify import verify
self.assertFalse(verify.run_drc(a.name, tempgds)) try:
self.assertFalse(verify.run_lvs(a.name, tempgds, tempspice)) self.assertFalse(verify.run_drc(a.name, tempgds)==0)
except:
self.reset()
raise Exception('DRC failed: {}'.format(a.name))
try:
self.assertFalse(verify.run_lvs(a.name, tempgds, tempspice)==0)
except:
self.reset()
raise Exception('LVS failed: {}'.format(a.name))
self.cleanup()
def cleanup(self):
""" Reset the duplicate checker and cleanup files. """
self.reset()
files = glob.glob(OPTS.openram_temp + '*') files = glob.glob(OPTS.openram_temp + '*')
for f in files: for f in files:
@ -35,7 +50,8 @@ class openram_test(unittest.TestCase):
if os.path.isfile(f): if os.path.isfile(f):
os.remove(f) os.remove(f)
# reset the static duplicate name checker for unit tests def reset(self):
""" Reset the static duplicate name checker for unit tests """
import design import design
design.design.name_map=[] design.design.name_map=[]