add test_caller_trap.py which stunningly actually works reasonably well
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 18 Oct 2023 19:56:40 +0000 (20:56 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 22 Dec 2023 19:26:21 +0000 (19:26 +0000)
(TrapTestCase has only previously been run on TestIssuer)

src/openpower/decoder/isa/test_caller_trap.py [new file with mode: 0644]

diff --git a/src/openpower/decoder/isa/test_caller_trap.py b/src/openpower/decoder/isa/test_caller_trap.py
new file mode 100644 (file)
index 0000000..6d459c4
--- /dev/null
@@ -0,0 +1,27 @@
+"""Trap tests
+
+related bugs:
+
+ * https://bugs.libre-soc.org/show_bug.cgi?id=982
+"""
+
+import unittest
+
+from openpower.test.trap.trap_cases import TrapTestCase
+from openpower.test.runner import TestRunnerBase
+
+# writing the test_caller invocation this way makes it work with pytest
+
+
+class TrapTest(TestRunnerBase):
+    def __init__(self, test):
+        assert test == 'test'
+        super().__init__(TrapTestCase().test_data)
+
+    def test(self):
+        # dummy function to make unittest try to test this class
+        pass
+
+
+if __name__ == "__main__":
+    unittest.main()