From 4049d0522670fee00df04152cdd27e4f26fe4fb3 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Fri, 9 Sep 2022 19:26:54 +0100 Subject: [PATCH] add subtests --- src/openpower/sv/trans/test_pysvp64dis.py | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/openpower/sv/trans/test_pysvp64dis.py b/src/openpower/sv/trans/test_pysvp64dis.py index 61f83366..2566d944 100644 --- a/src/openpower/sv/trans/test_pysvp64dis.py +++ b/src/openpower/sv/trans/test_pysvp64dis.py @@ -20,11 +20,13 @@ class SVSTATETestCase(unittest.TestCase): #print ("insn", insn) insns = list(insns) print ("insns", insns) - for i, line in enumerate(dump(insns, verbose=False, short=True)): - print("instruction", repr(line), repr(expected[i])) - self.assertEqual(expected[i], line, - "instruction %i do not match " - "'%s' expected '%s'" % (i, line, expected[i])) + for i, line in enumerate(dump(insns, verbosity=Verbosity.SHORT)): + name = expected[i].split(" ")[0] + with self.subTest(name): + print("instruction", repr(line), repr(expected[i])) + self.assertEqual(expected[i], line, + "instruction does not match " + "'%s' expected '%s'" % (line, expected[i])) def test_1_svshape2(self): expected = [ @@ -41,10 +43,12 @@ class SVSTATETestCase(unittest.TestCase): insns = list(insns) print ("insns", insns) for i, line in enumerate(dump(insns, verbosity=Verbosity.SHORT)): - print("instruction", repr(line), repr(expected[i])) - self.assertEqual(expected[i], line, - "instruction %i do not match " - "'%s' expected '%s'" % (i, line, expected[i])) + name = expected[i].split(" ")[0] + with self.subTest(name): + print("instruction", repr(line), repr(expected[i])) + self.assertEqual(expected[i], line, + "instruction does not match " + "'%s' expected '%s'" % (line, expected[i])) if __name__ == "__main__": unittest.main() -- 2.30.2