add test of expected results against last sim state
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 22 Sep 2021 20:35:14 +0000 (21:35 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 22 Sep 2021 20:35:14 +0000 (21:35 +0100)
src/soc/simple/test/test_runner.py

index d65b94ab3d4c9b0f440fe03393618d32fe30bd0d..3e478ba8a370e789ebd56682aeb0f7e966946258 100644 (file)
@@ -381,6 +381,16 @@ class TestRunner(FHDLTestCase):
                     for state in sim_states:
                         print (state)
 
+                    # compare against expected results
+                    if test.expected is not None:
+                        # have to put these in manually
+                        test.expected.to_test = test.expected
+                        test.expected.dut = self
+                        test.expected.state_type = "expected"
+                        test.expected.code = 0
+                        # do actual comparison, against last item
+                        sim_states[-1].compare(test.expected)
+
                     self.assertTrue(len(hdl_states) == len(sim_states),
                                     "number of instructions run not the same")