From: Donald Sebastian Leung Date: Fri, 18 Sep 2020 03:45:11 +0000 (+0800) Subject: Add option to specify spec_name X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=31bfaf768c492e9ada4de12c65d3875407314439;p=nmigen.git Add option to specify spec_name --- diff --git a/nmigen/test/utils.py b/nmigen/test/utils.py index 29bd5b6..aa7b81d 100644 --- a/nmigen/test/utils.py +++ b/nmigen/test/utils.py @@ -53,14 +53,15 @@ class FHDLTestCase(unittest.TestCase): if msg is not None: self.assertEqual(str(warns[0].message), msg) - def assertFormal(self, spec, mode="bmc", depth=1, engine="smtbmc"): + def assertFormal(self, spec, mode="bmc", depth=1, engine="smtbmc", spec_name=None): caller, *_ = traceback.extract_stack(limit=2) spec_root, _ = os.path.splitext(caller.filename) spec_dir = os.path.dirname(spec_root) - spec_name = "{}_{}".format( - os.path.basename(spec_root).replace("test_", "spec_"), - caller.name.replace("test_", "") - ) + if spec_name is None: + spec_name = "{}_{}".format( + os.path.basename(spec_root).replace("test_", "spec_"), + caller.name.replace("test_", "") + ) # The sby -f switch seems not fully functional when sby is reading from stdin. if os.path.exists(os.path.join(spec_dir, spec_name)):