From 29531fc5922c2c70d23bc863af3ba2ae301d1978 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Thu, 1 Aug 2019 00:16:27 +0100 Subject: [PATCH] convert to use unittest in fcvt --- src/ieee754/fcvt/test/test_fcvt_pipe.py | 2 ++ src/ieee754/fcvt/test/test_fcvt_pipe_32_16.py | 13 ++++++++----- src/ieee754/fcvt/test/test_fcvt_pipe_64_16.py | 13 ++++++++----- src/ieee754/fcvt/test/test_fcvt_pipe_64_32.py | 13 ++++++++----- 4 files changed, 26 insertions(+), 15 deletions(-) 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() -- 2.30.2