convert to use unittest in fcvt
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 31 Jul 2019 23:16:27 +0000 (00:16 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 31 Jul 2019 23:16:27 +0000 (00:16 +0100)
src/ieee754/fcvt/test/test_fcvt_pipe.py
src/ieee754/fcvt/test/test_fcvt_pipe_32_16.py
src/ieee754/fcvt/test/test_fcvt_pipe_64_16.py
src/ieee754/fcvt/test/test_fcvt_pipe_64_32.py

index 23f9a8223265b0c2d8596f35e9c9fb5d5102eccb..6cd7c80dfe1bae213b51987b3bb7b30a36f60b52 100644 (file)
@@ -6,6 +6,8 @@ from ieee754.fpcommon.test.fpmux import runfp
 
 from sfpy import Float64, Float32, Float16
 
+import unittest
+
 def fcvt_16(x):
     return Float16(x)
 
index 6f8449cebbfe1baf3a17b591484c4b71b7ee4b85..3117bf702c55c803a63a1e49602e61ccc4fd985b 100644 (file)
@@ -8,14 +8,17 @@ from ieee754.fcvt.test.fcvt_data_32_16 import regressions
 
 from sfpy import Float32, Float16
 
+import unittest
+
 def fcvt_16(x):
     return Float16(x)
 
-def test_pipe_fp32_16():
-    dut = FPCVTDownMuxInOut(32, 16, 4)
-    run_pipe_fp(dut, 32, "fcvt", unit_test_single, Float32,
-                regressions, fcvt_16, 100, True)
+class TestFClassPipe(unittest.TestCase):
+    def test_pipe_fp32_16(self):
+        dut = FPCVTDownMuxInOut(32, 16, 4)
+        run_pipe_fp(dut, 32, "fcvt", unit_test_single, Float32,
+                    regressions, fcvt_16, 100, True)
 
 if __name__ == '__main__':
-    test_pipe_fp32_16()
+    unittest.main()
 
index c501e9a614f365f91a861f6719767b564158902a..37619f321aa9f1fee437e95146bfbb4bb706773c 100644 (file)
@@ -8,14 +8,17 @@ from ieee754.fcvt.test.fcvt_data_64_16 import regressions
 
 from sfpy import Float64, Float16
 
+import unittest
+
 def fcvt_16(x):
     return Float16(x)
 
-def test_pipe_fp64_16():
-    dut = FPCVTDownMuxInOut(64, 16, 4)
-    run_pipe_fp(dut, 64, "fcvt", unit_test_single, Float64,
-                regressions, fcvt_16, 100, True)
+class TestFClassPipe(unittest.TestCase):
+    def test_pipe_fp64_16(self):
+        dut = FPCVTDownMuxInOut(64, 16, 4)
+        run_pipe_fp(dut, 64, "fcvt", unit_test_single, Float64,
+                    regressions, fcvt_16, 100, True)
 
 if __name__ == '__main__':
-    test_pipe_fp64_16()
+    unittest.main()
 
index c3d3054d3d60aa8c28c9918631b134928ce93f1a..0febfe1b68da30dea46d23edf83f55ea0510b5b6 100644 (file)
@@ -8,14 +8,17 @@ from ieee754.fcvt.test.fcvt_data_64_32 import regressions
 
 from sfpy import Float64, Float32
 
+import unittest
+
 def fcvt_32(x):
     return Float32(x)
 
-def test_pipe_fp64_32():
-    dut = FPCVTMuxInOut(64, 32, 4)
-    run_pipe_fp(dut, 64, "fcvt", unit_test_single, Float64,
-                regressions, fcvt_32, 100, True)
+class TestFClassPipe(unittest.TestCase):
+    def test_pipe_fp64_32(self):
+        dut = FPCVTMuxInOut(64, 32, 4)
+        run_pipe_fp(dut, 64, "fcvt", unit_test_single, Float64,
+                    regressions, fcvt_32, 100, True)
 
 if __name__ == '__main__':
-    test_pipe_fp64_32()
+    unittest.main()