From: Luke Kenneth Casson Leighton Date: Wed, 31 Jul 2019 23:16:27 +0000 (+0100) Subject: convert to use unittest in fcvt X-Git-Tag: ls180-24jan2020~586 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=29531fc5922c2c70d23bc863af3ba2ae301d1978;p=ieee754fpu.git convert to use unittest in fcvt --- diff --git a/src/ieee754/fcvt/test/test_fcvt_pipe.py b/src/ieee754/fcvt/test/test_fcvt_pipe.py index 23f9a822..6cd7c80d 100644 --- a/src/ieee754/fcvt/test/test_fcvt_pipe.py +++ b/src/ieee754/fcvt/test/test_fcvt_pipe.py @@ -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) diff --git a/src/ieee754/fcvt/test/test_fcvt_pipe_32_16.py b/src/ieee754/fcvt/test/test_fcvt_pipe_32_16.py index 6f8449ce..3117bf70 100644 --- a/src/ieee754/fcvt/test/test_fcvt_pipe_32_16.py +++ b/src/ieee754/fcvt/test/test_fcvt_pipe_32_16.py @@ -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() diff --git a/src/ieee754/fcvt/test/test_fcvt_pipe_64_16.py b/src/ieee754/fcvt/test/test_fcvt_pipe_64_16.py index c501e9a6..37619f32 100644 --- a/src/ieee754/fcvt/test/test_fcvt_pipe_64_16.py +++ b/src/ieee754/fcvt/test/test_fcvt_pipe_64_16.py @@ -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() diff --git a/src/ieee754/fcvt/test/test_fcvt_pipe_64_32.py b/src/ieee754/fcvt/test/test_fcvt_pipe_64_32.py index c3d3054d..0febfe1b 100644 --- a/src/ieee754/fcvt/test/test_fcvt_pipe_64_32.py +++ b/src/ieee754/fcvt/test/test_fcvt_pipe_64_32.py @@ -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()