From 59c0e03a15e3c62603e91e23ac775de42a05d8e7 Mon Sep 17 00:00:00 2001 From: Jacob Lifshay Date: Mon, 6 Sep 2021 23:53:26 -0700 Subject: [PATCH] fix test_caller_bcd_full.py not actually running correct test cases --- src/openpower/decoder/isa/test_caller_bcd_full.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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() -- 2.30.2