예제 #1
0
def suite():
    testSuite = unittest.TestSuite()
    testSuite.addTest(parameterize(TestKeypoints, "orientation_gpu", (128,), "descriptor_gpu2", (8, 8, 8)))
    testSuite.addTest(parameterize(TestKeypoints, "orientation_cpu", (1,), "descriptor_cpu", (1,)))
    testSuite.addTest(parameterize(TestKeypoints, "orientation_gpu", (128,), "descriptor_gpu1", (8, 4, 4)))
    testSuite.addTest(TestFeature("test_keypoints"))
    return testSuite
def suite():
    testSuite = unittest.TestSuite()
    testSuite.addTest(
        parameterize(TestKeypoints, "orientation_gpu", (128, ),
                     "descriptor_gpu2", (8, 8, 8)))
    testSuite.addTest(
        parameterize(TestKeypoints, "orientation_cpu", (1, ), "descriptor_cpu",
                     (1, )))
    testSuite.addTest(
        parameterize(TestKeypoints, "orientation_gpu", (128, ),
                     "descriptor_gpu1", (8, 4, 4)))
    testSuite.addTest(TestFeature("test_keypoints"))
    return testSuite
def test_fft(backend, dimensions=None):
    testSuite = unittest.TestSuite()
    transform_infos = TransformInfos()
    test_data = TestData()
    dimensions = dimensions or transform_infos.dimensions

    logger.info("Testing backend: %s" % backend)
    for trdim in dimensions:
        logger.debug("   testing %s" % trdim)
        for mode in transform_infos.modes:
            logger.debug("   testing %s:%s" % (trdim, mode))
            for size in transform_infos.sizes[trdim]:
                logger.debug("      size: %s" % str(size))
                testcase = parameterize(
                    TestFFT,
                    param={
                        "transform_infos": transform_infos,
                        "test_data": test_data,
                        "backend": backend,
                        "trdim": trdim,
                        "mode": mode,
                        "size": size,
                    }
                )
                testSuite.addTest(testcase)
    return testSuite
예제 #4
0
파일: test_fft.py 프로젝트: dnaudet/silx
def test_fft(backend, dimensions=None):
    testSuite = unittest.TestSuite()
    transform_infos = TransformInfos()
    test_data = TestData()
    dimensions = dimensions or transform_infos.dimensions

    logger.info("Testing backend: %s" % backend)
    for trdim in dimensions:
        logger.debug("   testing %s" % trdim)
        for mode in transform_infos.modes:
            logger.debug("   testing %s:%s" % (trdim, mode))
            for size in transform_infos.sizes[trdim]:
                logger.debug("      size: %s" % str(size))
                testcase = parameterize(
                    TestFFT,
                    param={
                        "transform_infos": transform_infos,
                        "test_data": test_data,
                        "backend": backend,
                        "trdim": trdim,
                        "mode": mode,
                        "size": size,
                    }
                )
                testSuite.addTest(testcase)
    return testSuite
예제 #5
0
def test_convolution():
    boundary_handling_ = ["reflect", "nearest", "wrap", "constant"]
    use_textures_ = [True, False]
    input_on_device_ = [True, False]
    output_on_device_ = [True, False]
    testSuite = unittest.TestSuite()

    param_vals = list(product(
        boundary_handling_,
        use_textures_,
        input_on_device_,
        output_on_device_
    ))
    for boundary_handling, use_textures, input_dev, output_dev in param_vals:
        testcase = parameterize(
            TestConvolution,
            param={
                "boundary_handling": boundary_handling,
                "input_on_device": input_dev,
                "output_on_device": output_dev,
                "use_textures": use_textures,
            }
        )
        testSuite.addTest(testcase)
    return testSuite
예제 #6
0
def suite():
    test_suite = unittest.TestSuite()

    tests = OrderedDict()
    with open(resourceFileName('quanty:test/tests/manifest.csv')) as fp:
        reader = csv.DictReader(fp, quotechar='"', quoting=csv.QUOTE_ALL,
                                skipinitialspace=True)
        for line in reader:
            index = line['index']
            line.pop('index', None)
            tests[index] = line

    for test in tests:
        parameters = tests[test]
        test_suite.addTest(parameterize(TestQuanty, test, parameters))

    return test_suite