From: Jacob Lifshay Date: Tue, 7 Sep 2021 06:53:26 +0000 (-0700) Subject: fix test_caller_bcd_full.py not actually running correct test cases X-Git-Tag: xlen-bcd~1 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=59c0e03a15e3c62603e91e23ac775de42a05d8e7;p=openpower-isa.git fix test_caller_bcd_full.py not actually running correct test cases --- diff --git a/src/openpower/decoder/isa/test_caller_bcd_full.py b/src/openpower/decoder/isa/test_caller_bcd_full.py index 566b0e47..8af9e0c1 100644 --- a/src/openpower/decoder/isa/test_caller_bcd_full.py +++ b/src/openpower/decoder/isa/test_caller_bcd_full.py @@ -7,6 +7,7 @@ from openpower.decoder.selectable_int import SelectableInt from openpower.decoder.isa.test_runner import run_tst import power_instruction_analyzer as pia from hashlib import sha256 +from textwrap import dedent class BCDFullTestCase(FHDLTestCase): @@ -98,9 +99,11 @@ class BCDFullTestCase(FHDLTestCase): for i in range(BCDFullTestCase.TEST_INDEX_COUNT): for j in 'addg6s', 'cdtbcd', 'cbcdtd': - def tst_fn(self): - getattr(self, f"tst_{j}")(i) - setattr(BCDFullTestCase, f"test_{j}_{i}", tst_fn) + exec(dedent(f""" + def tst_{j}_{i}(self): + self.tst_{j}({i}) + BCDFullTestCase.test_{j}_{i} = tst_{j}_{i} + """)) if __name__ == "__main__": unittest.main()