fix setvl. not setting CR0 properly
[openpower-isa.git] / src / openpower / decoder / isa / test_caller_bitmanip_av.py
index 9c4788fcd8de9f54a1b925f62d7bed3ac3e3eb1e..803d71684f4f8bb746f8b110d02c93347078a1bf 100644 (file)
@@ -6,33 +6,21 @@ related bugs:
 """
 
 import unittest
-import sys
-
-# These tests utilize the run_hdl=False parameter to compare
-# simulator with expected states
-from soc.simple.test.test_runner import TestRunner
+from openpower.test.runner import TestRunnerBase
 from openpower.test.bitmanip.av_cases import AVTestCase
 
+# writing the test_caller invocation this way makes it work with pytest
 
-if __name__ == "__main__":
-
-    # allow list of testing to be selected by command-line
-    testing = sys.argv[1:]
-    sys.argv = sys.argv[:1]
 
-    if not testing:
-        testing = ['bitmanipav']
+class TestAV(TestRunnerBase):
+    def __init__(self, test):
+        assert test == 'test'
+        super().__init__(AVTestCase().test_data)
 
-    unittest.main(exit=False)
-    suite = unittest.TestSuite()
+    def test(self):
+        # dummy function to make unittest try to test this class
+        pass
 
-    # dictionary of data for tests
-    tests = {'bitmanipav': AVTestCase().test_data}
 
-    # walk through all tests, those requested get added
-    for tname, data in tests.items():
-        if tname in testing:
-            suite.addTest(TestRunner(data, run_hdl=False))
-
-    runner = unittest.TextTestRunner()
-    runner.run(suite)
+if __name__ == "__main__":
+    unittest.main()