From 5527e73db08bffa230fca7c9f4ee3ca44ed5fbf8 Mon Sep 17 00:00:00 2001 From: Matt Guthaus Date: Wed, 31 Jan 2018 10:35:51 -0800 Subject: [PATCH] Add descriptive exceptions along with cleanup in unit test checking. --- compiler/tests/testutils.py | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/compiler/tests/testutils.py b/compiler/tests/testutils.py index 12a77c31..57932a68 100644 --- a/compiler/tests/testutils.py +++ b/compiler/tests/testutils.py @@ -26,16 +26,32 @@ class openram_test(unittest.TestCase): a.gds_write(tempgds) import verify - self.assertFalse(verify.run_drc(a.name, tempgds)) - self.assertFalse(verify.run_lvs(a.name, tempgds, tempspice)) + try: + 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 + '*') for f in files: # Only remove the files if os.path.isfile(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 design.design.name_map=[]