From ff04a3307f6f96f510674426c94c482891d7e2f7 Mon Sep 17 00:00:00 2001 From: Francois Budin Date: Fri, 5 Apr 2019 00:14:42 -0400 Subject: [PATCH 1/3] ENH: Move Python tests into wrapping subfolder Python tests are moved from `test` subfolder to `wrapping/test/python`. This allows to disable C++ tests and Python (or other wrapping) tests independently. This is very convenient to speed up compilation and testing on CI platforms. A new advanced CMake variable `DISABLE_MODULE_TESTS` has been added to disable all the tests that are not part of the wrapping. All the ITK module tests that are in the standard `test` subfolder of each module are disabled when this option is turned ON. The only tests that are left to compiled and run are tests in third party modules and wrapping tests. This new option allows to significantly speed up compilation time (about 20 to 25%). --- CMake/ITKModuleDoxygen.cmake | 2 +- CMake/ITKModuleEnablement.cmake | 2 +- CMake/ITKModuleKWStyleTest.cmake | 20 +++-- CMake/ITKModuleTest.cmake | 84 ++++++++----------- CMakeLists.txt | 7 +- .../NumPy/{ => wrapping}/test/CMakeLists.txt | 2 - .../test/itkPyBufferMemoryLeakTest.py | 0 .../test/itkPyBufferPipelineTest.py | 0 .../{ => wrapping}/test/itkPyBufferTest.py | 0 .../NumPy/{ => wrapping}/test/itkPyVnlTest.py | 0 Modules/Core/Common/test/CMakeLists.txt | 9 -- .../Core/Common/wrapping/test/CMakeLists.txt | 8 ++ .../{ => wrapping}/test/itkDirectoryTest.py | 0 .../{ => wrapping}/test/itkIndexOffsetTest.py | 0 .../test/itkMetaDataDictionaryTest.py | 0 .../Core/ImageFunction/test/CMakeLists.txt | 3 - .../wrapping/test/CMakeLists.txt | 2 + Modules/Core/Mesh/test/CMakeLists.txt | 23 ----- .../Core/Mesh/wrapping/test/CMakeLists.txt | 22 +++++ .../Core/SpatialObjects/test/CMakeLists.txt | 8 -- .../wrapping/test/CMakeLists.txt | 7 ++ .../{ => wrapping}/test/SpatialObjectTest.py | 0 .../AnisotropicSmoothing/test/CMakeLists.txt | 25 ------ ...nisotropicDiffusionImageFilterTest.png.md5 | 0 ...otropicDiffusionImageFilterTest.png.sha512 | 0 .../wrapping/test/CMakeLists.txt | 26 ++++++ ...tureAnisotropicDiffusionImageFilterTest.py | 0 ...ientAnisotropicDiffusionImageFilterTest.py | 0 ...oothingRecursiveGaussianImageFilterTest.py | 0 .../Filtering/AntiAlias/test/CMakeLists.txt | 13 --- .../test/AntiAliasBinaryImageFilterTest.py | 0 ...thonAntiAliasBinaryImageFilterTest.png.md5 | 0 ...nAntiAliasBinaryImageFilterTest.png.sha512 | 0 .../AntiAlias/wrapping/test/CMakeLists.txt | 13 +++ .../test/Input/VentricleModel.png.md5 | 0 .../test/Input/VentricleModel.png.sha512 | 0 .../test/CMakeLists.txt | 22 ----- .../PythonBinaryDilateImageFilterTest.png.md5 | 0 ...thonBinaryDilateImageFilterTest.png.sha512 | 0 .../PythonBinaryErodeImageFilterTest.png.md5 | 0 ...ythonBinaryErodeImageFilterTest.png.sha512 | 0 .../test/BinaryDilateImageFilterTest.py | 0 .../test/BinaryErodeImageFilterTest.py | 0 .../wrapping/test/CMakeLists.txt | 21 +++++ .../CurvatureFlow/test/CMakeLists.txt | 10 --- .../wrapping/test/CMakeLists.txt | 9 ++ .../test/CurvatureFlowImageFilterTest.py | 0 Modules/Filtering/FFT/test/CMakeLists.txt | 13 --- .../PythonFFTImageFilterImaginaryTest.png.md5 | 0 ...thonFFTImageFilterImaginaryTest.png.sha512 | 0 .../PythonFFTImageFilterRealTest.png.md5 | 0 .../PythonFFTImageFilterRealTest.png.sha512 | 0 .../FFT/wrapping/test/CMakeLists.txt | 12 +++ .../{ => wrapping}/test/FFTImageFilterTest.py | 0 .../FastMarching/test/CMakeLists.txt | 43 ---------- .../FastMarching/wrapping/test/CMakeLists.txt | 45 ++++++++++ .../test/FastMarchingImageFilterTest.py | 0 .../ImageFeature/test/CMakeLists.txt | 31 ------- ...nCannyEdgeDetectionImageFilterTest.png.md5 | 0 ...nnyEdgeDetectionImageFilterTest.png.sha512 | 0 .../ImageFeature/wrapping/test/CMakeLists.txt | 33 ++++++++ .../test/CannyEdgeDetectionImageFilterTest.py | 0 .../test/LaplacianImageFilterTest.py | 0 .../itkGradientVectorFlowImageFilterTest.py | 0 .../ImageFilterBase/test/CMakeLists.txt | 12 --- .../wrapping/test/CMakeLists.txt | 11 +++ .../test/CastImageFilterTest.py | 0 .../ImageFrequency/test/CMakeLists.txt | 6 -- .../wrapping/test/CMakeLists.txt | 5 ++ .../ImageGradient/test/CMakeLists.txt | 13 --- ...deRecursiveGaussianImageFilterTest.png.md5 | 0 ...ecursiveGaussianImageFilterTest.png.sha512 | 0 .../wrapping/test/CMakeLists.txt | 14 ++++ ...gnitudeRecursiveGaussianImageFilterTest.py | 0 .../Filtering/ImageGrid/test/CMakeLists.txt | 44 ---------- .../PythonResampleImageFilterTest1.png.md5 | 0 .../PythonResampleImageFilterTest1.png.sha512 | 0 .../PythonResampleImageFilterTest2.png.md5 | 0 .../PythonResampleImageFilterTest2.png.sha512 | 0 .../PythonResampleImageFilterTest3.png.md5 | 0 .../PythonResampleImageFilterTest3.png.sha512 | 0 .../PythonResampleImageFilterTest4.png.md5 | 0 .../PythonResampleImageFilterTest4.png.sha512 | 0 .../ImageGrid/wrapping/test/CMakeLists.txt | 45 ++++++++++ .../test/ResampleImageFilterTest.py | 0 .../ImageIntensity/test/CMakeLists.txt | 20 ----- .../PythonSigmoidImageFilterTest.png.md5 | 0 .../PythonSigmoidImageFilterTest.png.sha512 | 0 .../wrapping/test/CMakeLists.txt | 19 +++++ .../test/SigmoidImageFilterTest.py | 0 .../itkIntensityWindowingImageFilterTest.py | 0 .../test/CMakeLists.txt | 44 ---------- ...nBoxGrayscaleDilateImageFilterTest.png.md5 | 0 ...xGrayscaleDilateImageFilterTest.png.sha512 | 0 ...thonGrayscaleDilateImageFilterTest.png.md5 | 0 ...nGrayscaleDilateImageFilterTest.png.sha512 | 0 ...ythonGrayscaleErodeImageFilterTest.png.md5 | 0 ...onGrayscaleErodeImageFilterTest.png.sha512 | 0 .../test/BoxGrayscaleDilateImageFilterTest.py | 0 .../wrapping/test/CMakeLists.txt | 43 ++++++++++ .../test/FlatStructuringElementTest.py | 0 .../test/GrayscaleDilateImageFilterTest.py | 0 .../test/GrayscaleErodeImageFilterTest.py | 0 Modules/Filtering/Path/test/CMakeLists.txt | 13 --- .../Path/wrapping/test/CMakeLists.txt | 12 +++ .../Filtering/Smoothing/test/CMakeLists.txt | 49 ----------- ...honMeanImageFilterFunctionCallTest.png.md5 | 0 ...MeanImageFilterFunctionCallTest.png.sha512 | 0 .../PythonMeanImageFilterTest.png.md5 | 0 .../PythonMeanImageFilterTest.png.sha512 | 0 .../PythonMedianImageFilterTest.png.md5 | 0 .../PythonMedianImageFilterTest.png.sha512 | 0 .../Smoothing/wrapping/test/CMakeLists.txt | 50 +++++++++++ .../test/MeanImageFilterFunctionCallTest.py | 0 .../test/MeanImageFilterTest.py | 0 ...nImageFilterFunctionalDocumentationTest.py | 0 .../test/MedianImageFilterTest.py | 0 .../test/PythonAutoPipelineTest.py | 0 .../Thresholding/test/CMakeLists.txt | 24 ------ ...thonBinaryThresholdImageFilterTest.png.md5 | 0 ...nBinaryThresholdImageFilterTest.png.sha512 | 0 .../PythonThresholdImageFilterTest.png.md5 | 0 .../PythonThresholdImageFilterTest.png.sha512 | 0 .../test/BinaryThresholdImageFilterTest.py | 0 .../Thresholding/wrapping/test/CMakeLists.txt | 23 +++++ .../test/ThresholdImageFilterTest.py | 0 Modules/IO/GDCM/test/CMakeLists.txt | 8 -- Modules/IO/GDCM/wrapping/test/CMakeLists.txt | 7 ++ .../test/ReadDicomAndReadTagTest.py | 0 Modules/IO/MeshGifti/test/CMakeLists.txt | 3 - .../IO/MeshGifti/wrapping/test/CMakeLists.txt | 2 + Modules/IO/MeshOBJ/test/CMakeLists.txt | 3 - .../IO/MeshOBJ/wrapping/test/CMakeLists.txt | 2 + Modules/IO/MeshOFF/test/CMakeLists.txt | 3 - .../IO/MeshOFF/wrapping/test/CMakeLists.txt | 2 + .../wrapping/test/CMakeLists.txt | 0 .../test/itkCurvatureFlowTestPython2.py | 0 .../Numerics/Statistics/test/CMakeLists.txt | 2 - .../Statistics/wrapping/test/CMakeLists.txt | 2 + .../Metricsv4/test/CMakeLists.txt | 7 -- .../Metricsv4/wrapping/test/CMakeLists.txt | 6 ++ .../LevelSets/test/CMakeLists.txt | 51 ----------- .../LevelSets/wrapping/test/CMakeLists.txt | 52 ++++++++++++ .../GeodesicActiveContourImageFilterTest.py | 0 .../test/LazyLoadingImageTest.py | 0 ...SegmentationLevelSetGrayMatterTest.png.md5 | 0 ...mentationLevelSetGrayMatterTest.png.sha512 | 0 ...dSegmentationLevelSetVentricleTest.png.md5 | 0 ...gmentationLevelSetVentricleTest.png.sha512 | 0 ...egmentationLevelSetWhiteMatterTest.png.md5 | 0 ...entationLevelSetWhiteMatterTest.png.sha512 | 0 ...holdSegmentationLevelSetImageFilterTest.py | 0 .../test/CMakeLists.txt | 2 - .../wrapping/test/CMakeLists.txt | 1 + .../Watersheds/test/CMakeLists.txt | 12 --- .../Watersheds/wrapping/test/CMakeLists.txt | 14 ++++ .../test/WatershedSegmentation1Test.py | 0 .../AzurePipelinesLinuxPython.yml | 1 + .../AzurePipelinesMacOSPython.yml | 1 + .../AzurePipelinesWindowsPython.yml | 1 + Wrapping/Generators/Python/CMakeLists.txt | 2 - Wrapping/Modules/CMakeLists.txt | 2 + Wrapping/TypedefMacros.cmake | 5 ++ 163 files changed, 569 insertions(+), 584 deletions(-) rename Modules/Bridge/NumPy/{ => wrapping}/test/CMakeLists.txt (97%) rename Modules/Bridge/NumPy/{ => wrapping}/test/itkPyBufferMemoryLeakTest.py (100%) rename Modules/Bridge/NumPy/{ => wrapping}/test/itkPyBufferPipelineTest.py (100%) rename Modules/Bridge/NumPy/{ => wrapping}/test/itkPyBufferTest.py (100%) rename Modules/Bridge/NumPy/{ => wrapping}/test/itkPyVnlTest.py (100%) create mode 100644 Modules/Core/Common/wrapping/test/CMakeLists.txt rename Modules/Core/Common/{ => wrapping}/test/itkDirectoryTest.py (100%) rename Modules/Core/Common/{ => wrapping}/test/itkIndexOffsetTest.py (100%) rename Modules/Core/Common/{ => wrapping}/test/itkMetaDataDictionaryTest.py (100%) create mode 100644 Modules/Core/ImageFunction/wrapping/test/CMakeLists.txt create mode 100644 Modules/Core/Mesh/wrapping/test/CMakeLists.txt create mode 100644 Modules/Core/SpatialObjects/wrapping/test/CMakeLists.txt rename Modules/Core/SpatialObjects/{ => wrapping}/test/SpatialObjectTest.py (100%) rename Modules/Filtering/AnisotropicSmoothing/{ => wrapping}/test/Baseline/PythonGradientAnisotropicDiffusionImageFilterTest.png.md5 (100%) rename Modules/Filtering/AnisotropicSmoothing/{ => wrapping}/test/Baseline/PythonGradientAnisotropicDiffusionImageFilterTest.png.sha512 (100%) create mode 100644 Modules/Filtering/AnisotropicSmoothing/wrapping/test/CMakeLists.txt rename Modules/Filtering/AnisotropicSmoothing/{ => wrapping}/test/CurvatureAnisotropicDiffusionImageFilterTest.py (100%) rename Modules/Filtering/AnisotropicSmoothing/{ => wrapping}/test/GradientAnisotropicDiffusionImageFilterTest.py (100%) rename Modules/Filtering/AnisotropicSmoothing/{ => wrapping}/test/SmoothingRecursiveGaussianImageFilterTest.py (100%) rename Modules/Filtering/AntiAlias/{ => wrapping}/test/AntiAliasBinaryImageFilterTest.py (100%) rename Modules/Filtering/AntiAlias/{ => wrapping}/test/Baseline/PythonAntiAliasBinaryImageFilterTest.png.md5 (100%) rename Modules/Filtering/AntiAlias/{ => wrapping}/test/Baseline/PythonAntiAliasBinaryImageFilterTest.png.sha512 (100%) create mode 100644 Modules/Filtering/AntiAlias/wrapping/test/CMakeLists.txt rename Modules/Filtering/AntiAlias/{ => wrapping}/test/Input/VentricleModel.png.md5 (100%) rename Modules/Filtering/AntiAlias/{ => wrapping}/test/Input/VentricleModel.png.sha512 (100%) rename Modules/Filtering/BinaryMathematicalMorphology/{ => wrapping}/test/Baseline/PythonBinaryDilateImageFilterTest.png.md5 (100%) rename Modules/Filtering/BinaryMathematicalMorphology/{ => wrapping}/test/Baseline/PythonBinaryDilateImageFilterTest.png.sha512 (100%) rename Modules/Filtering/BinaryMathematicalMorphology/{ => wrapping}/test/Baseline/PythonBinaryErodeImageFilterTest.png.md5 (100%) rename Modules/Filtering/BinaryMathematicalMorphology/{ => wrapping}/test/Baseline/PythonBinaryErodeImageFilterTest.png.sha512 (100%) rename Modules/Filtering/BinaryMathematicalMorphology/{ => wrapping}/test/BinaryDilateImageFilterTest.py (100%) rename Modules/Filtering/BinaryMathematicalMorphology/{ => wrapping}/test/BinaryErodeImageFilterTest.py (100%) create mode 100644 Modules/Filtering/BinaryMathematicalMorphology/wrapping/test/CMakeLists.txt create mode 100644 Modules/Filtering/CurvatureFlow/wrapping/test/CMakeLists.txt rename Modules/Filtering/CurvatureFlow/{ => wrapping}/test/CurvatureFlowImageFilterTest.py (100%) rename Modules/Filtering/FFT/{ => wrapping}/test/Baseline/PythonFFTImageFilterImaginaryTest.png.md5 (100%) rename Modules/Filtering/FFT/{ => wrapping}/test/Baseline/PythonFFTImageFilterImaginaryTest.png.sha512 (100%) rename Modules/Filtering/FFT/{ => wrapping}/test/Baseline/PythonFFTImageFilterRealTest.png.md5 (100%) rename Modules/Filtering/FFT/{ => wrapping}/test/Baseline/PythonFFTImageFilterRealTest.png.sha512 (100%) create mode 100644 Modules/Filtering/FFT/wrapping/test/CMakeLists.txt rename Modules/Filtering/FFT/{ => wrapping}/test/FFTImageFilterTest.py (100%) create mode 100644 Modules/Filtering/FastMarching/wrapping/test/CMakeLists.txt rename Modules/Filtering/FastMarching/{ => wrapping}/test/FastMarchingImageFilterTest.py (100%) rename Modules/Filtering/ImageFeature/{ => wrapping}/test/Baseline/PythonCannyEdgeDetectionImageFilterTest.png.md5 (100%) rename Modules/Filtering/ImageFeature/{ => wrapping}/test/Baseline/PythonCannyEdgeDetectionImageFilterTest.png.sha512 (100%) create mode 100644 Modules/Filtering/ImageFeature/wrapping/test/CMakeLists.txt rename Modules/Filtering/ImageFeature/{ => wrapping}/test/CannyEdgeDetectionImageFilterTest.py (100%) rename Modules/Filtering/ImageFeature/{ => wrapping}/test/LaplacianImageFilterTest.py (100%) rename Modules/Filtering/ImageFeature/{ => wrapping}/test/itkGradientVectorFlowImageFilterTest.py (100%) create mode 100644 Modules/Filtering/ImageFilterBase/wrapping/test/CMakeLists.txt rename Modules/Filtering/ImageFilterBase/{ => wrapping}/test/CastImageFilterTest.py (100%) create mode 100644 Modules/Filtering/ImageFrequency/wrapping/test/CMakeLists.txt rename Modules/Filtering/ImageGradient/{ => wrapping}/test/Baseline/PythonGradientMagnitudeRecursiveGaussianImageFilterTest.png.md5 (100%) rename Modules/Filtering/ImageGradient/{ => wrapping}/test/Baseline/PythonGradientMagnitudeRecursiveGaussianImageFilterTest.png.sha512 (100%) create mode 100644 Modules/Filtering/ImageGradient/wrapping/test/CMakeLists.txt rename Modules/Filtering/ImageGradient/{ => wrapping}/test/GradientMagnitudeRecursiveGaussianImageFilterTest.py (100%) rename Modules/Filtering/ImageGrid/{ => wrapping}/test/Baseline/PythonResampleImageFilterTest1.png.md5 (100%) rename Modules/Filtering/ImageGrid/{ => wrapping}/test/Baseline/PythonResampleImageFilterTest1.png.sha512 (100%) rename Modules/Filtering/ImageGrid/{ => wrapping}/test/Baseline/PythonResampleImageFilterTest2.png.md5 (100%) rename Modules/Filtering/ImageGrid/{ => wrapping}/test/Baseline/PythonResampleImageFilterTest2.png.sha512 (100%) rename Modules/Filtering/ImageGrid/{ => wrapping}/test/Baseline/PythonResampleImageFilterTest3.png.md5 (100%) rename Modules/Filtering/ImageGrid/{ => wrapping}/test/Baseline/PythonResampleImageFilterTest3.png.sha512 (100%) rename Modules/Filtering/ImageGrid/{ => wrapping}/test/Baseline/PythonResampleImageFilterTest4.png.md5 (100%) rename Modules/Filtering/ImageGrid/{ => wrapping}/test/Baseline/PythonResampleImageFilterTest4.png.sha512 (100%) create mode 100644 Modules/Filtering/ImageGrid/wrapping/test/CMakeLists.txt rename Modules/Filtering/ImageGrid/{ => wrapping}/test/ResampleImageFilterTest.py (100%) rename Modules/Filtering/ImageIntensity/{ => wrapping}/test/Baseline/PythonSigmoidImageFilterTest.png.md5 (100%) rename Modules/Filtering/ImageIntensity/{ => wrapping}/test/Baseline/PythonSigmoidImageFilterTest.png.sha512 (100%) create mode 100644 Modules/Filtering/ImageIntensity/wrapping/test/CMakeLists.txt rename Modules/Filtering/ImageIntensity/{ => wrapping}/test/SigmoidImageFilterTest.py (100%) rename Modules/Filtering/ImageIntensity/{ => wrapping}/test/itkIntensityWindowingImageFilterTest.py (100%) rename Modules/Filtering/MathematicalMorphology/{ => wrapping}/test/Baseline/PythonBoxGrayscaleDilateImageFilterTest.png.md5 (100%) rename Modules/Filtering/MathematicalMorphology/{ => wrapping}/test/Baseline/PythonBoxGrayscaleDilateImageFilterTest.png.sha512 (100%) rename Modules/Filtering/MathematicalMorphology/{ => wrapping}/test/Baseline/PythonGrayscaleDilateImageFilterTest.png.md5 (100%) rename Modules/Filtering/MathematicalMorphology/{ => wrapping}/test/Baseline/PythonGrayscaleDilateImageFilterTest.png.sha512 (100%) rename Modules/Filtering/MathematicalMorphology/{ => wrapping}/test/Baseline/PythonGrayscaleErodeImageFilterTest.png.md5 (100%) rename Modules/Filtering/MathematicalMorphology/{ => wrapping}/test/Baseline/PythonGrayscaleErodeImageFilterTest.png.sha512 (100%) rename Modules/Filtering/MathematicalMorphology/{ => wrapping}/test/BoxGrayscaleDilateImageFilterTest.py (100%) create mode 100644 Modules/Filtering/MathematicalMorphology/wrapping/test/CMakeLists.txt rename Modules/Filtering/MathematicalMorphology/{ => wrapping}/test/FlatStructuringElementTest.py (100%) rename Modules/Filtering/MathematicalMorphology/{ => wrapping}/test/GrayscaleDilateImageFilterTest.py (100%) rename Modules/Filtering/MathematicalMorphology/{ => wrapping}/test/GrayscaleErodeImageFilterTest.py (100%) create mode 100644 Modules/Filtering/Path/wrapping/test/CMakeLists.txt rename Modules/Filtering/Smoothing/{ => wrapping}/test/Baseline/PythonMeanImageFilterFunctionCallTest.png.md5 (100%) rename Modules/Filtering/Smoothing/{ => wrapping}/test/Baseline/PythonMeanImageFilterFunctionCallTest.png.sha512 (100%) rename Modules/Filtering/Smoothing/{ => wrapping}/test/Baseline/PythonMeanImageFilterTest.png.md5 (100%) rename Modules/Filtering/Smoothing/{ => wrapping}/test/Baseline/PythonMeanImageFilterTest.png.sha512 (100%) rename Modules/Filtering/Smoothing/{ => wrapping}/test/Baseline/PythonMedianImageFilterTest.png.md5 (100%) rename Modules/Filtering/Smoothing/{ => wrapping}/test/Baseline/PythonMedianImageFilterTest.png.sha512 (100%) create mode 100644 Modules/Filtering/Smoothing/wrapping/test/CMakeLists.txt rename Modules/Filtering/Smoothing/{ => wrapping}/test/MeanImageFilterFunctionCallTest.py (100%) rename Modules/Filtering/Smoothing/{ => wrapping}/test/MeanImageFilterTest.py (100%) rename Modules/Filtering/Smoothing/{ => wrapping}/test/MedianImageFilterFunctionalDocumentationTest.py (100%) rename Modules/Filtering/Smoothing/{ => wrapping}/test/MedianImageFilterTest.py (100%) rename Modules/Filtering/Smoothing/{ => wrapping}/test/PythonAutoPipelineTest.py (100%) rename Modules/Filtering/Thresholding/{ => wrapping}/test/Baseline/PythonBinaryThresholdImageFilterTest.png.md5 (100%) rename Modules/Filtering/Thresholding/{ => wrapping}/test/Baseline/PythonBinaryThresholdImageFilterTest.png.sha512 (100%) rename Modules/Filtering/Thresholding/{ => wrapping}/test/Baseline/PythonThresholdImageFilterTest.png.md5 (100%) rename Modules/Filtering/Thresholding/{ => wrapping}/test/Baseline/PythonThresholdImageFilterTest.png.sha512 (100%) rename Modules/Filtering/Thresholding/{ => wrapping}/test/BinaryThresholdImageFilterTest.py (100%) create mode 100644 Modules/Filtering/Thresholding/wrapping/test/CMakeLists.txt rename Modules/Filtering/Thresholding/{ => wrapping}/test/ThresholdImageFilterTest.py (100%) create mode 100644 Modules/IO/GDCM/wrapping/test/CMakeLists.txt rename Modules/IO/GDCM/{ => wrapping}/test/ReadDicomAndReadTagTest.py (100%) create mode 100644 Modules/IO/MeshGifti/wrapping/test/CMakeLists.txt create mode 100644 Modules/IO/MeshOBJ/wrapping/test/CMakeLists.txt create mode 100644 Modules/IO/MeshOFF/wrapping/test/CMakeLists.txt create mode 100644 Modules/Nonunit/IntegratedTest/wrapping/test/CMakeLists.txt rename Modules/Nonunit/IntegratedTest/{ => wrapping}/test/itkCurvatureFlowTestPython2.py (100%) create mode 100644 Modules/Numerics/Statistics/wrapping/test/CMakeLists.txt create mode 100644 Modules/Registration/Metricsv4/wrapping/test/CMakeLists.txt create mode 100644 Modules/Segmentation/LevelSets/wrapping/test/CMakeLists.txt rename Modules/Segmentation/LevelSets/{ => wrapping}/test/GeodesicActiveContourImageFilterTest.py (100%) rename Modules/Segmentation/LevelSets/{ => wrapping}/test/LazyLoadingImageTest.py (100%) rename Modules/Segmentation/LevelSets/{ => wrapping}/test/PythonThresholdSegmentationLevelSetGrayMatterTest.png.md5 (100%) rename Modules/Segmentation/LevelSets/{ => wrapping}/test/PythonThresholdSegmentationLevelSetGrayMatterTest.png.sha512 (100%) rename Modules/Segmentation/LevelSets/{ => wrapping}/test/PythonThresholdSegmentationLevelSetVentricleTest.png.md5 (100%) rename Modules/Segmentation/LevelSets/{ => wrapping}/test/PythonThresholdSegmentationLevelSetVentricleTest.png.sha512 (100%) rename Modules/Segmentation/LevelSets/{ => wrapping}/test/PythonThresholdSegmentationLevelSetWhiteMatterTest.png.md5 (100%) rename Modules/Segmentation/LevelSets/{ => wrapping}/test/PythonThresholdSegmentationLevelSetWhiteMatterTest.png.sha512 (100%) rename Modules/Segmentation/LevelSets/{ => wrapping}/test/ThresholdSegmentationLevelSetImageFilterTest.py (100%) create mode 100644 Modules/Segmentation/SignedDistanceFunction/wrapping/test/CMakeLists.txt create mode 100644 Modules/Segmentation/Watersheds/wrapping/test/CMakeLists.txt rename Modules/Segmentation/Watersheds/{ => wrapping}/test/WatershedSegmentation1Test.py (100%) diff --git a/CMake/ITKModuleDoxygen.cmake b/CMake/ITKModuleDoxygen.cmake index f057897b092..67b315e8c56 100644 --- a/CMake/ITKModuleDoxygen.cmake +++ b/CMake/ITKModuleDoxygen.cmake @@ -43,7 +43,7 @@ macro( itk_module_doxygen _name ) endif() if(NOT ${_name}_THIRD_PARTY AND EXISTS ${${_name}_SOURCE_DIR}/include) - if(PYTHON_EXECUTABLE AND BUILD_TESTING) + if(PYTHON_EXECUTABLE AND BUILD_TESTING AND NOT DISABLE_MODULE_TESTS) itk_add_test(NAME ${_name}InDoxygenGroup COMMAND ${PYTHON_EXECUTABLE} "${ITK_CMAKE_DIR}/../Utilities/Doxygen/mcdoc.py" check ${_name} ${${_name}_SOURCE_DIR}/include) itk_memcheck_ignore(${_name}InDoxygenGroup) endif() diff --git a/CMake/ITKModuleEnablement.cmake b/CMake/ITKModuleEnablement.cmake index 19ac96e9f6c..75d38d95d26 100644 --- a/CMake/ITKModuleEnablement.cmake +++ b/CMake/ITKModuleEnablement.cmake @@ -12,7 +12,7 @@ foreach(f ${meta}) get_filename_component(${itk-module}_BASE ${f} PATH) set(${itk-module}_SOURCE_DIR ${ITK_SOURCE_DIR}/${${itk-module}_BASE}) set(${itk-module}_BINARY_DIR ${ITK_BINARY_DIR}/${${itk-module}_BASE}) - if(BUILD_TESTING AND EXISTS ${${itk-module}_SOURCE_DIR}/test) + if(BUILD_TESTING AND NOT DISABLE_MODULE_TESTS AND EXISTS ${${itk-module}_SOURCE_DIR}/test) list(APPEND ITK_MODULES_ALL ${itk-module-test}) set(${itk-module-test}_SOURCE_DIR ${${itk-module}_SOURCE_DIR}/test) set(${itk-module-test}_BINARY_DIR ${${itk-module}_BINARY_DIR}/test) diff --git a/CMake/ITKModuleKWStyleTest.cmake b/CMake/ITKModuleKWStyleTest.cmake index 5204b888c6d..228b40bfe59 100644 --- a/CMake/ITKModuleKWStyleTest.cmake +++ b/CMake/ITKModuleKWStyleTest.cmake @@ -58,14 +58,16 @@ macro(itk_module_kwstyle_test _name) if (NOT KWSTYLE_EXECUTABLE) message(WARNING "KWSTYLE_EXECUTABLE is not set!") else() - itk_add_test(NAME ${itk-module}KWStyleTest - COMMAND ${KWSTYLE_EXECUTABLE} - -xml ${_kwstyle_itk_configuration_file} - -v - -o ${_kwstyle_itk_overwrite_file} - -D ${_kwstyle_itk_module_files_list_file} - -gcc - WORKING_DIRECTORY ${ITK_CMAKE_DIR}/.. - ) + if(NOT DISABLE_MODULE_TESTS) + itk_add_test(NAME ${itk-module}KWStyleTest + COMMAND ${KWSTYLE_EXECUTABLE} + -xml ${_kwstyle_itk_configuration_file} + -v + -o ${_kwstyle_itk_overwrite_file} + -D ${_kwstyle_itk_module_files_list_file} + -gcc + WORKING_DIRECTORY ${ITK_CMAKE_DIR}/.. + ) + endif() endif() endmacro() diff --git a/CMake/ITKModuleTest.cmake b/CMake/ITKModuleTest.cmake index 1438961f108..813096d0a0f 100644 --- a/CMake/ITKModuleTest.cmake +++ b/CMake/ITKModuleTest.cmake @@ -12,10 +12,9 @@ # ADDITIONAL_SRC (optional) - additional source files, which don't contain tests macro(CreateTestDriver KIT KIT_LIBS KitTests) - if(NOT ITK_DISABLE_ALL_TESTS_BUT_OVERRIDEN) - set(ADDITIONAL_SRC ${ARGN}) - if(EMSCRIPTEN) - set(emscripten_before " + set(ADDITIONAL_SRC ${ARGN}) + if(EMSCRIPTEN) + set(emscripten_before " EM_ASM( var cmake_source_dir = '${CMAKE_SOURCE_DIR}'.split('/'); // This is intentionally global so it can be unmounted at the end. @@ -44,7 +43,7 @@ EM_ASM( } ); ") - set(emscripten_after " + set(emscripten_after " EM_ASM( FS.unmount(source_mount_dir); if(source_mount_dir != binary_mount_dir) { @@ -52,26 +51,24 @@ EM_ASM( } ); ") - endif() - set(CMAKE_TESTDRIVER_BEFORE_TESTMAIN "${emscripten_before}#include \"itkTestDriverBeforeTest.inc\"") - set(CMAKE_TESTDRIVER_AFTER_TESTMAIN "#include \"itkTestDriverAfterTest.inc\"${emscripten_after}") - create_test_sourcelist(Tests ${KIT}TestDriver.cxx - ${KitTests} - EXTRA_INCLUDE itkTestDriverIncludeRequiredIOFactories.h - FUNCTION ProcessArgumentsAndRegisterRequiredFactories - ) - add_executable(${KIT}TestDriver ${KIT}TestDriver.cxx ${Tests} ${ADDITIONAL_SRC}) - target_link_libraries(${KIT}TestDriver LINK_PUBLIC ${KIT_LIBS} ${ITKTestKernel_LIBRARIES}) - itk_module_target_label(${KIT}TestDriver) endif() + set(CMAKE_TESTDRIVER_BEFORE_TESTMAIN "${emscripten_before}#include \"itkTestDriverBeforeTest.inc\"") + set(CMAKE_TESTDRIVER_AFTER_TESTMAIN "#include \"itkTestDriverAfterTest.inc\"${emscripten_after}") + create_test_sourcelist(Tests ${KIT}TestDriver.cxx + ${KitTests} + EXTRA_INCLUDE itkTestDriverIncludeRequiredIOFactories.h + FUNCTION ProcessArgumentsAndRegisterRequiredFactories + ) + add_executable(${KIT}TestDriver ${KIT}TestDriver.cxx ${Tests} ${ADDITIONAL_SRC}) + target_link_libraries(${KIT}TestDriver LINK_PUBLIC ${KIT_LIBS} ${ITKTestKernel_LIBRARIES}) + itk_module_target_label(${KIT}TestDriver) endmacro() macro(CreateTestDriver_SupportBuildInIOFactories KIT KIT_LIBS KitTests) - if(NOT ITK_DISABLE_ALL_TESTS_BUT_OVERRIDEN) - set(ADDITIONAL_SRC ${ARGN} ) - if(EMSCRIPTEN) - set(emscripten_before " + set(ADDITIONAL_SRC ${ARGN} ) + if(EMSCRIPTEN) + set(emscripten_before " EM_ASM( var cmake_source_dir = '${CMAKE_SOURCE_DIR}'.split('/'); // This is intentionally global so it can be unmounted at the end. @@ -100,7 +97,7 @@ EM_ASM( } ); ") - set(emscripten_after " + set(emscripten_after " EM_ASM( FS.unmount(source_mount_dir); if(source_mount_dir != binary_mount_dir) { @@ -108,38 +105,26 @@ EM_ASM( } ); ") - endif() - set(CMAKE_TESTDRIVER_BEFORE_TESTMAIN "${emscripten_before}#include \"itkTestDriverBeforeTest.inc\"") - set(CMAKE_TESTDRIVER_AFTER_TESTMAIN "#include \"itkTestDriverAfterTest.inc\"${emscripten_after}") - create_test_sourcelist(Tests ${KIT}TestDriver.cxx - ${KitTests} - EXTRA_INCLUDE itkTestDriverIncludeBuiltInIOFactories.h - FUNCTION ProcessArgumentsAndRegisterBuiltInFactories - ) - add_executable(${KIT}TestDriver ${KIT}TestDriver.cxx ${Tests} ${ADDITIONAL_SRC}) - target_link_libraries(${KIT}TestDriver LINK_PUBLIC ${KIT_LIBS} ${ITKTestKernel_LIBRARIES}) - itk_module_target_label(${KIT}TestDriver) endif() + set(CMAKE_TESTDRIVER_BEFORE_TESTMAIN "${emscripten_before}#include \"itkTestDriverBeforeTest.inc\"") + set(CMAKE_TESTDRIVER_AFTER_TESTMAIN "#include \"itkTestDriverAfterTest.inc\"${emscripten_after}") + create_test_sourcelist(Tests ${KIT}TestDriver.cxx + ${KitTests} + EXTRA_INCLUDE itkTestDriverIncludeBuiltInIOFactories.h + FUNCTION ProcessArgumentsAndRegisterBuiltInFactories + ) + add_executable(${KIT}TestDriver ${KIT}TestDriver.cxx ${Tests} ${ADDITIONAL_SRC}) + target_link_libraries(${KIT}TestDriver LINK_PUBLIC ${KIT_LIBS} ${ITKTestKernel_LIBRARIES}) + itk_module_target_label(${KIT}TestDriver) endmacro() #----------------------------------------------------------------------------- # ITK wrapper for add_test that automatically sets the test's LABELS property # to the value of its containing module. -# OVERRIDE_DISABLE option allows to force the test to be run even if -# ITK_DISABLE_ALL_TESTS_BUT_OVERRIDEN is ON. +# function(itk_add_test) - - set(options OVERRIDE_DISABLE) - set(oneValueArgs ) - set(multiValueArgs ) - cmake_parse_arguments(ITK_ADD_TEST "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) - - if(ITK_DISABLE_ALL_TESTS_BUT_OVERRIDEN AND NOT OVERRIDE_DISABLE) - return() - endif() - # Add tests with data in the ITKData group. - ExternalData_add_test(ITKData ${ITK_ADD_TEST_UNPARSED_ARGUMENTS}) + ExternalData_add_test(ITKData ${ARGN}) if("NAME" STREQUAL "${ARGV0}") set(_iat_testname ${ARGV1}) @@ -149,7 +134,7 @@ function(itk_add_test) if(itk-module) set(_label ${itk-module}) - if(TARGET ${itk-module}-all AND "${ITK_ADD_TEST_UNPARSED_ARGUMENTS}" MATCHES "DATA{") + if(TARGET ${itk-module}-all AND "${ARGN}" MATCHES "DATA{") add_dependencies(${itk-module}-all ITKData) endif() else() @@ -179,7 +164,7 @@ endfunction() function(itk_python_add_test) # No-op if wrapping is not available if(NOT ITK_WRAP_PYTHON) - return() + message(FATAL_ERROR "`itk_python_add_test` should never be called if `ITK_WRAP_PYTHON` if OFF") endif() set(options ) @@ -214,9 +199,8 @@ function(itk_python_add_test) ${command} ${PYTHON_ADD_TEST_COMMAND} WORKING_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}" - OVERRIDE_DISABLE ) - set_property(TEST ${name} APPEND PROPERTY LABELS Python) + set_property(TEST ${PYTHON_ADD_TEST_NAME} APPEND PROPERTY LABELS Python) endfunction() #----------------------------------------------------------------------------- @@ -237,7 +221,7 @@ endfunction() function(itk_python_expression_add_test) # No-op if wrapping is not available if(NOT ITK_WRAP_PYTHON) - return() + message(FATAL_ERROR "`itk_python_add_test` should never be called if `ITK_WRAP_PYTHON` if OFF") endif() set(options ) diff --git a/CMakeLists.txt b/CMakeLists.txt index 342ea772d57..b1dfbaf6fea 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -418,10 +418,11 @@ option(ITK_USE_FLOAT_SPACE_PRECISION "Use single precision for origin/spacing/di mark_as_advanced(ITK_USE_FLOAT_SPACE_PRECISION) # This flag allows to not build itkTestDrivers while still configuring all the tests and disable all -# tests that do not explicitely override this function (such as the Python tests). +# tests that are implemented in the `test` folder in each ITK module. It does not disable tests +# that are implemented in the wrapping folder. # This is used by dashboards to speed up compilation and testing on certain platforms. -option(ITK_DISABLE_ALL_TESTS_BUT_OVERRIDEN "Disable all tests except the ones that override this option" OFF) -mark_as_advanced(ITK_DISABLE_ALL_TESTS_BUT_OVERRIDEN) +option(DISABLE_MODULE_TESTS "Disable all ITK module tests in `test` folder" OFF) +mark_as_advanced(DISABLE_MODULE_TESTS) #---------------------------------------------------------------------- # Make sure remote modules are downloaded before sorting out the module diff --git a/Modules/Bridge/NumPy/test/CMakeLists.txt b/Modules/Bridge/NumPy/wrapping/test/CMakeLists.txt similarity index 97% rename from Modules/Bridge/NumPy/test/CMakeLists.txt rename to Modules/Bridge/NumPy/wrapping/test/CMakeLists.txt index bb5f5020e62..eced4d2141d 100644 --- a/Modules/Bridge/NumPy/test/CMakeLists.txt +++ b/Modules/Bridge/NumPy/wrapping/test/CMakeLists.txt @@ -1,5 +1,3 @@ -itk_module_test() - if(ITK_WRAP_PYTHON) execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import numpy" RESULT_VARIABLE _have_numpy_return_code diff --git a/Modules/Bridge/NumPy/test/itkPyBufferMemoryLeakTest.py b/Modules/Bridge/NumPy/wrapping/test/itkPyBufferMemoryLeakTest.py similarity index 100% rename from Modules/Bridge/NumPy/test/itkPyBufferMemoryLeakTest.py rename to Modules/Bridge/NumPy/wrapping/test/itkPyBufferMemoryLeakTest.py diff --git a/Modules/Bridge/NumPy/test/itkPyBufferPipelineTest.py b/Modules/Bridge/NumPy/wrapping/test/itkPyBufferPipelineTest.py similarity index 100% rename from Modules/Bridge/NumPy/test/itkPyBufferPipelineTest.py rename to Modules/Bridge/NumPy/wrapping/test/itkPyBufferPipelineTest.py diff --git a/Modules/Bridge/NumPy/test/itkPyBufferTest.py b/Modules/Bridge/NumPy/wrapping/test/itkPyBufferTest.py similarity index 100% rename from Modules/Bridge/NumPy/test/itkPyBufferTest.py rename to Modules/Bridge/NumPy/wrapping/test/itkPyBufferTest.py diff --git a/Modules/Bridge/NumPy/test/itkPyVnlTest.py b/Modules/Bridge/NumPy/wrapping/test/itkPyVnlTest.py similarity index 100% rename from Modules/Bridge/NumPy/test/itkPyVnlTest.py rename to Modules/Bridge/NumPy/wrapping/test/itkPyVnlTest.py diff --git a/Modules/Core/Common/test/CMakeLists.txt b/Modules/Core/Common/test/CMakeLists.txt index b98309fbe1a..029fefdb62e 100644 --- a/Modules/Core/Common/test/CMakeLists.txt +++ b/Modules/Core/Common/test/CMakeLists.txt @@ -615,15 +615,6 @@ if(ITK_BUILD_SHARED_LIBS AND ITK_DYNAMIC_LOADING) $) endif() -# This test doesn't compile. It exercises the bug I ran into if you multiply 2 vector images; if you -# try to compile it the compile fails. -# itk_add_test(NAME itkVectorMultiplyTest COMMAND ITKCommon2TestDriver itkVectorMultiplyTest) - -itk_python_add_test(NAME itkMetaDataDictionaryPythonTest COMMAND itkMetaDataDictionaryTest.py) -itk_python_add_test(NAME itkDirectoryPythonTest COMMAND itkDirectoryTest.py) -itk_python_expression_add_test(NAME itkObjectPythonTest EXPRESSION "itkObject = itk.Object.New()") -itk_python_add_test(NAME itkIndexOffsetPythonTest COMMAND itkIndexOffsetTest.py) - set(ITKCommonGTests itkAggregateTypesGTest.cxx itkBuildInformationGTest.cxx diff --git a/Modules/Core/Common/wrapping/test/CMakeLists.txt b/Modules/Core/Common/wrapping/test/CMakeLists.txt new file mode 100644 index 00000000000..a61ca59f411 --- /dev/null +++ b/Modules/Core/Common/wrapping/test/CMakeLists.txt @@ -0,0 +1,8 @@ +# This test doesn't compile. It exercises the bug I ran into if you multiply 2 vector images; if you +# try to compile it the compile fails. +# itk_add_test(NAME itkVectorMultiplyTest COMMAND ITKCommon2TestDriver itkVectorMultiplyTest) + +itk_python_add_test(NAME itkMetaDataDictionaryPythonTest COMMAND itkMetaDataDictionaryTest.py) +itk_python_add_test(NAME itkDirectoryPythonTest COMMAND itkDirectoryTest.py) +itk_python_expression_add_test(NAME itkObjectPythonTest EXPRESSION "itkObject = itk.Object.New()") +itk_python_add_test(NAME itkIndexOffsetPythonTest COMMAND itkIndexOffsetTest.py) diff --git a/Modules/Core/Common/test/itkDirectoryTest.py b/Modules/Core/Common/wrapping/test/itkDirectoryTest.py similarity index 100% rename from Modules/Core/Common/test/itkDirectoryTest.py rename to Modules/Core/Common/wrapping/test/itkDirectoryTest.py diff --git a/Modules/Core/Common/test/itkIndexOffsetTest.py b/Modules/Core/Common/wrapping/test/itkIndexOffsetTest.py similarity index 100% rename from Modules/Core/Common/test/itkIndexOffsetTest.py rename to Modules/Core/Common/wrapping/test/itkIndexOffsetTest.py diff --git a/Modules/Core/Common/test/itkMetaDataDictionaryTest.py b/Modules/Core/Common/wrapping/test/itkMetaDataDictionaryTest.py similarity index 100% rename from Modules/Core/Common/test/itkMetaDataDictionaryTest.py rename to Modules/Core/Common/wrapping/test/itkMetaDataDictionaryTest.py diff --git a/Modules/Core/ImageFunction/test/CMakeLists.txt b/Modules/Core/ImageFunction/test/CMakeLists.txt index 3f209328970..af72c37d305 100644 --- a/Modules/Core/ImageFunction/test/CMakeLists.txt +++ b/Modules/Core/ImageFunction/test/CMakeLists.txt @@ -92,6 +92,3 @@ itk_add_test(NAME itkLabelImageGaussianInterpolateImageFunctionTest itk_add_test(NAME itkVectorLinearInterpolateNearestNeighborExtrapolateImageFunctionTest COMMAND ITKImageFunctionTestDriver itkVectorLinearInterpolateNearestNeighborExtrapolateImageFunctionTest) - -itk_python_expression_add_test(NAME itkExtrapolateImageFunctionPythonTest - EXPRESSION "extrapolate = itk.ExtrapolateImageFunction.New()") diff --git a/Modules/Core/ImageFunction/wrapping/test/CMakeLists.txt b/Modules/Core/ImageFunction/wrapping/test/CMakeLists.txt new file mode 100644 index 00000000000..31f6a594a20 --- /dev/null +++ b/Modules/Core/ImageFunction/wrapping/test/CMakeLists.txt @@ -0,0 +1,2 @@ +itk_python_expression_add_test(NAME itkExtrapolateImageFunctionPythonTest + EXPRESSION "extrapolate = itk.ExtrapolateImageFunction.New()") diff --git a/Modules/Core/Mesh/test/CMakeLists.txt b/Modules/Core/Mesh/test/CMakeLists.txt index 98acb9d49a1..17cde5efc81 100644 --- a/Modules/Core/Mesh/test/CMakeLists.txt +++ b/Modules/Core/Mesh/test/CMakeLists.txt @@ -203,26 +203,3 @@ set_tests_properties(itkVTKPolyDataReaderTest2 itkVTKPolyDataReaderBadTest16 itkVTKPolyDataReaderBadTest17 PROPERTIES WILL_FAIL true) - -list(FIND ITK_WRAP_IMAGE_DIMS 3 wrap_3_index) -if(wrap_3_index GREATER -1) - itk_python_expression_add_test(NAME itkTriangleMeshToBinaryImageFilterPythonTest - EXPRESSION "instance = itk.TriangleMeshToBinaryImageFilter.New()") -endif() - - itk_python_expression_add_test(NAME itkBYUMeshIOPythonTest - EXPRESSION "instance = itk.BYUMeshIO.New()") - itk_python_expression_add_test(NAME itkFreeSurferAsciiMeshIOPythonTest - EXPRESSION "instance = itk.FreeSurferAsciiMeshIO.New()") - itk_python_expression_add_test(NAME itkFreeSurferBinaryMeshIOPythonTest - EXPRESSION "instance = itk.FreeSurferBinaryMeshIO.New()") - itk_python_expression_add_test(NAME itkMeshFileReaderPythonTest - EXPRESSION "instance = itk.MeshFileReader.New()") - itk_python_expression_add_test(NAME itkMeshFileWriterPythonTest - EXPRESSION "instance = itk.MeshFileWriter.New()") - itk_python_expression_add_test(NAME itkOBJMeshIOPythonTest - EXPRESSION "instance = itk.OBJMeshIO.New()") - itk_python_expression_add_test(NAME itkOFFMeshIOPythonTest - EXPRESSION "instance = itk.OFFMeshIO.New()") - itk_python_expression_add_test(NAME itkVTKPolyDataMeshIOPythonTest - EXPRESSION "instance = itk.VTKPolyDataMeshIO.New()") diff --git a/Modules/Core/Mesh/wrapping/test/CMakeLists.txt b/Modules/Core/Mesh/wrapping/test/CMakeLists.txt new file mode 100644 index 00000000000..afd860e0442 --- /dev/null +++ b/Modules/Core/Mesh/wrapping/test/CMakeLists.txt @@ -0,0 +1,22 @@ +list(FIND ITK_WRAP_IMAGE_DIMS 3 wrap_3_index) +if(wrap_3_index GREATER -1) + itk_python_expression_add_test(NAME itkTriangleMeshToBinaryImageFilterPythonTest + EXPRESSION "instance = itk.TriangleMeshToBinaryImageFilter.New()") +endif() + + itk_python_expression_add_test(NAME itkBYUMeshIOPythonTest + EXPRESSION "instance = itk.BYUMeshIO.New()") + itk_python_expression_add_test(NAME itkFreeSurferAsciiMeshIOPythonTest + EXPRESSION "instance = itk.FreeSurferAsciiMeshIO.New()") + itk_python_expression_add_test(NAME itkFreeSurferBinaryMeshIOPythonTest + EXPRESSION "instance = itk.FreeSurferBinaryMeshIO.New()") + itk_python_expression_add_test(NAME itkMeshFileReaderPythonTest + EXPRESSION "instance = itk.MeshFileReader.New()") + itk_python_expression_add_test(NAME itkMeshFileWriterPythonTest + EXPRESSION "instance = itk.MeshFileWriter.New()") + itk_python_expression_add_test(NAME itkOBJMeshIOPythonTest + EXPRESSION "instance = itk.OBJMeshIO.New()") + itk_python_expression_add_test(NAME itkOFFMeshIOPythonTest + EXPRESSION "instance = itk.OFFMeshIO.New()") + itk_python_expression_add_test(NAME itkVTKPolyDataMeshIOPythonTest + EXPRESSION "instance = itk.VTKPolyDataMeshIO.New()") diff --git a/Modules/Core/SpatialObjects/test/CMakeLists.txt b/Modules/Core/SpatialObjects/test/CMakeLists.txt index 06e079f7d10..82129444e48 100644 --- a/Modules/Core/SpatialObjects/test/CMakeLists.txt +++ b/Modules/Core/SpatialObjects/test/CMakeLists.txt @@ -86,14 +86,6 @@ itk_add_test(NAME itkNewMetaObjectTypeTest COMMAND ITKSpatialObjectsTestDriver itkNewMetaObjectTypeTest ${ITK_TEST_OUTPUT_DIR}/NewMetaObjectType.meta) -list(FIND ITK_WRAP_IMAGE_DIMS 2 wrap_2_index) -if(ITK_WRAP_float AND wrap_2_index GREATER -1) - itk_python_add_test(NAME PythonSpatialObjectTest - TEST_DRIVER_ARGS - COMMAND SpatialObjectTest.py - ) -endif() - set(ITKSpatialObjectsGTests itkImageMaskSpatialObjectGTest.cxx ) diff --git a/Modules/Core/SpatialObjects/wrapping/test/CMakeLists.txt b/Modules/Core/SpatialObjects/wrapping/test/CMakeLists.txt new file mode 100644 index 00000000000..a3d9bd032f5 --- /dev/null +++ b/Modules/Core/SpatialObjects/wrapping/test/CMakeLists.txt @@ -0,0 +1,7 @@ +list(FIND ITK_WRAP_IMAGE_DIMS 2 wrap_2_index) +if(ITK_WRAP_float AND wrap_2_index GREATER -1) + itk_python_add_test(NAME PythonSpatialObjectTest + TEST_DRIVER_ARGS + COMMAND SpatialObjectTest.py + ) +endif() diff --git a/Modules/Core/SpatialObjects/test/SpatialObjectTest.py b/Modules/Core/SpatialObjects/wrapping/test/SpatialObjectTest.py similarity index 100% rename from Modules/Core/SpatialObjects/test/SpatialObjectTest.py rename to Modules/Core/SpatialObjects/wrapping/test/SpatialObjectTest.py diff --git a/Modules/Filtering/AnisotropicSmoothing/test/CMakeLists.txt b/Modules/Filtering/AnisotropicSmoothing/test/CMakeLists.txt index 8171619b455..48e8a29e1ac 100644 --- a/Modules/Filtering/AnisotropicSmoothing/test/CMakeLists.txt +++ b/Modules/Filtering/AnisotropicSmoothing/test/CMakeLists.txt @@ -22,28 +22,3 @@ itk_add_test(NAME itkGradientAnisotropicDiffusionImageFilterTest2 --compare DATA{${ITK_DATA_ROOT}/Baseline/BasicFilters/GradientAnisotropicDiffusionImageFilterTest2.png} ${ITK_TEST_OUTPUT_DIR}/GradientAnisotropicDiffusionImageFilterTest2.png itkGradientAnisotropicDiffusionImageFilterTest2 DATA{${ITK_DATA_ROOT}/Input/cake_easy.png} ${ITK_TEST_OUTPUT_DIR}/GradientAnisotropicDiffusionImageFilterTest2.png) - -list(FIND ITK_WRAP_IMAGE_DIMS 2 wrap_2_index) -if(ITK_WRAP_float AND wrap_2_index GREATER -1) - itk_python_add_test(NAME PythonCurvatureAnisotropicDiffusionImageFilterTest - COMMAND CurvatureAnisotropicDiffusionImageFilterTest.py - DATA{${ITK_DATA_ROOT}/Input/cthead1.png} - ${ITK_TEST_OUTPUT_DIR}/CurvatureAnisotropicDiffusionImageFilterTest.png - 5 0.125 3 - ) - itk_python_add_test(NAME PythonSmoothingRecursiveGaussianImageFilterTest - COMMAND SmoothingRecursiveGaussianImageFilterTest.py - DATA{${ITK_DATA_ROOT}/Input/cthead1.png} - ${ITK_TEST_OUTPUT_DIR}/SmoothingRecursiveGaussianImageFilterTest.png - 3 - ) - itk_python_add_test(NAME PythonGradientAnisotropicDiffusionImageFilterTest - TEST_DRIVER_ARGS - --compare ${ITK_TEST_OUTPUT_DIR}/PythonGradientAnisotropicDiffusionImageFilterTest.png - DATA{Baseline/PythonGradientAnisotropicDiffusionImageFilterTest.png} - COMMAND GradientAnisotropicDiffusionImageFilterTest.py - DATA{Input/BrainProtonDensitySlice.png} - ${ITK_TEST_OUTPUT_DIR}/PythonGradientAnisotropicDiffusionImageFilterTest.png - 5 0.125 1.0 - ) -endif() diff --git a/Modules/Filtering/AnisotropicSmoothing/test/Baseline/PythonGradientAnisotropicDiffusionImageFilterTest.png.md5 b/Modules/Filtering/AnisotropicSmoothing/wrapping/test/Baseline/PythonGradientAnisotropicDiffusionImageFilterTest.png.md5 similarity index 100% rename from Modules/Filtering/AnisotropicSmoothing/test/Baseline/PythonGradientAnisotropicDiffusionImageFilterTest.png.md5 rename to Modules/Filtering/AnisotropicSmoothing/wrapping/test/Baseline/PythonGradientAnisotropicDiffusionImageFilterTest.png.md5 diff --git a/Modules/Filtering/AnisotropicSmoothing/test/Baseline/PythonGradientAnisotropicDiffusionImageFilterTest.png.sha512 b/Modules/Filtering/AnisotropicSmoothing/wrapping/test/Baseline/PythonGradientAnisotropicDiffusionImageFilterTest.png.sha512 similarity index 100% rename from Modules/Filtering/AnisotropicSmoothing/test/Baseline/PythonGradientAnisotropicDiffusionImageFilterTest.png.sha512 rename to Modules/Filtering/AnisotropicSmoothing/wrapping/test/Baseline/PythonGradientAnisotropicDiffusionImageFilterTest.png.sha512 diff --git a/Modules/Filtering/AnisotropicSmoothing/wrapping/test/CMakeLists.txt b/Modules/Filtering/AnisotropicSmoothing/wrapping/test/CMakeLists.txt new file mode 100644 index 00000000000..64b775974a1 --- /dev/null +++ b/Modules/Filtering/AnisotropicSmoothing/wrapping/test/CMakeLists.txt @@ -0,0 +1,26 @@ +set(test_input_dir ${itk-module_SOURCE_DIR}/test/Input) + +list(FIND ITK_WRAP_IMAGE_DIMS 2 wrap_2_index) +if(ITK_WRAP_float AND wrap_2_index GREATER -1) + itk_python_add_test(NAME PythonCurvatureAnisotropicDiffusionImageFilterTest + COMMAND CurvatureAnisotropicDiffusionImageFilterTest.py + DATA{${ITK_DATA_ROOT}/Input/cthead1.png} + ${ITK_TEST_OUTPUT_DIR}/CurvatureAnisotropicDiffusionImageFilterTest.png + 5 0.125 3 + ) + itk_python_add_test(NAME PythonSmoothingRecursiveGaussianImageFilterTest + COMMAND SmoothingRecursiveGaussianImageFilterTest.py + DATA{${ITK_DATA_ROOT}/Input/cthead1.png} + ${ITK_TEST_OUTPUT_DIR}/SmoothingRecursiveGaussianImageFilterTest.png + 3 + ) + itk_python_add_test(NAME PythonGradientAnisotropicDiffusionImageFilterTest + TEST_DRIVER_ARGS + --compare ${ITK_TEST_OUTPUT_DIR}/PythonGradientAnisotropicDiffusionImageFilterTest.png + DATA{Baseline/PythonGradientAnisotropicDiffusionImageFilterTest.png} + COMMAND GradientAnisotropicDiffusionImageFilterTest.py + DATA{${test_input_dir}/BrainProtonDensitySlice.png} + ${ITK_TEST_OUTPUT_DIR}/PythonGradientAnisotropicDiffusionImageFilterTest.png + 5 0.125 1.0 + ) +endif() diff --git a/Modules/Filtering/AnisotropicSmoothing/test/CurvatureAnisotropicDiffusionImageFilterTest.py b/Modules/Filtering/AnisotropicSmoothing/wrapping/test/CurvatureAnisotropicDiffusionImageFilterTest.py similarity index 100% rename from Modules/Filtering/AnisotropicSmoothing/test/CurvatureAnisotropicDiffusionImageFilterTest.py rename to Modules/Filtering/AnisotropicSmoothing/wrapping/test/CurvatureAnisotropicDiffusionImageFilterTest.py diff --git a/Modules/Filtering/AnisotropicSmoothing/test/GradientAnisotropicDiffusionImageFilterTest.py b/Modules/Filtering/AnisotropicSmoothing/wrapping/test/GradientAnisotropicDiffusionImageFilterTest.py similarity index 100% rename from Modules/Filtering/AnisotropicSmoothing/test/GradientAnisotropicDiffusionImageFilterTest.py rename to Modules/Filtering/AnisotropicSmoothing/wrapping/test/GradientAnisotropicDiffusionImageFilterTest.py diff --git a/Modules/Filtering/AnisotropicSmoothing/test/SmoothingRecursiveGaussianImageFilterTest.py b/Modules/Filtering/AnisotropicSmoothing/wrapping/test/SmoothingRecursiveGaussianImageFilterTest.py similarity index 100% rename from Modules/Filtering/AnisotropicSmoothing/test/SmoothingRecursiveGaussianImageFilterTest.py rename to Modules/Filtering/AnisotropicSmoothing/wrapping/test/SmoothingRecursiveGaussianImageFilterTest.py diff --git a/Modules/Filtering/AntiAlias/test/CMakeLists.txt b/Modules/Filtering/AntiAlias/test/CMakeLists.txt index 0980970a978..828743ae317 100644 --- a/Modules/Filtering/AntiAlias/test/CMakeLists.txt +++ b/Modules/Filtering/AntiAlias/test/CMakeLists.txt @@ -12,16 +12,3 @@ itk_add_test(NAME itkAntiAliasBinaryImageFilterTest itkAntiAliasBinaryImageFilterTest ${ITK_TEST_OUTPUT_DIR}/itkAntiAliasBinaryImageFilterTest.mha ) - -list(FIND ITK_WRAP_IMAGE_DIMS 3 wrap_3_index) -if(ITK_WRAP_float AND wrap_3_index GREATER -1) - itk_python_add_test(NAME PythonAntiAliasBinaryImageFilterTest - TEST_DRIVER_ARGS - --compare ${ITK_TEST_OUTPUT_DIR}/PythonAntiAliasBinaryImageFilterTest.png - DATA{Baseline/PythonAntiAliasBinaryImageFilterTest.png} - COMMAND AntiAliasBinaryImageFilterTest.py - DATA{Input/VentricleModel.png} - ${ITK_TEST_OUTPUT_DIR}/PythonAntiAliasBinaryImageFilterTest.png - .001 50 - ) -endif() diff --git a/Modules/Filtering/AntiAlias/test/AntiAliasBinaryImageFilterTest.py b/Modules/Filtering/AntiAlias/wrapping/test/AntiAliasBinaryImageFilterTest.py similarity index 100% rename from Modules/Filtering/AntiAlias/test/AntiAliasBinaryImageFilterTest.py rename to Modules/Filtering/AntiAlias/wrapping/test/AntiAliasBinaryImageFilterTest.py diff --git a/Modules/Filtering/AntiAlias/test/Baseline/PythonAntiAliasBinaryImageFilterTest.png.md5 b/Modules/Filtering/AntiAlias/wrapping/test/Baseline/PythonAntiAliasBinaryImageFilterTest.png.md5 similarity index 100% rename from Modules/Filtering/AntiAlias/test/Baseline/PythonAntiAliasBinaryImageFilterTest.png.md5 rename to Modules/Filtering/AntiAlias/wrapping/test/Baseline/PythonAntiAliasBinaryImageFilterTest.png.md5 diff --git a/Modules/Filtering/AntiAlias/test/Baseline/PythonAntiAliasBinaryImageFilterTest.png.sha512 b/Modules/Filtering/AntiAlias/wrapping/test/Baseline/PythonAntiAliasBinaryImageFilterTest.png.sha512 similarity index 100% rename from Modules/Filtering/AntiAlias/test/Baseline/PythonAntiAliasBinaryImageFilterTest.png.sha512 rename to Modules/Filtering/AntiAlias/wrapping/test/Baseline/PythonAntiAliasBinaryImageFilterTest.png.sha512 diff --git a/Modules/Filtering/AntiAlias/wrapping/test/CMakeLists.txt b/Modules/Filtering/AntiAlias/wrapping/test/CMakeLists.txt new file mode 100644 index 00000000000..81f60a1f30a --- /dev/null +++ b/Modules/Filtering/AntiAlias/wrapping/test/CMakeLists.txt @@ -0,0 +1,13 @@ +# Test disabled because input to generate baseline is not known or parameters +# have changed. + +#list(FIND ITK_WRAP_IMAGE_DIMS 2 wrap_2_index) +#if(ITK_WRAP_float AND wrap_2_index GREATER -1) +# itk_python_add_test(NAME PythonAntiAliasBinaryImageFilterTest +# TEST_DRIVER_ARGS +# --compare ${ITK_TEST_OUTPUT_DIR}/PythonAntiAliasBinaryImageFilter.png DATA{Baseline/PythonAntiAliasBinaryImageFilterTest.png} +# COMMAND AntiAliasBinaryImageFilterTest.py +# DATA{Input/VentricleModel.png} +# ${ITK_TEST_OUTPUT_DIR}/PythonAntiAliasBinaryImageFilter.png +# ) +#endif() diff --git a/Modules/Filtering/AntiAlias/test/Input/VentricleModel.png.md5 b/Modules/Filtering/AntiAlias/wrapping/test/Input/VentricleModel.png.md5 similarity index 100% rename from Modules/Filtering/AntiAlias/test/Input/VentricleModel.png.md5 rename to Modules/Filtering/AntiAlias/wrapping/test/Input/VentricleModel.png.md5 diff --git a/Modules/Filtering/AntiAlias/test/Input/VentricleModel.png.sha512 b/Modules/Filtering/AntiAlias/wrapping/test/Input/VentricleModel.png.sha512 similarity index 100% rename from Modules/Filtering/AntiAlias/test/Input/VentricleModel.png.sha512 rename to Modules/Filtering/AntiAlias/wrapping/test/Input/VentricleModel.png.sha512 diff --git a/Modules/Filtering/BinaryMathematicalMorphology/test/CMakeLists.txt b/Modules/Filtering/BinaryMathematicalMorphology/test/CMakeLists.txt index a4d0263cc2b..da653211ad9 100644 --- a/Modules/Filtering/BinaryMathematicalMorphology/test/CMakeLists.txt +++ b/Modules/Filtering/BinaryMathematicalMorphology/test/CMakeLists.txt @@ -133,25 +133,3 @@ itk_add_test(NAME itkBinaryThinningImageFilterTest --compare DATA{${ITK_DATA_ROOT}/Baseline/Algorithms/BinaryThinningImageFilterTest.png} ${ITK_TEST_OUTPUT_DIR}/BinaryThinningImageFilterTest.png itkBinaryThinningImageFilterTest DATA{${ITK_DATA_ROOT}/Input/Shapes.png} ${ITK_TEST_OUTPUT_DIR}/BinaryThinningImageFilterTest.png) - -# some tests will fail if dim=2 and unsigned short are not wrapped -list(FIND ITK_WRAP_IMAGE_DIMS 2 wrap_2_index) -if(ITK_WRAP_unsigned_char AND wrap_2_index GREATER -1) - itk_python_add_test(NAME PythonBinaryDilateImageFilterTest - TEST_DRIVER_ARGS - --compare ${ITK_TEST_OUTPUT_DIR}/PythonBinaryDilateImageFilterTest.png DATA{Baseline/PythonBinaryDilateImageFilterTest.png} - COMMAND BinaryDilateImageFilterTest.py - DATA{${ITK_DATA_ROOT}/Input/2th_cthead1.png} - ${ITK_TEST_OUTPUT_DIR}/PythonBinaryDilateImageFilterTest.png - 5 - ) - itk_python_add_test(NAME PythonBinaryErodeImageFilterTest - TEST_DRIVER_ARGS - --compare ${ITK_TEST_OUTPUT_DIR}/PythonBinaryErodeImageFilterTest.png - DATA{Baseline/PythonBinaryErodeImageFilterTest.png} - COMMAND BinaryErodeImageFilterTest.py - DATA{${ITK_DATA_ROOT}/Input/2th_cthead1.png} - ${ITK_TEST_OUTPUT_DIR}/PythonBinaryErodeImageFilterTest.png - 5 - ) -endif() diff --git a/Modules/Filtering/BinaryMathematicalMorphology/test/Baseline/PythonBinaryDilateImageFilterTest.png.md5 b/Modules/Filtering/BinaryMathematicalMorphology/wrapping/test/Baseline/PythonBinaryDilateImageFilterTest.png.md5 similarity index 100% rename from Modules/Filtering/BinaryMathematicalMorphology/test/Baseline/PythonBinaryDilateImageFilterTest.png.md5 rename to Modules/Filtering/BinaryMathematicalMorphology/wrapping/test/Baseline/PythonBinaryDilateImageFilterTest.png.md5 diff --git a/Modules/Filtering/BinaryMathematicalMorphology/test/Baseline/PythonBinaryDilateImageFilterTest.png.sha512 b/Modules/Filtering/BinaryMathematicalMorphology/wrapping/test/Baseline/PythonBinaryDilateImageFilterTest.png.sha512 similarity index 100% rename from Modules/Filtering/BinaryMathematicalMorphology/test/Baseline/PythonBinaryDilateImageFilterTest.png.sha512 rename to Modules/Filtering/BinaryMathematicalMorphology/wrapping/test/Baseline/PythonBinaryDilateImageFilterTest.png.sha512 diff --git a/Modules/Filtering/BinaryMathematicalMorphology/test/Baseline/PythonBinaryErodeImageFilterTest.png.md5 b/Modules/Filtering/BinaryMathematicalMorphology/wrapping/test/Baseline/PythonBinaryErodeImageFilterTest.png.md5 similarity index 100% rename from Modules/Filtering/BinaryMathematicalMorphology/test/Baseline/PythonBinaryErodeImageFilterTest.png.md5 rename to Modules/Filtering/BinaryMathematicalMorphology/wrapping/test/Baseline/PythonBinaryErodeImageFilterTest.png.md5 diff --git a/Modules/Filtering/BinaryMathematicalMorphology/test/Baseline/PythonBinaryErodeImageFilterTest.png.sha512 b/Modules/Filtering/BinaryMathematicalMorphology/wrapping/test/Baseline/PythonBinaryErodeImageFilterTest.png.sha512 similarity index 100% rename from Modules/Filtering/BinaryMathematicalMorphology/test/Baseline/PythonBinaryErodeImageFilterTest.png.sha512 rename to Modules/Filtering/BinaryMathematicalMorphology/wrapping/test/Baseline/PythonBinaryErodeImageFilterTest.png.sha512 diff --git a/Modules/Filtering/BinaryMathematicalMorphology/test/BinaryDilateImageFilterTest.py b/Modules/Filtering/BinaryMathematicalMorphology/wrapping/test/BinaryDilateImageFilterTest.py similarity index 100% rename from Modules/Filtering/BinaryMathematicalMorphology/test/BinaryDilateImageFilterTest.py rename to Modules/Filtering/BinaryMathematicalMorphology/wrapping/test/BinaryDilateImageFilterTest.py diff --git a/Modules/Filtering/BinaryMathematicalMorphology/test/BinaryErodeImageFilterTest.py b/Modules/Filtering/BinaryMathematicalMorphology/wrapping/test/BinaryErodeImageFilterTest.py similarity index 100% rename from Modules/Filtering/BinaryMathematicalMorphology/test/BinaryErodeImageFilterTest.py rename to Modules/Filtering/BinaryMathematicalMorphology/wrapping/test/BinaryErodeImageFilterTest.py diff --git a/Modules/Filtering/BinaryMathematicalMorphology/wrapping/test/CMakeLists.txt b/Modules/Filtering/BinaryMathematicalMorphology/wrapping/test/CMakeLists.txt new file mode 100644 index 00000000000..2f5376c7bb0 --- /dev/null +++ b/Modules/Filtering/BinaryMathematicalMorphology/wrapping/test/CMakeLists.txt @@ -0,0 +1,21 @@ +# some tests will fail if dim=2 and unsigned short are not wrapped +list(FIND ITK_WRAP_IMAGE_DIMS 2 wrap_2_index) +if(ITK_WRAP_unsigned_char AND wrap_2_index GREATER -1) + itk_python_add_test(NAME PythonBinaryDilateImageFilterTest + TEST_DRIVER_ARGS + --compare ${ITK_TEST_OUTPUT_DIR}/PythonBinaryDilateImageFilterTest.png DATA{Baseline/PythonBinaryDilateImageFilterTest.png} + COMMAND BinaryDilateImageFilterTest.py + DATA{${ITK_DATA_ROOT}/Input/2th_cthead1.png} + ${ITK_TEST_OUTPUT_DIR}/PythonBinaryDilateImageFilterTest.png + 5 + ) + itk_python_add_test(NAME PythonBinaryErodeImageFilterTest + TEST_DRIVER_ARGS + --compare ${ITK_TEST_OUTPUT_DIR}/PythonBinaryErodeImageFilterTest.png + DATA{Baseline/PythonBinaryErodeImageFilterTest.png} + COMMAND BinaryErodeImageFilterTest.py + DATA{${ITK_DATA_ROOT}/Input/2th_cthead1.png} + ${ITK_TEST_OUTPUT_DIR}/PythonBinaryErodeImageFilterTest.png + 5 + ) +endif() diff --git a/Modules/Filtering/CurvatureFlow/test/CMakeLists.txt b/Modules/Filtering/CurvatureFlow/test/CMakeLists.txt index 47f239ad190..2c413e9ffad 100644 --- a/Modules/Filtering/CurvatureFlow/test/CMakeLists.txt +++ b/Modules/Filtering/CurvatureFlow/test/CMakeLists.txt @@ -10,13 +10,3 @@ itk_add_test(NAME itkBinaryMinMaxCurvatureFlowImageFilterTest COMMAND ITKCurvatureFlowTestDriver itkBinaryMinMaxCurvatureFlowImageFilterTest) itk_add_test(NAME itkCurvatureFlowTesti COMMAND ITKCurvatureFlowTestDriver itkCurvatureFlowTest ${ITK_TEST_OUTPUT_DIR}/itkCurvatureFlowTest.vtk) - -list(FIND ITK_WRAP_IMAGE_DIMS 2 wrap_2_index) -if(ITK_WRAP_float AND wrap_2_index GREATER -1) - itk_python_add_test(NAME PythonCurvatureFlowImageFilterTest - COMMAND CurvatureFlowImageFilterTest.py - DATA{${ITK_DATA_ROOT}/Input/cthead1.png} - ${ITK_TEST_OUTPUT_DIR}/CurvatureFlowImageFilterTest.png - 5 0.125 1.0 - ) -endif() diff --git a/Modules/Filtering/CurvatureFlow/wrapping/test/CMakeLists.txt b/Modules/Filtering/CurvatureFlow/wrapping/test/CMakeLists.txt new file mode 100644 index 00000000000..a0084e7da26 --- /dev/null +++ b/Modules/Filtering/CurvatureFlow/wrapping/test/CMakeLists.txt @@ -0,0 +1,9 @@ +list(FIND ITK_WRAP_IMAGE_DIMS 2 wrap_2_index) +if(ITK_WRAP_float AND wrap_2_index GREATER -1) + itk_python_add_test(NAME PythonCurvatureFlowImageFilterTest + COMMAND CurvatureFlowImageFilterTest.py + DATA{${ITK_DATA_ROOT}/Input/cthead1.png} + ${ITK_TEST_OUTPUT_DIR}/CurvatureFlowImageFilterTest.png + 5 0.125 1.0 + ) +endif() diff --git a/Modules/Filtering/CurvatureFlow/test/CurvatureFlowImageFilterTest.py b/Modules/Filtering/CurvatureFlow/wrapping/test/CurvatureFlowImageFilterTest.py similarity index 100% rename from Modules/Filtering/CurvatureFlow/test/CurvatureFlowImageFilterTest.py rename to Modules/Filtering/CurvatureFlow/wrapping/test/CurvatureFlowImageFilterTest.py diff --git a/Modules/Filtering/FFT/test/CMakeLists.txt b/Modules/Filtering/FFT/test/CMakeLists.txt index dab4b66569f..c3564b6b362 100644 --- a/Modules/Filtering/FFT/test/CMakeLists.txt +++ b/Modules/Filtering/FFT/test/CMakeLists.txt @@ -269,16 +269,3 @@ endforeach() add_executable(ITKFFTTestCircularDependency itkTestCircularDependency.cxx) target_link_libraries(ITKFFTTestCircularDependency ${ITKFFT-Test_LIBRARIES}) itk_add_test(NAME itkFFTTestCircularDependency COMMAND ITKFFTTestCircularDependency) - -list(FIND ITK_WRAP_IMAGE_DIMS 2 wrap_2_index) -if(ITK_WRAP_float AND wrap_2_index GREATER -1) - itk_python_add_test(NAME PythonFFTImageFilterTest - TEST_DRIVER_ARGS - --compare ${ITK_TEST_OUTPUT_DIR}/PythonFFTImageFilterRealTest.png DATA{Baseline/PythonFFTImageFilterRealTest.png} - --compare ${ITK_TEST_OUTPUT_DIR}/PythonFFTImageFilterImaginaryTest.png DATA{Baseline/PythonFFTImageFilterImaginaryTest.png} - COMMAND FFTImageFilterTest.py - DATA{${ITK_DATA_ROOT}/Input/cthead1.png} - ${ITK_TEST_OUTPUT_DIR}/PythonFFTImageFilterRealTest.png - ${ITK_TEST_OUTPUT_DIR}/PythonFFTImageFilterImaginaryTest.png - ) -endif() diff --git a/Modules/Filtering/FFT/test/Baseline/PythonFFTImageFilterImaginaryTest.png.md5 b/Modules/Filtering/FFT/wrapping/test/Baseline/PythonFFTImageFilterImaginaryTest.png.md5 similarity index 100% rename from Modules/Filtering/FFT/test/Baseline/PythonFFTImageFilterImaginaryTest.png.md5 rename to Modules/Filtering/FFT/wrapping/test/Baseline/PythonFFTImageFilterImaginaryTest.png.md5 diff --git a/Modules/Filtering/FFT/test/Baseline/PythonFFTImageFilterImaginaryTest.png.sha512 b/Modules/Filtering/FFT/wrapping/test/Baseline/PythonFFTImageFilterImaginaryTest.png.sha512 similarity index 100% rename from Modules/Filtering/FFT/test/Baseline/PythonFFTImageFilterImaginaryTest.png.sha512 rename to Modules/Filtering/FFT/wrapping/test/Baseline/PythonFFTImageFilterImaginaryTest.png.sha512 diff --git a/Modules/Filtering/FFT/test/Baseline/PythonFFTImageFilterRealTest.png.md5 b/Modules/Filtering/FFT/wrapping/test/Baseline/PythonFFTImageFilterRealTest.png.md5 similarity index 100% rename from Modules/Filtering/FFT/test/Baseline/PythonFFTImageFilterRealTest.png.md5 rename to Modules/Filtering/FFT/wrapping/test/Baseline/PythonFFTImageFilterRealTest.png.md5 diff --git a/Modules/Filtering/FFT/test/Baseline/PythonFFTImageFilterRealTest.png.sha512 b/Modules/Filtering/FFT/wrapping/test/Baseline/PythonFFTImageFilterRealTest.png.sha512 similarity index 100% rename from Modules/Filtering/FFT/test/Baseline/PythonFFTImageFilterRealTest.png.sha512 rename to Modules/Filtering/FFT/wrapping/test/Baseline/PythonFFTImageFilterRealTest.png.sha512 diff --git a/Modules/Filtering/FFT/wrapping/test/CMakeLists.txt b/Modules/Filtering/FFT/wrapping/test/CMakeLists.txt new file mode 100644 index 00000000000..9505b55fab8 --- /dev/null +++ b/Modules/Filtering/FFT/wrapping/test/CMakeLists.txt @@ -0,0 +1,12 @@ +list(FIND ITK_WRAP_IMAGE_DIMS 2 wrap_2_index) +if(ITK_WRAP_float AND wrap_2_index GREATER -1) + itk_python_add_test(NAME PythonFFTImageFilterTest + TEST_DRIVER_ARGS + --compare ${ITK_TEST_OUTPUT_DIR}/PythonFFTImageFilterRealTest.png DATA{Baseline/PythonFFTImageFilterRealTest.png} + --compare ${ITK_TEST_OUTPUT_DIR}/PythonFFTImageFilterImaginaryTest.png DATA{Baseline/PythonFFTImageFilterImaginaryTest.png} + COMMAND FFTImageFilterTest.py + DATA{${ITK_DATA_ROOT}/Input/cthead1.png} + ${ITK_TEST_OUTPUT_DIR}/PythonFFTImageFilterRealTest.png + ${ITK_TEST_OUTPUT_DIR}/PythonFFTImageFilterImaginaryTest.png + ) +endif() diff --git a/Modules/Filtering/FFT/test/FFTImageFilterTest.py b/Modules/Filtering/FFT/wrapping/test/FFTImageFilterTest.py similarity index 100% rename from Modules/Filtering/FFT/test/FFTImageFilterTest.py rename to Modules/Filtering/FFT/wrapping/test/FFTImageFilterTest.py diff --git a/Modules/Filtering/FastMarching/test/CMakeLists.txt b/Modules/Filtering/FastMarching/test/CMakeLists.txt index fad209f3ef2..638501716d2 100644 --- a/Modules/Filtering/FastMarching/test/CMakeLists.txt +++ b/Modules/Filtering/FastMarching/test/CMakeLists.txt @@ -245,46 +245,3 @@ itk_add_test( NAME itkFastMarchingImageFilterTest_wm_multipleSeeds_NoHandlesTopo 2 ) set_property(TEST itkFastMarchingImageFilterTest_wm_multipleSeeds_NoHandlesTopo APPEND PROPERTY LABELS RUNS_LONG) - -list(FIND ITK_WRAP_IMAGE_DIMS 2 wrap_2_index) -if(ITK_WRAP_float AND wrap_2_index GREATER -1) - itk_python_add_test(NAME PythonFastMarchingLeftVentricleTest - TEST_DRIVER_ARGS - --compare ${ITK_TEST_OUTPUT_DIR}/FastMarchingLeftVentricleTest.png - DATA{Baseline/FastMarchingLeftVentricleTest.png} - COMMAND FastMarchingImageFilterTest.py - DATA{Input/BrainProtonDensitySlice.png} - ${ITK_TEST_OUTPUT_DIR}/FastMarchingLeftVentricleTest.png - 81 114 1.0 -0.5 3.0 100 100 - ) - - itk_python_add_test(NAME PythonFastMarchingRightVentricleTest - TEST_DRIVER_ARGS - --compare ${ITK_TEST_OUTPUT_DIR}/FastMarchingRightVentricleTest.png - DATA{Baseline/FastMarchingRightVentricleTest.png} - COMMAND FastMarchingImageFilterTest.py - DATA{Input/BrainProtonDensitySlice.png} - ${ITK_TEST_OUTPUT_DIR}/FastMarchingRightVentricleTest.png - 99 114 1.0 -0.5 3.0 100 100 - ) - - itk_python_add_test(NAME PythonFastMarchingWhiteMatterTest - TEST_DRIVER_ARGS - --compare ${ITK_TEST_OUTPUT_DIR}/FastMarchingWhiteMatterTest.png - DATA{Baseline/FastMarchingWhiteMatterTest.png} - COMMAND FastMarchingImageFilterTest.py - DATA{Input/BrainProtonDensitySlice.png} - ${ITK_TEST_OUTPUT_DIR}/FastMarchingWhiteMatterTest.png - 56 92 1.0 -0.3 2.0 200 100 - ) - - itk_python_add_test(NAME PythonFastMarchingGrayMatterTest - TEST_DRIVER_ARGS - --compare ${ITK_TEST_OUTPUT_DIR}/FastMarchingGrayMatterTest.png - DATA{Baseline/FastMarchingGrayMatterTest.png} - COMMAND FastMarchingImageFilterTest.py - DATA{Input/BrainProtonDensitySlice.png} - ${ITK_TEST_OUTPUT_DIR}/FastMarchingGrayMatterTest.png - 40 90 .5 -0.3 2.0 200 100 - ) -endif() diff --git a/Modules/Filtering/FastMarching/wrapping/test/CMakeLists.txt b/Modules/Filtering/FastMarching/wrapping/test/CMakeLists.txt new file mode 100644 index 00000000000..51f685beab0 --- /dev/null +++ b/Modules/Filtering/FastMarching/wrapping/test/CMakeLists.txt @@ -0,0 +1,45 @@ +set(test_input_dir ${itk-module_SOURCE_DIR}/test/Input) +set(test_baseline_dir ${itk-module_SOURCE_DIR}/test/Baseline) + +list(FIND ITK_WRAP_IMAGE_DIMS 2 wrap_2_index) +if(ITK_WRAP_float AND wrap_2_index GREATER -1) + itk_python_add_test(NAME PythonFastMarchingLeftVentricleTest + TEST_DRIVER_ARGS + --compare ${ITK_TEST_OUTPUT_DIR}/FastMarchingLeftVentricleTest.png + DATA{${test_baseline_dir}/FastMarchingLeftVentricleTest.png} + COMMAND FastMarchingImageFilterTest.py + DATA{${test_input_dir}/BrainProtonDensitySlice.png} + ${ITK_TEST_OUTPUT_DIR}/FastMarchingLeftVentricleTest.png + 81 114 1.0 -0.5 3.0 100 100 + ) + + itk_python_add_test(NAME PythonFastMarchingRightVentricleTest + TEST_DRIVER_ARGS + --compare ${ITK_TEST_OUTPUT_DIR}/FastMarchingRightVentricleTest.png + DATA{${test_baseline_dir}/FastMarchingRightVentricleTest.png} + COMMAND FastMarchingImageFilterTest.py + DATA{${test_input_dir}/BrainProtonDensitySlice.png} + ${ITK_TEST_OUTPUT_DIR}/FastMarchingRightVentricleTest.png + 99 114 1.0 -0.5 3.0 100 100 + ) + + itk_python_add_test(NAME PythonFastMarchingWhiteMatterTest + TEST_DRIVER_ARGS + --compare ${ITK_TEST_OUTPUT_DIR}/FastMarchingWhiteMatterTest.png + DATA{${test_baseline_dir}/FastMarchingWhiteMatterTest.png} + COMMAND FastMarchingImageFilterTest.py + DATA{${test_input_dir}/BrainProtonDensitySlice.png} + ${ITK_TEST_OUTPUT_DIR}/FastMarchingWhiteMatterTest.png + 56 92 1.0 -0.3 2.0 200 100 + ) + + itk_python_add_test(NAME PythonFastMarchingGrayMatterTest + TEST_DRIVER_ARGS + --compare ${ITK_TEST_OUTPUT_DIR}/FastMarchingGrayMatterTest.png + DATA{${test_baseline_dir}/FastMarchingGrayMatterTest.png} + COMMAND FastMarchingImageFilterTest.py + DATA{${test_input_dir}/BrainProtonDensitySlice.png} + ${ITK_TEST_OUTPUT_DIR}/FastMarchingGrayMatterTest.png + 40 90 .5 -0.3 2.0 200 100 + ) +endif() diff --git a/Modules/Filtering/FastMarching/test/FastMarchingImageFilterTest.py b/Modules/Filtering/FastMarching/wrapping/test/FastMarchingImageFilterTest.py similarity index 100% rename from Modules/Filtering/FastMarching/test/FastMarchingImageFilterTest.py rename to Modules/Filtering/FastMarching/wrapping/test/FastMarchingImageFilterTest.py diff --git a/Modules/Filtering/ImageFeature/test/CMakeLists.txt b/Modules/Filtering/ImageFeature/test/CMakeLists.txt index c5de7ce6cbe..41a15525a67 100644 --- a/Modules/Filtering/ImageFeature/test/CMakeLists.txt +++ b/Modules/Filtering/ImageFeature/test/CMakeLists.txt @@ -215,34 +215,3 @@ itk_add_test(NAME itkMultiScaleHessianBasedMeasureImageFilterTest --compare DATA{Baseline/itkMultiScaleHessianBasedMeasureImageFilterTestEnhancedOutput.mha} ${ITK_TEST_OUTPUT_DIR}/itkMultiScaleHessianBasedMeasureImageFilterTestEnhancedOutput.mha itkMultiScaleHessianBasedMeasureImageFilterTest DATA{${ITK_DATA_ROOT}/Input/DSA.png} ${ITK_TEST_OUTPUT_DIR}/itkMultiScaleHessianBasedMeasureImageFilterTestEnhancedOutput.mha ${ITK_TEST_OUTPUT_DIR}/itkMultiScaleHessianBasedMeasureImageFilterTestScalesOutput.mha 5 10 10 1 0 ${ITK_TEST_OUTPUT_DIR}/itkMultiScaleHessianBasedMeasureImageFilterTestEnhancedOutput2.mha) - -itk_python_add_test(NAME itkGradientVectorFlowImageFilterPythonTest - TEST_DRIVER_ARGS - --compare ${ITK_TEST_OUTPUT_DIR}/itkGradientVectorFlowImageFilterPythonTestX.png - DATA{Baseline/itkGradientVectorFlowImageFilterPythonTestX.png} - --compare ${ITK_TEST_OUTPUT_DIR}/itkGradientVectorFlowImageFilterPythonTestY.png - DATA{Baseline/itkGradientVectorFlowImageFilterPythonTestY.png} - COMMAND itkGradientVectorFlowImageFilterTest.py - DATA{Input/Contours.png} - ${ITK_TEST_OUTPUT_DIR}/itkGradientVectorFlowImageFilterPythonTestX.png - ${ITK_TEST_OUTPUT_DIR}/itkGradientVectorFlowImageFilterPythonTestY.png - 50 50000.0 0.001) - -list(FIND ITK_WRAP_IMAGE_DIMS 2 wrap_2_index) -if(ITK_WRAP_float AND wrap_2_index GREATER -1) - itk_python_add_test(NAME PythonLaplacianImageFilterTest - COMMAND LaplacianImageFilterTest.py - DATA{${ITK_DATA_ROOT}/Input/cthead1.png} - ${ITK_TEST_OUTPUT_DIR}/LaplacianImageFilterTest.png - ) - itk_python_add_test(NAME PythonCannyEdgeDetectionImageFilterTest - TEST_DRIVER_ARGS - --compareNumberOfPixelsTolerance 1 - --compare ${ITK_TEST_OUTPUT_DIR}/PythonCannyEdgeDetectionImageFilterTest.png - DATA{Baseline/PythonCannyEdgeDetectionImageFilterTest.png} - COMMAND CannyEdgeDetectionImageFilterTest.py - DATA{${ITK_DATA_ROOT}/Input/cthead1.png} - ${ITK_TEST_OUTPUT_DIR}/PythonCannyEdgeDetectionImageFilterTest.png - 9 - ) -endif() diff --git a/Modules/Filtering/ImageFeature/test/Baseline/PythonCannyEdgeDetectionImageFilterTest.png.md5 b/Modules/Filtering/ImageFeature/wrapping/test/Baseline/PythonCannyEdgeDetectionImageFilterTest.png.md5 similarity index 100% rename from Modules/Filtering/ImageFeature/test/Baseline/PythonCannyEdgeDetectionImageFilterTest.png.md5 rename to Modules/Filtering/ImageFeature/wrapping/test/Baseline/PythonCannyEdgeDetectionImageFilterTest.png.md5 diff --git a/Modules/Filtering/ImageFeature/test/Baseline/PythonCannyEdgeDetectionImageFilterTest.png.sha512 b/Modules/Filtering/ImageFeature/wrapping/test/Baseline/PythonCannyEdgeDetectionImageFilterTest.png.sha512 similarity index 100% rename from Modules/Filtering/ImageFeature/test/Baseline/PythonCannyEdgeDetectionImageFilterTest.png.sha512 rename to Modules/Filtering/ImageFeature/wrapping/test/Baseline/PythonCannyEdgeDetectionImageFilterTest.png.sha512 diff --git a/Modules/Filtering/ImageFeature/wrapping/test/CMakeLists.txt b/Modules/Filtering/ImageFeature/wrapping/test/CMakeLists.txt new file mode 100644 index 00000000000..93b0df8b11a --- /dev/null +++ b/Modules/Filtering/ImageFeature/wrapping/test/CMakeLists.txt @@ -0,0 +1,33 @@ +set(test_input_dir ${itk-module_SOURCE_DIR}/test/Input) +set(test_baseline_dir ${itk-module_SOURCE_DIR}/test/Baseline) + +itk_python_add_test(NAME itkGradientVectorFlowImageFilterPythonTest + TEST_DRIVER_ARGS + --compare ${ITK_TEST_OUTPUT_DIR}/itkGradientVectorFlowImageFilterPythonTestX.png + DATA{${test_baseline_dir}/itkGradientVectorFlowImageFilterPythonTestX.png} + --compare ${ITK_TEST_OUTPUT_DIR}/itkGradientVectorFlowImageFilterPythonTestY.png + DATA{${test_baseline_dir}/itkGradientVectorFlowImageFilterPythonTestY.png} + COMMAND itkGradientVectorFlowImageFilterTest.py + DATA{${test_input_dir}/Contours.png} + ${ITK_TEST_OUTPUT_DIR}/itkGradientVectorFlowImageFilterPythonTestX.png + ${ITK_TEST_OUTPUT_DIR}/itkGradientVectorFlowImageFilterPythonTestY.png + 50 50000.0 0.001) + +list(FIND ITK_WRAP_IMAGE_DIMS 2 wrap_2_index) +if(ITK_WRAP_float AND wrap_2_index GREATER -1) + itk_python_add_test(NAME PythonLaplacianImageFilterTest + COMMAND LaplacianImageFilterTest.py + DATA{${ITK_DATA_ROOT}/Input/cthead1.png} + ${ITK_TEST_OUTPUT_DIR}/LaplacianImageFilterTest.png + ) + itk_python_add_test(NAME PythonCannyEdgeDetectionImageFilterTest + TEST_DRIVER_ARGS + --compareNumberOfPixelsTolerance 1 + --compare ${ITK_TEST_OUTPUT_DIR}/PythonCannyEdgeDetectionImageFilterTest.png + DATA{Baseline/PythonCannyEdgeDetectionImageFilterTest.png} + COMMAND CannyEdgeDetectionImageFilterTest.py + DATA{${ITK_DATA_ROOT}/Input/cthead1.png} + ${ITK_TEST_OUTPUT_DIR}/PythonCannyEdgeDetectionImageFilterTest.png + 9 + ) +endif() diff --git a/Modules/Filtering/ImageFeature/test/CannyEdgeDetectionImageFilterTest.py b/Modules/Filtering/ImageFeature/wrapping/test/CannyEdgeDetectionImageFilterTest.py similarity index 100% rename from Modules/Filtering/ImageFeature/test/CannyEdgeDetectionImageFilterTest.py rename to Modules/Filtering/ImageFeature/wrapping/test/CannyEdgeDetectionImageFilterTest.py diff --git a/Modules/Filtering/ImageFeature/test/LaplacianImageFilterTest.py b/Modules/Filtering/ImageFeature/wrapping/test/LaplacianImageFilterTest.py similarity index 100% rename from Modules/Filtering/ImageFeature/test/LaplacianImageFilterTest.py rename to Modules/Filtering/ImageFeature/wrapping/test/LaplacianImageFilterTest.py diff --git a/Modules/Filtering/ImageFeature/test/itkGradientVectorFlowImageFilterTest.py b/Modules/Filtering/ImageFeature/wrapping/test/itkGradientVectorFlowImageFilterTest.py similarity index 100% rename from Modules/Filtering/ImageFeature/test/itkGradientVectorFlowImageFilterTest.py rename to Modules/Filtering/ImageFeature/wrapping/test/itkGradientVectorFlowImageFilterTest.py diff --git a/Modules/Filtering/ImageFilterBase/test/CMakeLists.txt b/Modules/Filtering/ImageFilterBase/test/CMakeLists.txt index e207b03ca4b..aa7e7729004 100644 --- a/Modules/Filtering/ImageFilterBase/test/CMakeLists.txt +++ b/Modules/Filtering/ImageFilterBase/test/CMakeLists.txt @@ -40,15 +40,3 @@ set(ITKImageFilterBaseGTests itkGeneratorImageFilterGTest.cxx ) CreateGoogleTestDriver(ITKImageFilterBase "${ITKImageFilterBase-Test_LIBRARIES}" "${ITKImageFilterBaseGTests}") - -# some tests will fail if dim=2 and unsigned short are not wrapped -list(FIND ITK_WRAP_IMAGE_DIMS 2 wrap_2_index) -if(ITK_WRAP_unsigned_char AND wrap_2_index GREATER -1) - itk_python_add_test(NAME PythonCastImageFilterTest - TEST_DRIVER_ARGS - --compare ${ITK_TEST_OUTPUT_DIR}/PythonCastImageFilterTest.png DATA{${ITK_DATA_ROOT}/Input/cthead1.png} - COMMAND CastImageFilterTest.py - DATA{${ITK_DATA_ROOT}/Input/cthead1.png} - ${ITK_TEST_OUTPUT_DIR}/PythonCastImageFilterTest.png - ) -endif() diff --git a/Modules/Filtering/ImageFilterBase/wrapping/test/CMakeLists.txt b/Modules/Filtering/ImageFilterBase/wrapping/test/CMakeLists.txt new file mode 100644 index 00000000000..57f1ad90c9e --- /dev/null +++ b/Modules/Filtering/ImageFilterBase/wrapping/test/CMakeLists.txt @@ -0,0 +1,11 @@ +# some tests will fail if dim=2 and unsigned short are not wrapped +list(FIND ITK_WRAP_IMAGE_DIMS 2 wrap_2_index) +if(ITK_WRAP_unsigned_char AND wrap_2_index GREATER -1) + itk_python_add_test(NAME PythonCastImageFilterTest + TEST_DRIVER_ARGS + --compare ${ITK_TEST_OUTPUT_DIR}/PythonCastImageFilterTest.png DATA{${ITK_DATA_ROOT}/Input/cthead1.png} + COMMAND CastImageFilterTest.py + DATA{${ITK_DATA_ROOT}/Input/cthead1.png} + ${ITK_TEST_OUTPUT_DIR}/PythonCastImageFilterTest.png + ) +endif() diff --git a/Modules/Filtering/ImageFilterBase/test/CastImageFilterTest.py b/Modules/Filtering/ImageFilterBase/wrapping/test/CastImageFilterTest.py similarity index 100% rename from Modules/Filtering/ImageFilterBase/test/CastImageFilterTest.py rename to Modules/Filtering/ImageFilterBase/wrapping/test/CastImageFilterTest.py diff --git a/Modules/Filtering/ImageFrequency/test/CMakeLists.txt b/Modules/Filtering/ImageFrequency/test/CMakeLists.txt index df55b394356..64991de3783 100644 --- a/Modules/Filtering/ImageFrequency/test/CMakeLists.txt +++ b/Modules/Filtering/ImageFrequency/test/CMakeLists.txt @@ -18,12 +18,6 @@ itk_add_test(NAME itkFrequencyBandImageFilterEvenTest itk_add_test(NAME itkFrequencyBandImageFilterOddTest COMMAND ITKImageFrequencyTestDriver itkFrequencyBandImageFilterTest "Odd") -itk_python_expression_add_test(NAME itkUnaryFrequencyDomainFilterPythonTest - EXPRESSION "instance = itk.UnaryFrequencyDomainFilter.New()") - -itk_python_expression_add_test(NAME itkFrequencyBandImageFilterPythonTest - EXPRESSION "instance = itk.FrequencyBandImageFilter.New()") - set(${itk-module}GTests itkFrequencyIteratorsGTest.cxx ) diff --git a/Modules/Filtering/ImageFrequency/wrapping/test/CMakeLists.txt b/Modules/Filtering/ImageFrequency/wrapping/test/CMakeLists.txt new file mode 100644 index 00000000000..a47e37553b8 --- /dev/null +++ b/Modules/Filtering/ImageFrequency/wrapping/test/CMakeLists.txt @@ -0,0 +1,5 @@ +itk_python_expression_add_test(NAME itkUnaryFrequencyDomainFilterPythonTest + EXPRESSION "instance = itk.UnaryFrequencyDomainFilter.New()") + +itk_python_expression_add_test(NAME itkFrequencyBandImageFilterPythonTest + EXPRESSION "instance = itk.FrequencyBandImageFilter.New()") diff --git a/Modules/Filtering/ImageGradient/test/CMakeLists.txt b/Modules/Filtering/ImageGradient/test/CMakeLists.txt index d95b38e1b37..dd2628568c9 100644 --- a/Modules/Filtering/ImageGradient/test/CMakeLists.txt +++ b/Modules/Filtering/ImageGradient/test/CMakeLists.txt @@ -90,16 +90,3 @@ itk_add_test(NAME itkGradientRecursiveGaussianFilterTest4 itk_add_test(NAME itkDifferenceOfGaussiansGradientTest COMMAND ITKImageGradientTestDriver itkDifferenceOfGaussiansGradientTest) - -list(FIND ITK_WRAP_IMAGE_DIMS 2 wrap_2_index) -if(ITK_WRAP_float AND wrap_2_index GREATER -1) - itk_python_add_test(NAME PythonGradientMagnitudeRecursiveGaussianImageFilterTest - TEST_DRIVER_ARGS - --compare ${ITK_TEST_OUTPUT_DIR}/GradientMagnitudeRecursiveGaussianImageFilterTest.png - DATA{Baseline/PythonGradientMagnitudeRecursiveGaussianImageFilterTest.png} - COMMAND GradientMagnitudeRecursiveGaussianImageFilterTest.py - DATA{Input/BrainProtonDensitySlice.png} - ${ITK_TEST_OUTPUT_DIR}/GradientMagnitudeRecursiveGaussianImageFilterTest.png - 5 - ) -endif() diff --git a/Modules/Filtering/ImageGradient/test/Baseline/PythonGradientMagnitudeRecursiveGaussianImageFilterTest.png.md5 b/Modules/Filtering/ImageGradient/wrapping/test/Baseline/PythonGradientMagnitudeRecursiveGaussianImageFilterTest.png.md5 similarity index 100% rename from Modules/Filtering/ImageGradient/test/Baseline/PythonGradientMagnitudeRecursiveGaussianImageFilterTest.png.md5 rename to Modules/Filtering/ImageGradient/wrapping/test/Baseline/PythonGradientMagnitudeRecursiveGaussianImageFilterTest.png.md5 diff --git a/Modules/Filtering/ImageGradient/test/Baseline/PythonGradientMagnitudeRecursiveGaussianImageFilterTest.png.sha512 b/Modules/Filtering/ImageGradient/wrapping/test/Baseline/PythonGradientMagnitudeRecursiveGaussianImageFilterTest.png.sha512 similarity index 100% rename from Modules/Filtering/ImageGradient/test/Baseline/PythonGradientMagnitudeRecursiveGaussianImageFilterTest.png.sha512 rename to Modules/Filtering/ImageGradient/wrapping/test/Baseline/PythonGradientMagnitudeRecursiveGaussianImageFilterTest.png.sha512 diff --git a/Modules/Filtering/ImageGradient/wrapping/test/CMakeLists.txt b/Modules/Filtering/ImageGradient/wrapping/test/CMakeLists.txt new file mode 100644 index 00000000000..166ca0341b6 --- /dev/null +++ b/Modules/Filtering/ImageGradient/wrapping/test/CMakeLists.txt @@ -0,0 +1,14 @@ +set(test_input_dir ${itk-module_SOURCE_DIR}/test/Input) + +list(FIND ITK_WRAP_IMAGE_DIMS 2 wrap_2_index) +if(ITK_WRAP_float AND wrap_2_index GREATER -1) + itk_python_add_test(NAME PythonGradientMagnitudeRecursiveGaussianImageFilterTest + TEST_DRIVER_ARGS + --compare ${ITK_TEST_OUTPUT_DIR}/GradientMagnitudeRecursiveGaussianImageFilterTest.png + DATA{Baseline/PythonGradientMagnitudeRecursiveGaussianImageFilterTest.png} + COMMAND GradientMagnitudeRecursiveGaussianImageFilterTest.py + DATA{${test_input_dir}/BrainProtonDensitySlice.png} + ${ITK_TEST_OUTPUT_DIR}/GradientMagnitudeRecursiveGaussianImageFilterTest.png + 5 + ) +endif() diff --git a/Modules/Filtering/ImageGradient/test/GradientMagnitudeRecursiveGaussianImageFilterTest.py b/Modules/Filtering/ImageGradient/wrapping/test/GradientMagnitudeRecursiveGaussianImageFilterTest.py similarity index 100% rename from Modules/Filtering/ImageGradient/test/GradientMagnitudeRecursiveGaussianImageFilterTest.py rename to Modules/Filtering/ImageGradient/wrapping/test/GradientMagnitudeRecursiveGaussianImageFilterTest.py diff --git a/Modules/Filtering/ImageGrid/test/CMakeLists.txt b/Modules/Filtering/ImageGrid/test/CMakeLists.txt index 9c213e9d784..9b4d613e2d7 100644 --- a/Modules/Filtering/ImageGrid/test/CMakeLists.txt +++ b/Modules/Filtering/ImageGrid/test/CMakeLists.txt @@ -335,47 +335,3 @@ set( ITKImageGridGTests itkTileImageFilterGTest.cxx ) CreateGoogleTestDriver(ITKImageGrid "${ITKImageGrid-Test_LIBRARIES}" "${ITKImageGridGTests}") - -# some tests will fail if dim=2 and unsigned short are not wrapped -list(FIND ITK_WRAP_IMAGE_DIMS 2 wrap_2_index) -if(ITK_WRAP_unsigned_char AND wrap_2_index GREATER -1) - itk_python_add_test(NAME PythonResampleImageFilterTest1 - TEST_DRIVER_ARGS - --compare ${ITK_TEST_OUTPUT_DIR}/PythonResampleImageFilterTest1.png - DATA{Baseline/PythonResampleImageFilterTest1.png} - COMMAND ResampleImageFilterTest.py - DATA{Input/BrainProtonDensitySlice.png} - ${ITK_TEST_OUTPUT_DIR}/PythonResampleImageFilterTest1.png - 0 - ) - - itk_python_add_test(NAME PythonResampleImageFilterTest2 - TEST_DRIVER_ARGS - --compare ${ITK_TEST_OUTPUT_DIR}/PythonResampleImageFilterTest2.png - DATA{Baseline/PythonResampleImageFilterTest2.png} - COMMAND ResampleImageFilterTest.py - DATA{Input/BrainProtonDensitySlice.png} - ${ITK_TEST_OUTPUT_DIR}/PythonResampleImageFilterTest2.png - 1 - ) - - itk_python_add_test(NAME PythonResampleImageFilterTest3 - TEST_DRIVER_ARGS - --compare ${ITK_TEST_OUTPUT_DIR}/PythonResampleImageFilterTest3.png - DATA{Baseline/PythonResampleImageFilterTest3.png} - COMMAND ResampleImageFilterTest.py - DATA{Input/BrainProtonDensitySlice.png} - ${ITK_TEST_OUTPUT_DIR}/PythonResampleImageFilterTest3.png - 2 - ) - - itk_python_add_test(NAME PythonResampleImageFilterTest4 - TEST_DRIVER_ARGS - --compare ${ITK_TEST_OUTPUT_DIR}/PythonResampleImageFilterTest4.png - DATA{Baseline/PythonResampleImageFilterTest4.png} - COMMAND ResampleImageFilterTest.py - DATA{Input/BrainProtonDensitySlice.png} - ${ITK_TEST_OUTPUT_DIR}/PythonResampleImageFilterTest4.png - 3 - ) -endif() diff --git a/Modules/Filtering/ImageGrid/test/Baseline/PythonResampleImageFilterTest1.png.md5 b/Modules/Filtering/ImageGrid/wrapping/test/Baseline/PythonResampleImageFilterTest1.png.md5 similarity index 100% rename from Modules/Filtering/ImageGrid/test/Baseline/PythonResampleImageFilterTest1.png.md5 rename to Modules/Filtering/ImageGrid/wrapping/test/Baseline/PythonResampleImageFilterTest1.png.md5 diff --git a/Modules/Filtering/ImageGrid/test/Baseline/PythonResampleImageFilterTest1.png.sha512 b/Modules/Filtering/ImageGrid/wrapping/test/Baseline/PythonResampleImageFilterTest1.png.sha512 similarity index 100% rename from Modules/Filtering/ImageGrid/test/Baseline/PythonResampleImageFilterTest1.png.sha512 rename to Modules/Filtering/ImageGrid/wrapping/test/Baseline/PythonResampleImageFilterTest1.png.sha512 diff --git a/Modules/Filtering/ImageGrid/test/Baseline/PythonResampleImageFilterTest2.png.md5 b/Modules/Filtering/ImageGrid/wrapping/test/Baseline/PythonResampleImageFilterTest2.png.md5 similarity index 100% rename from Modules/Filtering/ImageGrid/test/Baseline/PythonResampleImageFilterTest2.png.md5 rename to Modules/Filtering/ImageGrid/wrapping/test/Baseline/PythonResampleImageFilterTest2.png.md5 diff --git a/Modules/Filtering/ImageGrid/test/Baseline/PythonResampleImageFilterTest2.png.sha512 b/Modules/Filtering/ImageGrid/wrapping/test/Baseline/PythonResampleImageFilterTest2.png.sha512 similarity index 100% rename from Modules/Filtering/ImageGrid/test/Baseline/PythonResampleImageFilterTest2.png.sha512 rename to Modules/Filtering/ImageGrid/wrapping/test/Baseline/PythonResampleImageFilterTest2.png.sha512 diff --git a/Modules/Filtering/ImageGrid/test/Baseline/PythonResampleImageFilterTest3.png.md5 b/Modules/Filtering/ImageGrid/wrapping/test/Baseline/PythonResampleImageFilterTest3.png.md5 similarity index 100% rename from Modules/Filtering/ImageGrid/test/Baseline/PythonResampleImageFilterTest3.png.md5 rename to Modules/Filtering/ImageGrid/wrapping/test/Baseline/PythonResampleImageFilterTest3.png.md5 diff --git a/Modules/Filtering/ImageGrid/test/Baseline/PythonResampleImageFilterTest3.png.sha512 b/Modules/Filtering/ImageGrid/wrapping/test/Baseline/PythonResampleImageFilterTest3.png.sha512 similarity index 100% rename from Modules/Filtering/ImageGrid/test/Baseline/PythonResampleImageFilterTest3.png.sha512 rename to Modules/Filtering/ImageGrid/wrapping/test/Baseline/PythonResampleImageFilterTest3.png.sha512 diff --git a/Modules/Filtering/ImageGrid/test/Baseline/PythonResampleImageFilterTest4.png.md5 b/Modules/Filtering/ImageGrid/wrapping/test/Baseline/PythonResampleImageFilterTest4.png.md5 similarity index 100% rename from Modules/Filtering/ImageGrid/test/Baseline/PythonResampleImageFilterTest4.png.md5 rename to Modules/Filtering/ImageGrid/wrapping/test/Baseline/PythonResampleImageFilterTest4.png.md5 diff --git a/Modules/Filtering/ImageGrid/test/Baseline/PythonResampleImageFilterTest4.png.sha512 b/Modules/Filtering/ImageGrid/wrapping/test/Baseline/PythonResampleImageFilterTest4.png.sha512 similarity index 100% rename from Modules/Filtering/ImageGrid/test/Baseline/PythonResampleImageFilterTest4.png.sha512 rename to Modules/Filtering/ImageGrid/wrapping/test/Baseline/PythonResampleImageFilterTest4.png.sha512 diff --git a/Modules/Filtering/ImageGrid/wrapping/test/CMakeLists.txt b/Modules/Filtering/ImageGrid/wrapping/test/CMakeLists.txt new file mode 100644 index 00000000000..58f6e02d291 --- /dev/null +++ b/Modules/Filtering/ImageGrid/wrapping/test/CMakeLists.txt @@ -0,0 +1,45 @@ +set(test_input_dir ${itk-module_SOURCE_DIR}/test/Input) + +# some tests will fail if dim=2 and unsigned short are not wrapped +list(FIND ITK_WRAP_IMAGE_DIMS 2 wrap_2_index) +if(ITK_WRAP_unsigned_char AND wrap_2_index GREATER -1) + itk_python_add_test(NAME PythonResampleImageFilterTest1 + TEST_DRIVER_ARGS + --compare ${ITK_TEST_OUTPUT_DIR}/PythonResampleImageFilterTest1.png + DATA{Baseline/PythonResampleImageFilterTest1.png} + COMMAND ResampleImageFilterTest.py + DATA{${test_input_dir}/BrainProtonDensitySlice.png} + ${ITK_TEST_OUTPUT_DIR}/PythonResampleImageFilterTest1.png + 0 + ) + + itk_python_add_test(NAME PythonResampleImageFilterTest2 + TEST_DRIVER_ARGS + --compare ${ITK_TEST_OUTPUT_DIR}/PythonResampleImageFilterTest2.png + DATA{Baseline/PythonResampleImageFilterTest2.png} + COMMAND ResampleImageFilterTest.py + DATA{${test_input_dir}/BrainProtonDensitySlice.png} + ${ITK_TEST_OUTPUT_DIR}/PythonResampleImageFilterTest2.png + 1 + ) + + itk_python_add_test(NAME PythonResampleImageFilterTest3 + TEST_DRIVER_ARGS + --compare ${ITK_TEST_OUTPUT_DIR}/PythonResampleImageFilterTest3.png + DATA{Baseline/PythonResampleImageFilterTest3.png} + COMMAND ResampleImageFilterTest.py + DATA{${test_input_dir}/BrainProtonDensitySlice.png} + ${ITK_TEST_OUTPUT_DIR}/PythonResampleImageFilterTest3.png + 2 + ) + + itk_python_add_test(NAME PythonResampleImageFilterTest4 + TEST_DRIVER_ARGS + --compare ${ITK_TEST_OUTPUT_DIR}/PythonResampleImageFilterTest4.png + DATA{Baseline/PythonResampleImageFilterTest4.png} + COMMAND ResampleImageFilterTest.py + DATA{${test_input_dir}/BrainProtonDensitySlice.png} + ${ITK_TEST_OUTPUT_DIR}/PythonResampleImageFilterTest4.png + 3 + ) +endif() diff --git a/Modules/Filtering/ImageGrid/test/ResampleImageFilterTest.py b/Modules/Filtering/ImageGrid/wrapping/test/ResampleImageFilterTest.py similarity index 100% rename from Modules/Filtering/ImageGrid/test/ResampleImageFilterTest.py rename to Modules/Filtering/ImageGrid/wrapping/test/ResampleImageFilterTest.py diff --git a/Modules/Filtering/ImageIntensity/test/CMakeLists.txt b/Modules/Filtering/ImageIntensity/test/CMakeLists.txt index df28519b81a..74cda5364dd 100644 --- a/Modules/Filtering/ImageIntensity/test/CMakeLists.txt +++ b/Modules/Filtering/ImageIntensity/test/CMakeLists.txt @@ -355,23 +355,3 @@ if(MSVC) endif() CreateGoogleTestDriver(ITKImageIntensity "${ITKImageIntensity-Test_LIBRARIES}" "${ITKImageIntensityGTests}") - -# some tests will fail if dim=2 and unsigned short are not wrapped -list(FIND ITK_WRAP_IMAGE_DIMS 2 wrap_2_index) -if(ITK_WRAP_unsigned_char AND wrap_2_index GREATER -1) - itk_python_add_test(NAME PythonSigmoidImageFilterTest - TEST_DRIVER_ARGS - --compare ${ITK_TEST_OUTPUT_DIR}/PythonSigmoidImageFilterTest.png - DATA{Baseline/PythonSigmoidImageFilterTest.png} - COMMAND SigmoidImageFilterTest.py - DATA{${ITK_DATA_ROOT}/Input/cthead1.png} - ${ITK_TEST_OUTPUT_DIR}/PythonSigmoidImageFilterTest.png - 10 240 10 170 - ) - itk_python_add_test(NAME PythonIntensityWindowingImageFilterTest - COMMAND itkIntensityWindowingImageFilterTest.py - DATA{${ITK_DATA_ROOT}/Input/cthead1.png} - ) -endif() -itk_python_expression_add_test(NAME itkSymmetricEigenAnalysisImageFilterPythonTest - EXPRESSION "filt = itk.SymmetricEigenAnalysisImageFilter.New()") diff --git a/Modules/Filtering/ImageIntensity/test/Baseline/PythonSigmoidImageFilterTest.png.md5 b/Modules/Filtering/ImageIntensity/wrapping/test/Baseline/PythonSigmoidImageFilterTest.png.md5 similarity index 100% rename from Modules/Filtering/ImageIntensity/test/Baseline/PythonSigmoidImageFilterTest.png.md5 rename to Modules/Filtering/ImageIntensity/wrapping/test/Baseline/PythonSigmoidImageFilterTest.png.md5 diff --git a/Modules/Filtering/ImageIntensity/test/Baseline/PythonSigmoidImageFilterTest.png.sha512 b/Modules/Filtering/ImageIntensity/wrapping/test/Baseline/PythonSigmoidImageFilterTest.png.sha512 similarity index 100% rename from Modules/Filtering/ImageIntensity/test/Baseline/PythonSigmoidImageFilterTest.png.sha512 rename to Modules/Filtering/ImageIntensity/wrapping/test/Baseline/PythonSigmoidImageFilterTest.png.sha512 diff --git a/Modules/Filtering/ImageIntensity/wrapping/test/CMakeLists.txt b/Modules/Filtering/ImageIntensity/wrapping/test/CMakeLists.txt new file mode 100644 index 00000000000..b078d62b076 --- /dev/null +++ b/Modules/Filtering/ImageIntensity/wrapping/test/CMakeLists.txt @@ -0,0 +1,19 @@ +# some tests will fail if dim=2 and unsigned short are not wrapped +list(FIND ITK_WRAP_IMAGE_DIMS 2 wrap_2_index) +if(ITK_WRAP_unsigned_char AND wrap_2_index GREATER -1) + itk_python_add_test(NAME PythonSigmoidImageFilterTest + TEST_DRIVER_ARGS + --compare ${ITK_TEST_OUTPUT_DIR}/PythonSigmoidImageFilterTest.png + DATA{Baseline/PythonSigmoidImageFilterTest.png} + COMMAND SigmoidImageFilterTest.py + DATA{${ITK_DATA_ROOT}/Input/cthead1.png} + ${ITK_TEST_OUTPUT_DIR}/PythonSigmoidImageFilterTest.png + 10 240 10 170 + ) + itk_python_add_test(NAME PythonIntensityWindowingImageFilterTest + COMMAND itkIntensityWindowingImageFilterTest.py + DATA{${ITK_DATA_ROOT}/Input/cthead1.png} + ) +endif() +itk_python_expression_add_test(NAME itkSymmetricEigenAnalysisImageFilterPythonTest + EXPRESSION "filt = itk.SymmetricEigenAnalysisImageFilter.New()") diff --git a/Modules/Filtering/ImageIntensity/test/SigmoidImageFilterTest.py b/Modules/Filtering/ImageIntensity/wrapping/test/SigmoidImageFilterTest.py similarity index 100% rename from Modules/Filtering/ImageIntensity/test/SigmoidImageFilterTest.py rename to Modules/Filtering/ImageIntensity/wrapping/test/SigmoidImageFilterTest.py diff --git a/Modules/Filtering/ImageIntensity/test/itkIntensityWindowingImageFilterTest.py b/Modules/Filtering/ImageIntensity/wrapping/test/itkIntensityWindowingImageFilterTest.py similarity index 100% rename from Modules/Filtering/ImageIntensity/test/itkIntensityWindowingImageFilterTest.py rename to Modules/Filtering/ImageIntensity/wrapping/test/itkIntensityWindowingImageFilterTest.py diff --git a/Modules/Filtering/MathematicalMorphology/test/CMakeLists.txt b/Modules/Filtering/MathematicalMorphology/test/CMakeLists.txt index 0f732ef309a..d96a8aeb1a6 100644 --- a/Modules/Filtering/MathematicalMorphology/test/CMakeLists.txt +++ b/Modules/Filtering/MathematicalMorphology/test/CMakeLists.txt @@ -520,47 +520,3 @@ itk_add_test(NAME itkRankImageFilterTest10 --compare DATA{Baseline/itkRankImageFilter10.png} ${ITK_TEST_OUTPUT_DIR}/itkRankImageFilter10.png itkRankImageFilterTest DATA{${ITK_DATA_ROOT}/Input/cthead1.png} ${ITK_TEST_OUTPUT_DIR}/itkRankImageFilter10.png 10) - -# some tests will fail if dim=2 and unsigned short are not wrapped -list(FIND ITK_WRAP_IMAGE_DIMS 2 wrap_2_index) -if(ITK_WRAP_unsigned_char AND wrap_2_index GREATER -1) - itk_python_add_test(NAME PythonFlatStructuringElementBall - TEST_DRIVER_ARGS - COMMAND FlatStructuringElementTest.py - Ball - 5 - ) - itk_python_add_test(NAME PythonFlatStructuringElementBox - TEST_DRIVER_ARGS - COMMAND FlatStructuringElementTest.py - Box - 5 - ) - itk_python_add_test(NAME PythonGrayscaleDilateImageFilterTest - TEST_DRIVER_ARGS - --compare ${ITK_TEST_OUTPUT_DIR}/PythonGrayscaleDilateImageFilterTest.png - DATA{Baseline/PythonGrayscaleDilateImageFilterTest.png} - COMMAND GrayscaleDilateImageFilterTest.py - DATA{${ITK_DATA_ROOT}/Input/cthead1.png} - ${ITK_TEST_OUTPUT_DIR}/PythonGrayscaleDilateImageFilterTest.png - 5 - ) - itk_python_add_test(NAME PythonGrayscaleErodeImageFilterTest - TEST_DRIVER_ARGS - --compare ${ITK_TEST_OUTPUT_DIR}/PythonGrayscaleErodeImageFilterTest.png - DATA{Baseline/PythonGrayscaleErodeImageFilterTest.png} - COMMAND GrayscaleErodeImageFilterTest.py - DATA{${ITK_DATA_ROOT}/Input/cthead1.png} - ${ITK_TEST_OUTPUT_DIR}/PythonGrayscaleErodeImageFilterTest.png - 5 - ) - itk_python_add_test(NAME PythonBoxGrayscaleDilateImageFilterTest - TEST_DRIVER_ARGS - --compare - ${ITK_TEST_OUTPUT_DIR}/PythonBoxGrayscaleDilateImageFilterTest.png - DATA{Baseline/PythonBoxGrayscaleDilateImageFilterTest.png} - COMMAND BoxGrayscaleDilateImageFilterTest.py - DATA{${ITK_DATA_ROOT}/Input/cthead1.png} - ${ITK_TEST_OUTPUT_DIR}/PythonBoxGrayscaleDilateImageFilterTest.png - ) -endif() diff --git a/Modules/Filtering/MathematicalMorphology/test/Baseline/PythonBoxGrayscaleDilateImageFilterTest.png.md5 b/Modules/Filtering/MathematicalMorphology/wrapping/test/Baseline/PythonBoxGrayscaleDilateImageFilterTest.png.md5 similarity index 100% rename from Modules/Filtering/MathematicalMorphology/test/Baseline/PythonBoxGrayscaleDilateImageFilterTest.png.md5 rename to Modules/Filtering/MathematicalMorphology/wrapping/test/Baseline/PythonBoxGrayscaleDilateImageFilterTest.png.md5 diff --git a/Modules/Filtering/MathematicalMorphology/test/Baseline/PythonBoxGrayscaleDilateImageFilterTest.png.sha512 b/Modules/Filtering/MathematicalMorphology/wrapping/test/Baseline/PythonBoxGrayscaleDilateImageFilterTest.png.sha512 similarity index 100% rename from Modules/Filtering/MathematicalMorphology/test/Baseline/PythonBoxGrayscaleDilateImageFilterTest.png.sha512 rename to Modules/Filtering/MathematicalMorphology/wrapping/test/Baseline/PythonBoxGrayscaleDilateImageFilterTest.png.sha512 diff --git a/Modules/Filtering/MathematicalMorphology/test/Baseline/PythonGrayscaleDilateImageFilterTest.png.md5 b/Modules/Filtering/MathematicalMorphology/wrapping/test/Baseline/PythonGrayscaleDilateImageFilterTest.png.md5 similarity index 100% rename from Modules/Filtering/MathematicalMorphology/test/Baseline/PythonGrayscaleDilateImageFilterTest.png.md5 rename to Modules/Filtering/MathematicalMorphology/wrapping/test/Baseline/PythonGrayscaleDilateImageFilterTest.png.md5 diff --git a/Modules/Filtering/MathematicalMorphology/test/Baseline/PythonGrayscaleDilateImageFilterTest.png.sha512 b/Modules/Filtering/MathematicalMorphology/wrapping/test/Baseline/PythonGrayscaleDilateImageFilterTest.png.sha512 similarity index 100% rename from Modules/Filtering/MathematicalMorphology/test/Baseline/PythonGrayscaleDilateImageFilterTest.png.sha512 rename to Modules/Filtering/MathematicalMorphology/wrapping/test/Baseline/PythonGrayscaleDilateImageFilterTest.png.sha512 diff --git a/Modules/Filtering/MathematicalMorphology/test/Baseline/PythonGrayscaleErodeImageFilterTest.png.md5 b/Modules/Filtering/MathematicalMorphology/wrapping/test/Baseline/PythonGrayscaleErodeImageFilterTest.png.md5 similarity index 100% rename from Modules/Filtering/MathematicalMorphology/test/Baseline/PythonGrayscaleErodeImageFilterTest.png.md5 rename to Modules/Filtering/MathematicalMorphology/wrapping/test/Baseline/PythonGrayscaleErodeImageFilterTest.png.md5 diff --git a/Modules/Filtering/MathematicalMorphology/test/Baseline/PythonGrayscaleErodeImageFilterTest.png.sha512 b/Modules/Filtering/MathematicalMorphology/wrapping/test/Baseline/PythonGrayscaleErodeImageFilterTest.png.sha512 similarity index 100% rename from Modules/Filtering/MathematicalMorphology/test/Baseline/PythonGrayscaleErodeImageFilterTest.png.sha512 rename to Modules/Filtering/MathematicalMorphology/wrapping/test/Baseline/PythonGrayscaleErodeImageFilterTest.png.sha512 diff --git a/Modules/Filtering/MathematicalMorphology/test/BoxGrayscaleDilateImageFilterTest.py b/Modules/Filtering/MathematicalMorphology/wrapping/test/BoxGrayscaleDilateImageFilterTest.py similarity index 100% rename from Modules/Filtering/MathematicalMorphology/test/BoxGrayscaleDilateImageFilterTest.py rename to Modules/Filtering/MathematicalMorphology/wrapping/test/BoxGrayscaleDilateImageFilterTest.py diff --git a/Modules/Filtering/MathematicalMorphology/wrapping/test/CMakeLists.txt b/Modules/Filtering/MathematicalMorphology/wrapping/test/CMakeLists.txt new file mode 100644 index 00000000000..ddd492d5a40 --- /dev/null +++ b/Modules/Filtering/MathematicalMorphology/wrapping/test/CMakeLists.txt @@ -0,0 +1,43 @@ +# some tests will fail if dim=2 and unsigned short are not wrapped +list(FIND ITK_WRAP_IMAGE_DIMS 2 wrap_2_index) +if(ITK_WRAP_unsigned_char AND wrap_2_index GREATER -1) + itk_python_add_test(NAME PythonFlatStructuringElementBall + TEST_DRIVER_ARGS + COMMAND FlatStructuringElementTest.py + Ball + 5 + ) + itk_python_add_test(NAME PythonFlatStructuringElementBox + TEST_DRIVER_ARGS + COMMAND FlatStructuringElementTest.py + Box + 5 + ) + itk_python_add_test(NAME PythonGrayscaleDilateImageFilterTest + TEST_DRIVER_ARGS + --compare ${ITK_TEST_OUTPUT_DIR}/PythonGrayscaleDilateImageFilterTest.png + DATA{Baseline/PythonGrayscaleDilateImageFilterTest.png} + COMMAND GrayscaleDilateImageFilterTest.py + DATA{${ITK_DATA_ROOT}/Input/cthead1.png} + ${ITK_TEST_OUTPUT_DIR}/PythonGrayscaleDilateImageFilterTest.png + 5 + ) + itk_python_add_test(NAME PythonGrayscaleErodeImageFilterTest + TEST_DRIVER_ARGS + --compare ${ITK_TEST_OUTPUT_DIR}/PythonGrayscaleErodeImageFilterTest.png + DATA{Baseline/PythonGrayscaleErodeImageFilterTest.png} + COMMAND GrayscaleErodeImageFilterTest.py + DATA{${ITK_DATA_ROOT}/Input/cthead1.png} + ${ITK_TEST_OUTPUT_DIR}/PythonGrayscaleErodeImageFilterTest.png + 5 + ) + itk_python_add_test(NAME PythonBoxGrayscaleDilateImageFilterTest + TEST_DRIVER_ARGS + --compare + ${ITK_TEST_OUTPUT_DIR}/PythonBoxGrayscaleDilateImageFilterTest.png + DATA{Baseline/PythonBoxGrayscaleDilateImageFilterTest.png} + COMMAND BoxGrayscaleDilateImageFilterTest.py + DATA{${ITK_DATA_ROOT}/Input/cthead1.png} + ${ITK_TEST_OUTPUT_DIR}/PythonBoxGrayscaleDilateImageFilterTest.png + ) +endif() diff --git a/Modules/Filtering/MathematicalMorphology/test/FlatStructuringElementTest.py b/Modules/Filtering/MathematicalMorphology/wrapping/test/FlatStructuringElementTest.py similarity index 100% rename from Modules/Filtering/MathematicalMorphology/test/FlatStructuringElementTest.py rename to Modules/Filtering/MathematicalMorphology/wrapping/test/FlatStructuringElementTest.py diff --git a/Modules/Filtering/MathematicalMorphology/test/GrayscaleDilateImageFilterTest.py b/Modules/Filtering/MathematicalMorphology/wrapping/test/GrayscaleDilateImageFilterTest.py similarity index 100% rename from Modules/Filtering/MathematicalMorphology/test/GrayscaleDilateImageFilterTest.py rename to Modules/Filtering/MathematicalMorphology/wrapping/test/GrayscaleDilateImageFilterTest.py diff --git a/Modules/Filtering/MathematicalMorphology/test/GrayscaleErodeImageFilterTest.py b/Modules/Filtering/MathematicalMorphology/wrapping/test/GrayscaleErodeImageFilterTest.py similarity index 100% rename from Modules/Filtering/MathematicalMorphology/test/GrayscaleErodeImageFilterTest.py rename to Modules/Filtering/MathematicalMorphology/wrapping/test/GrayscaleErodeImageFilterTest.py diff --git a/Modules/Filtering/Path/test/CMakeLists.txt b/Modules/Filtering/Path/test/CMakeLists.txt index 199780525ce..51f4012fcc5 100644 --- a/Modules/Filtering/Path/test/CMakeLists.txt +++ b/Modules/Filtering/Path/test/CMakeLists.txt @@ -50,16 +50,3 @@ itk_add_test(NAME itkOrthogonalSwath2DPathFilterTest itk_add_test(NAME itkContourExtractor2DImageFilterTest COMMAND ITKPathTestDriver itkContourExtractor2DImageFilterTest DATA{Input/ContourExtractor2DTest.tif}) - -itk_python_expression_add_test(NAME itkParametricPathPythonTest - EXPRESSION "path = itk.ParametricPath[2].New()") -itk_python_expression_add_test(NAME itkPolyLineParametricPathPythonTest - EXPRESSION "path = itk.PolyLineParametricPath[2].New()") -itk_python_expression_add_test(NAME itkImageToPathPythonTest - EXPRESSION "PathType = itk.PolyLineParametricPath[2]; - ImageType = itk.Image[itk.UC][2]; - filter = itk.ImageToPathFilter[ImageType, PathType].New();") -itk_python_expression_add_test(NAME itkPathToImageFilterPythonTest - EXPRESSION "PathType = itk.PolyLineParametricPath[2]; - ImageType = itk.Image[itk.UC][2]; - filter = itk.PathToImageFilter[PathType, ImageType].New();") diff --git a/Modules/Filtering/Path/wrapping/test/CMakeLists.txt b/Modules/Filtering/Path/wrapping/test/CMakeLists.txt new file mode 100644 index 00000000000..df9e1c2194b --- /dev/null +++ b/Modules/Filtering/Path/wrapping/test/CMakeLists.txt @@ -0,0 +1,12 @@ +itk_python_expression_add_test(NAME itkParametricPathPythonTest + EXPRESSION "path = itk.ParametricPath[2].New()") +itk_python_expression_add_test(NAME itkPolyLineParametricPathPythonTest + EXPRESSION "path = itk.PolyLineParametricPath[2].New()") +itk_python_expression_add_test(NAME itkImageToPathPythonTest + EXPRESSION "PathType = itk.PolyLineParametricPath[2]; + ImageType = itk.Image[itk.UC][2]; + filter = itk.ImageToPathFilter[ImageType, PathType].New();") +itk_python_expression_add_test(NAME itkPathToImageFilterPythonTest + EXPRESSION "PathType = itk.PolyLineParametricPath[2]; + ImageType = itk.Image[itk.UC][2]; + filter = itk.PathToImageFilter[PathType, ImageType].New();") diff --git a/Modules/Filtering/Smoothing/test/CMakeLists.txt b/Modules/Filtering/Smoothing/test/CMakeLists.txt index 5e1ade004f2..4c36cf9da82 100644 --- a/Modules/Filtering/Smoothing/test/CMakeLists.txt +++ b/Modules/Filtering/Smoothing/test/CMakeLists.txt @@ -68,52 +68,3 @@ itk_add_test(NAME itkRecursiveGaussianImageFiltersTest itk_add_test(NAME itkRecursiveGaussianScaleSpaceTest1 COMMAND ITKSmoothingTestDriver itkRecursiveGaussianScaleSpaceTest1) - -# some tests will fail if dim=2 and unsigned short are not wrapped -list(FIND ITK_WRAP_IMAGE_DIMS 2 wrap_2_index) -if(ITK_WRAP_unsigned_char AND wrap_2_index GREATER -1) - itk_python_add_test(NAME PythonMeanImageFilterTest - TEST_DRIVER_ARGS - --compare ${ITK_TEST_OUTPUT_DIR}/PythonMeanImageFilterTest.png - DATA{Baseline/PythonMeanImageFilterTest.png} - COMMAND MeanImageFilterTest.py - DATA{${ITK_DATA_ROOT}/Input/cthead1.png} - ${ITK_TEST_OUTPUT_DIR}/PythonMeanImageFilterTest.png - 3 - ) - - itk_python_add_test(NAME PythonMeanImageFilterFunctionCallTest - TEST_DRIVER_ARGS - --compare - ${ITK_TEST_OUTPUT_DIR}/PythonMeanImageFilterFunctionCallTest.png - DATA{Baseline/PythonMeanImageFilterFunctionCallTest.png} - COMMAND MeanImageFilterFunctionCallTest.py - DATA{Input/cthead1UC.png} - ${ITK_TEST_OUTPUT_DIR}/PythonMeanImageFilterFunctionCallTest.png - 3 - ) - - itk_python_add_test(NAME PythonMedianImageFilterTest - TEST_DRIVER_ARGS - --compare ${ITK_TEST_OUTPUT_DIR}/PythonMedianImageFilterTest.png - DATA{Baseline/PythonMedianImageFilterTest.png} - COMMAND MedianImageFilterTest.py - DATA{${ITK_DATA_ROOT}/Input/cthead1.png} - ${ITK_TEST_OUTPUT_DIR}/PythonMedianImageFilterTest.png - 3 - ) - if(ITK_WRAP_DOC) - itk_python_add_test(NAME PythonMedianImageFilterFunctionalDocumentationTest - COMMAND MedianImageFilterFunctionalDocumentationTest.py - ) - endif() - itk_python_add_test(NAME PythonAutoPipelineTest - TEST_DRIVER_ARGS - --compare ${ITK_TEST_OUTPUT_DIR}/PythonAutoPipelineTest.png - DATA{Baseline/PythonMedianImageFilterTest.png} - COMMAND PythonAutoPipelineTest.py - DATA{${ITK_DATA_ROOT}/Input/cthead1.png} - ${ITK_TEST_OUTPUT_DIR}/PythonAutoPipelineTest.png - 3 - ) -endif() diff --git a/Modules/Filtering/Smoothing/test/Baseline/PythonMeanImageFilterFunctionCallTest.png.md5 b/Modules/Filtering/Smoothing/wrapping/test/Baseline/PythonMeanImageFilterFunctionCallTest.png.md5 similarity index 100% rename from Modules/Filtering/Smoothing/test/Baseline/PythonMeanImageFilterFunctionCallTest.png.md5 rename to Modules/Filtering/Smoothing/wrapping/test/Baseline/PythonMeanImageFilterFunctionCallTest.png.md5 diff --git a/Modules/Filtering/Smoothing/test/Baseline/PythonMeanImageFilterFunctionCallTest.png.sha512 b/Modules/Filtering/Smoothing/wrapping/test/Baseline/PythonMeanImageFilterFunctionCallTest.png.sha512 similarity index 100% rename from Modules/Filtering/Smoothing/test/Baseline/PythonMeanImageFilterFunctionCallTest.png.sha512 rename to Modules/Filtering/Smoothing/wrapping/test/Baseline/PythonMeanImageFilterFunctionCallTest.png.sha512 diff --git a/Modules/Filtering/Smoothing/test/Baseline/PythonMeanImageFilterTest.png.md5 b/Modules/Filtering/Smoothing/wrapping/test/Baseline/PythonMeanImageFilterTest.png.md5 similarity index 100% rename from Modules/Filtering/Smoothing/test/Baseline/PythonMeanImageFilterTest.png.md5 rename to Modules/Filtering/Smoothing/wrapping/test/Baseline/PythonMeanImageFilterTest.png.md5 diff --git a/Modules/Filtering/Smoothing/test/Baseline/PythonMeanImageFilterTest.png.sha512 b/Modules/Filtering/Smoothing/wrapping/test/Baseline/PythonMeanImageFilterTest.png.sha512 similarity index 100% rename from Modules/Filtering/Smoothing/test/Baseline/PythonMeanImageFilterTest.png.sha512 rename to Modules/Filtering/Smoothing/wrapping/test/Baseline/PythonMeanImageFilterTest.png.sha512 diff --git a/Modules/Filtering/Smoothing/test/Baseline/PythonMedianImageFilterTest.png.md5 b/Modules/Filtering/Smoothing/wrapping/test/Baseline/PythonMedianImageFilterTest.png.md5 similarity index 100% rename from Modules/Filtering/Smoothing/test/Baseline/PythonMedianImageFilterTest.png.md5 rename to Modules/Filtering/Smoothing/wrapping/test/Baseline/PythonMedianImageFilterTest.png.md5 diff --git a/Modules/Filtering/Smoothing/test/Baseline/PythonMedianImageFilterTest.png.sha512 b/Modules/Filtering/Smoothing/wrapping/test/Baseline/PythonMedianImageFilterTest.png.sha512 similarity index 100% rename from Modules/Filtering/Smoothing/test/Baseline/PythonMedianImageFilterTest.png.sha512 rename to Modules/Filtering/Smoothing/wrapping/test/Baseline/PythonMedianImageFilterTest.png.sha512 diff --git a/Modules/Filtering/Smoothing/wrapping/test/CMakeLists.txt b/Modules/Filtering/Smoothing/wrapping/test/CMakeLists.txt new file mode 100644 index 00000000000..562ae2644e4 --- /dev/null +++ b/Modules/Filtering/Smoothing/wrapping/test/CMakeLists.txt @@ -0,0 +1,50 @@ +set(test_input_dir ${itk-module_SOURCE_DIR}/test/Input) + +# some tests will fail if dim=2 and unsigned short are not wrapped +list(FIND ITK_WRAP_IMAGE_DIMS 2 wrap_2_index) +if(ITK_WRAP_unsigned_char AND wrap_2_index GREATER -1) + itk_python_add_test(NAME PythonMeanImageFilterTest + TEST_DRIVER_ARGS + --compare ${ITK_TEST_OUTPUT_DIR}/PythonMeanImageFilterTest.png + DATA{Baseline/PythonMeanImageFilterTest.png} + COMMAND MeanImageFilterTest.py + DATA{${ITK_DATA_ROOT}/Input/cthead1.png} + ${ITK_TEST_OUTPUT_DIR}/PythonMeanImageFilterTest.png + 3 + ) + + itk_python_add_test(NAME PythonMeanImageFilterFunctionCallTest + TEST_DRIVER_ARGS + --compare + ${ITK_TEST_OUTPUT_DIR}/PythonMeanImageFilterFunctionCallTest.png + DATA{Baseline/PythonMeanImageFilterFunctionCallTest.png} + COMMAND MeanImageFilterFunctionCallTest.py + DATA{${test_input_dir}/cthead1UC.png} + ${ITK_TEST_OUTPUT_DIR}/PythonMeanImageFilterFunctionCallTest.png + 3 + ) + + itk_python_add_test(NAME PythonMedianImageFilterTest + TEST_DRIVER_ARGS + --compare ${ITK_TEST_OUTPUT_DIR}/PythonMedianImageFilterTest.png + DATA{Baseline/PythonMedianImageFilterTest.png} + COMMAND MedianImageFilterTest.py + DATA{${ITK_DATA_ROOT}/Input/cthead1.png} + ${ITK_TEST_OUTPUT_DIR}/PythonMedianImageFilterTest.png + 3 + ) + if(ITK_WRAP_DOC) + itk_python_add_test(NAME PythonMedianImageFilterFunctionalDocumentationTest + COMMAND MedianImageFilterFunctionalDocumentationTest.py + ) + endif() + itk_python_add_test(NAME PythonAutoPipelineTest + TEST_DRIVER_ARGS + --compare ${ITK_TEST_OUTPUT_DIR}/PythonAutoPipelineTest.png + DATA{Baseline/PythonMedianImageFilterTest.png} + COMMAND PythonAutoPipelineTest.py + DATA{${ITK_DATA_ROOT}/Input/cthead1.png} + ${ITK_TEST_OUTPUT_DIR}/PythonAutoPipelineTest.png + 3 + ) +endif() diff --git a/Modules/Filtering/Smoothing/test/MeanImageFilterFunctionCallTest.py b/Modules/Filtering/Smoothing/wrapping/test/MeanImageFilterFunctionCallTest.py similarity index 100% rename from Modules/Filtering/Smoothing/test/MeanImageFilterFunctionCallTest.py rename to Modules/Filtering/Smoothing/wrapping/test/MeanImageFilterFunctionCallTest.py diff --git a/Modules/Filtering/Smoothing/test/MeanImageFilterTest.py b/Modules/Filtering/Smoothing/wrapping/test/MeanImageFilterTest.py similarity index 100% rename from Modules/Filtering/Smoothing/test/MeanImageFilterTest.py rename to Modules/Filtering/Smoothing/wrapping/test/MeanImageFilterTest.py diff --git a/Modules/Filtering/Smoothing/test/MedianImageFilterFunctionalDocumentationTest.py b/Modules/Filtering/Smoothing/wrapping/test/MedianImageFilterFunctionalDocumentationTest.py similarity index 100% rename from Modules/Filtering/Smoothing/test/MedianImageFilterFunctionalDocumentationTest.py rename to Modules/Filtering/Smoothing/wrapping/test/MedianImageFilterFunctionalDocumentationTest.py diff --git a/Modules/Filtering/Smoothing/test/MedianImageFilterTest.py b/Modules/Filtering/Smoothing/wrapping/test/MedianImageFilterTest.py similarity index 100% rename from Modules/Filtering/Smoothing/test/MedianImageFilterTest.py rename to Modules/Filtering/Smoothing/wrapping/test/MedianImageFilterTest.py diff --git a/Modules/Filtering/Smoothing/test/PythonAutoPipelineTest.py b/Modules/Filtering/Smoothing/wrapping/test/PythonAutoPipelineTest.py similarity index 100% rename from Modules/Filtering/Smoothing/test/PythonAutoPipelineTest.py rename to Modules/Filtering/Smoothing/wrapping/test/PythonAutoPipelineTest.py diff --git a/Modules/Filtering/Thresholding/test/CMakeLists.txt b/Modules/Filtering/Thresholding/test/CMakeLists.txt index 0514b07a897..de9c8c48a23 100644 --- a/Modules/Filtering/Thresholding/test/CMakeLists.txt +++ b/Modules/Filtering/Thresholding/test/CMakeLists.txt @@ -348,27 +348,3 @@ itk_add_test(NAME itkKappaSigmaThresholdImageFilterTest02 COMMAND ITKThresholdingTestDriver --compare DATA{Baseline/itkKappaSigmaThresholdImageFilterTest02.png} ${ITK_TEST_OUTPUT_DIR}/itkKappaSigmaThresholdImageFilterTest02.png itkKappaSigmaThresholdImageFilterTest DATA{${ITK_DATA_ROOT}/Input/CellsFluorescence2.png} ${ITK_TEST_OUTPUT_DIR}/itkKappaSigmaThresholdImageFilterTest02.png 2 3.0) - -# some tests will fail if dim=2 and unsigned short are not wrapped -list(FIND ITK_WRAP_IMAGE_DIMS 2 wrap_2_index) -if(ITK_WRAP_unsigned_char AND wrap_2_index GREATER -1) - itk_python_add_test(NAME PythonBinaryThresholdImageFilterTest - TEST_DRIVER_ARGS - --compare ${ITK_TEST_OUTPUT_DIR}/PythonBinaryThresholdImageFilterTest.png - DATA{Baseline/PythonBinaryThresholdImageFilterTest.png} - COMMAND BinaryThresholdImageFilterTest.py - DATA{${ITK_DATA_ROOT}/Input/cthead1.png} - ${ITK_TEST_OUTPUT_DIR}/PythonBinaryThresholdImageFilterTest.png - 50 150 - 0 255 - ) - itk_python_add_test(NAME PythonThresholdImageFilterTest - TEST_DRIVER_ARGS - --compare ${ITK_TEST_OUTPUT_DIR}/PythonThresholdImageFilterTest.png - DATA{Baseline/PythonThresholdImageFilterTest.png} - COMMAND ThresholdImageFilterTest.py - DATA{${ITK_DATA_ROOT}/Input/cthead1.png} - ${ITK_TEST_OUTPUT_DIR}/PythonThresholdImageFilterTest.png - 150 150 - ) -endif() diff --git a/Modules/Filtering/Thresholding/test/Baseline/PythonBinaryThresholdImageFilterTest.png.md5 b/Modules/Filtering/Thresholding/wrapping/test/Baseline/PythonBinaryThresholdImageFilterTest.png.md5 similarity index 100% rename from Modules/Filtering/Thresholding/test/Baseline/PythonBinaryThresholdImageFilterTest.png.md5 rename to Modules/Filtering/Thresholding/wrapping/test/Baseline/PythonBinaryThresholdImageFilterTest.png.md5 diff --git a/Modules/Filtering/Thresholding/test/Baseline/PythonBinaryThresholdImageFilterTest.png.sha512 b/Modules/Filtering/Thresholding/wrapping/test/Baseline/PythonBinaryThresholdImageFilterTest.png.sha512 similarity index 100% rename from Modules/Filtering/Thresholding/test/Baseline/PythonBinaryThresholdImageFilterTest.png.sha512 rename to Modules/Filtering/Thresholding/wrapping/test/Baseline/PythonBinaryThresholdImageFilterTest.png.sha512 diff --git a/Modules/Filtering/Thresholding/test/Baseline/PythonThresholdImageFilterTest.png.md5 b/Modules/Filtering/Thresholding/wrapping/test/Baseline/PythonThresholdImageFilterTest.png.md5 similarity index 100% rename from Modules/Filtering/Thresholding/test/Baseline/PythonThresholdImageFilterTest.png.md5 rename to Modules/Filtering/Thresholding/wrapping/test/Baseline/PythonThresholdImageFilterTest.png.md5 diff --git a/Modules/Filtering/Thresholding/test/Baseline/PythonThresholdImageFilterTest.png.sha512 b/Modules/Filtering/Thresholding/wrapping/test/Baseline/PythonThresholdImageFilterTest.png.sha512 similarity index 100% rename from Modules/Filtering/Thresholding/test/Baseline/PythonThresholdImageFilterTest.png.sha512 rename to Modules/Filtering/Thresholding/wrapping/test/Baseline/PythonThresholdImageFilterTest.png.sha512 diff --git a/Modules/Filtering/Thresholding/test/BinaryThresholdImageFilterTest.py b/Modules/Filtering/Thresholding/wrapping/test/BinaryThresholdImageFilterTest.py similarity index 100% rename from Modules/Filtering/Thresholding/test/BinaryThresholdImageFilterTest.py rename to Modules/Filtering/Thresholding/wrapping/test/BinaryThresholdImageFilterTest.py diff --git a/Modules/Filtering/Thresholding/wrapping/test/CMakeLists.txt b/Modules/Filtering/Thresholding/wrapping/test/CMakeLists.txt new file mode 100644 index 00000000000..eba4af25d1c --- /dev/null +++ b/Modules/Filtering/Thresholding/wrapping/test/CMakeLists.txt @@ -0,0 +1,23 @@ +# some tests will fail if dim=2 and unsigned short are not wrapped +list(FIND ITK_WRAP_IMAGE_DIMS 2 wrap_2_index) +if(ITK_WRAP_unsigned_char AND wrap_2_index GREATER -1) + itk_python_add_test(NAME PythonBinaryThresholdImageFilterTest + TEST_DRIVER_ARGS + --compare ${ITK_TEST_OUTPUT_DIR}/PythonBinaryThresholdImageFilterTest.png + DATA{Baseline/PythonBinaryThresholdImageFilterTest.png} + COMMAND BinaryThresholdImageFilterTest.py + DATA{${ITK_DATA_ROOT}/Input/cthead1.png} + ${ITK_TEST_OUTPUT_DIR}/PythonBinaryThresholdImageFilterTest.png + 50 150 + 0 255 + ) + itk_python_add_test(NAME PythonThresholdImageFilterTest + TEST_DRIVER_ARGS + --compare ${ITK_TEST_OUTPUT_DIR}/PythonThresholdImageFilterTest.png + DATA{Baseline/PythonThresholdImageFilterTest.png} + COMMAND ThresholdImageFilterTest.py + DATA{${ITK_DATA_ROOT}/Input/cthead1.png} + ${ITK_TEST_OUTPUT_DIR}/PythonThresholdImageFilterTest.png + 150 150 + ) +endif() diff --git a/Modules/Filtering/Thresholding/test/ThresholdImageFilterTest.py b/Modules/Filtering/Thresholding/wrapping/test/ThresholdImageFilterTest.py similarity index 100% rename from Modules/Filtering/Thresholding/test/ThresholdImageFilterTest.py rename to Modules/Filtering/Thresholding/wrapping/test/ThresholdImageFilterTest.py diff --git a/Modules/IO/GDCM/test/CMakeLists.txt b/Modules/IO/GDCM/test/CMakeLists.txt index b647db28013..312a9332684 100644 --- a/Modules/IO/GDCM/test/CMakeLists.txt +++ b/Modules/IO/GDCM/test/CMakeLists.txt @@ -157,11 +157,3 @@ itk_add_test(NAME itkGDCMLegacyMultiFrameTest DATA{Input/LegacyMultiFrame.dcm} ${ITK_TEST_OUTPUT_DIR}/itkGDCMLegacyMultiFrameTest.mha ) - -list(FIND ITK_WRAP_IMAGE_DIMS 2 wrap_2_index) -if(ITK_WRAP_float AND wrap_2_index GREATER -1) - itk_python_add_test(NAME PythonReadDicomAndReadTagTest - COMMAND ReadDicomAndReadTagTest.py - DATA{${ITK_DATA_ROOT}/Input/DicomSeries/,REGEX:Image[0-9]+.dcm} - ) -endif() diff --git a/Modules/IO/GDCM/wrapping/test/CMakeLists.txt b/Modules/IO/GDCM/wrapping/test/CMakeLists.txt new file mode 100644 index 00000000000..a678adede94 --- /dev/null +++ b/Modules/IO/GDCM/wrapping/test/CMakeLists.txt @@ -0,0 +1,7 @@ +list(FIND ITK_WRAP_IMAGE_DIMS 2 wrap_2_index) +if(ITK_WRAP_float AND wrap_2_index GREATER -1) + itk_python_add_test(NAME PythonReadDicomAndReadTagTest + COMMAND ReadDicomAndReadTagTest.py + DATA{${ITK_DATA_ROOT}/Input/DicomSeries/,REGEX:Image[0-9]+.dcm} + ) +endif() diff --git a/Modules/IO/GDCM/test/ReadDicomAndReadTagTest.py b/Modules/IO/GDCM/wrapping/test/ReadDicomAndReadTagTest.py similarity index 100% rename from Modules/IO/GDCM/test/ReadDicomAndReadTagTest.py rename to Modules/IO/GDCM/wrapping/test/ReadDicomAndReadTagTest.py diff --git a/Modules/IO/MeshGifti/test/CMakeLists.txt b/Modules/IO/MeshGifti/test/CMakeLists.txt index 610c9e1b0ca..b3ea0c57318 100644 --- a/Modules/IO/MeshGifti/test/CMakeLists.txt +++ b/Modules/IO/MeshGifti/test/CMakeLists.txt @@ -16,6 +16,3 @@ itk_add_test(NAME itkMeshFileReadWriteTestGifti2 DATA{Baseline/aparc.gii} ${ITK_TEST_OUTPUT_DIR}/aparc.gii ) - -itk_python_expression_add_test(NAME itkGiftiMeshIOPythonTest - EXPRESSION "io = itk.GiftiMeshIO.New()") diff --git a/Modules/IO/MeshGifti/wrapping/test/CMakeLists.txt b/Modules/IO/MeshGifti/wrapping/test/CMakeLists.txt new file mode 100644 index 00000000000..7d1648fa154 --- /dev/null +++ b/Modules/IO/MeshGifti/wrapping/test/CMakeLists.txt @@ -0,0 +1,2 @@ +itk_python_expression_add_test(NAME itkGiftiMeshIOPythonTest + EXPRESSION "io = itk.GiftiMeshIO.New()") diff --git a/Modules/IO/MeshOBJ/test/CMakeLists.txt b/Modules/IO/MeshOBJ/test/CMakeLists.txt index 55d558ba47a..6ee5bd4e072 100644 --- a/Modules/IO/MeshOBJ/test/CMakeLists.txt +++ b/Modules/IO/MeshOBJ/test/CMakeLists.txt @@ -11,6 +11,3 @@ itk_add_test(NAME itkMeshFileReadWriteOBJTest DATA{Baseline/box.obj} ${ITK_TEST_OUTPUT_DIR}/box.obj ) - -itk_python_expression_add_test(NAME itkOBJMeshIOPythonTest - EXPRESSION "io = itk.OBJMeshIO.New()") diff --git a/Modules/IO/MeshOBJ/wrapping/test/CMakeLists.txt b/Modules/IO/MeshOBJ/wrapping/test/CMakeLists.txt new file mode 100644 index 00000000000..432560b707c --- /dev/null +++ b/Modules/IO/MeshOBJ/wrapping/test/CMakeLists.txt @@ -0,0 +1,2 @@ +itk_python_expression_add_test(NAME itkOBJMeshIOPythonTest + EXPRESSION "io = itk.OBJMeshIO.New()") diff --git a/Modules/IO/MeshOFF/test/CMakeLists.txt b/Modules/IO/MeshOFF/test/CMakeLists.txt index aec256b8134..7980100cb00 100644 --- a/Modules/IO/MeshOFF/test/CMakeLists.txt +++ b/Modules/IO/MeshOFF/test/CMakeLists.txt @@ -11,6 +11,3 @@ itk_add_test(NAME itkMeshFileReadWriteOFFTest DATA{Baseline/octa.off} ${ITK_TEST_OUTPUT_DIR}/octa.off ) - -itk_python_expression_add_test(NAME itkOFFMeshIOPythonTest - EXPRESSION "io = itk.OFFMeshIO.New()") diff --git a/Modules/IO/MeshOFF/wrapping/test/CMakeLists.txt b/Modules/IO/MeshOFF/wrapping/test/CMakeLists.txt new file mode 100644 index 00000000000..c98930ee3f3 --- /dev/null +++ b/Modules/IO/MeshOFF/wrapping/test/CMakeLists.txt @@ -0,0 +1,2 @@ +itk_python_expression_add_test(NAME itkOFFMeshIOPythonTest + EXPRESSION "io = itk.OFFMeshIO.New()") diff --git a/Modules/Nonunit/IntegratedTest/wrapping/test/CMakeLists.txt b/Modules/Nonunit/IntegratedTest/wrapping/test/CMakeLists.txt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/Modules/Nonunit/IntegratedTest/test/itkCurvatureFlowTestPython2.py b/Modules/Nonunit/IntegratedTest/wrapping/test/itkCurvatureFlowTestPython2.py similarity index 100% rename from Modules/Nonunit/IntegratedTest/test/itkCurvatureFlowTestPython2.py rename to Modules/Nonunit/IntegratedTest/wrapping/test/itkCurvatureFlowTestPython2.py diff --git a/Modules/Numerics/Statistics/test/CMakeLists.txt b/Modules/Numerics/Statistics/test/CMakeLists.txt index 713a84c4471..25a59327c83 100644 --- a/Modules/Numerics/Statistics/test/CMakeLists.txt +++ b/Modules/Numerics/Statistics/test/CMakeLists.txt @@ -406,5 +406,3 @@ itk_add_test(NAME itkUniformRandomSpatialNeighborSubsamplerTest ${ITK_TEST_OUTPUT_DIR}/itkUniformRandomSubsamplingTest.mha) itk_add_test(NAME itkVectorContainerToListSampleAdaptorTest COMMAND ITKStatisticsTestDriver itkVectorContainerToListSampleAdaptorTest) -itk_python_expression_add_test(NAME itkNormalVariateGeneratorPythonTest -EXPRESSION "itkNormalVariateGenerator = itk.NormalVariateGenerator.New()") diff --git a/Modules/Numerics/Statistics/wrapping/test/CMakeLists.txt b/Modules/Numerics/Statistics/wrapping/test/CMakeLists.txt new file mode 100644 index 00000000000..1d80e9072a7 --- /dev/null +++ b/Modules/Numerics/Statistics/wrapping/test/CMakeLists.txt @@ -0,0 +1,2 @@ +itk_python_expression_add_test(NAME itkNormalVariateGeneratorPythonTest +EXPRESSION "itkNormalVariateGenerator = itk.NormalVariateGenerator.New()") diff --git a/Modules/Registration/Metricsv4/test/CMakeLists.txt b/Modules/Registration/Metricsv4/test/CMakeLists.txt index d7a13d9b6c5..8986f623e2c 100644 --- a/Modules/Registration/Metricsv4/test/CMakeLists.txt +++ b/Modules/Registration/Metricsv4/test/CMakeLists.txt @@ -268,10 +268,3 @@ itk_add_test(NAME itkMeanSquaresImageToImageMetricv4VectorRegistrationTest DATA{Input/apple.jpg} ${TEMP}/itkMeanSquaresImageToImageMetricv4VectorRegistrationTest.nii.gz 100 25 ) - -itk_python_expression_add_test(NAME itkDemonsImageToImageMetricv4PythonTest - EXPRESSION "instance = itk.DemonsImageToImageMetricv4.New()") -itk_python_expression_add_test(NAME itkCorrelationImageToImageMetricv4PythonTest - EXPRESSION "instance = itk.CorrelationImageToImageMetricv4.New()") -itk_python_expression_add_test(NAME itkJointHistogramMutualInformationImageToImageMetricv4PythonTest - EXPRESSION "instance = itk.JointHistogramMutualInformationImageToImageMetricv4.New()") diff --git a/Modules/Registration/Metricsv4/wrapping/test/CMakeLists.txt b/Modules/Registration/Metricsv4/wrapping/test/CMakeLists.txt new file mode 100644 index 00000000000..e4cceb21f9f --- /dev/null +++ b/Modules/Registration/Metricsv4/wrapping/test/CMakeLists.txt @@ -0,0 +1,6 @@ +itk_python_expression_add_test(NAME itkDemonsImageToImageMetricv4PythonTest + EXPRESSION "instance = itk.DemonsImageToImageMetricv4.New()") +itk_python_expression_add_test(NAME itkCorrelationImageToImageMetricv4PythonTest + EXPRESSION "instance = itk.CorrelationImageToImageMetricv4.New()") +itk_python_expression_add_test(NAME itkJointHistogramMutualInformationImageToImageMetricv4PythonTest + EXPRESSION "instance = itk.JointHistogramMutualInformationImageToImageMetricv4.New()") diff --git a/Modules/Segmentation/LevelSets/test/CMakeLists.txt b/Modules/Segmentation/LevelSets/test/CMakeLists.txt index a3a83ebb49f..28ada0042c3 100644 --- a/Modules/Segmentation/LevelSets/test/CMakeLists.txt +++ b/Modules/Segmentation/LevelSets/test/CMakeLists.txt @@ -98,54 +98,3 @@ itk_add_test(NAME itkCurvesLevelSetImageFilterZeroSigmaTest COMMAND ITKLevelSetsTestDriver itkCurvesLevelSetImageFilterZeroSigmaTest) itk_add_test(NAME itkBinaryMaskToNarrowBandPointSetFilterTest COMMAND ITKLevelSetsTestDriver itkBinaryMaskToNarrowBandPointSetFilterTest) - -itk_python_add_test(NAME PythonLazyLoadingImage COMMAND LazyLoadingImageTest.py) - -list(FIND ITK_WRAP_IMAGE_DIMS 2 wrap_2_index) -if(ITK_WRAP_float AND wrap_2_index GREATER -1) -# TODO: reenable the geodesic test once we get why the result is not the -# same than with c++ -# keep just one to be sure it run, but don't compare the images - - itk_python_add_test(NAME PythonGeodesicActiveContourLeftVentricleTest -# --compare GeodesicActiveContourLeftVentricleTest.png -# DATA{${WrapITK_SOURCE_DIR}/images/GeodesicActiveContourLeftVentricleTest.png} - COMMAND GeodesicActiveContourImageFilterTest.py - DATA{Input/BrainProtonDensitySlice.png} - ${ITK_TEST_OUTPUT_DIR}/GeodesicActiveContourLeftVentricleTest.png - 81 114 5.0 1.0 -0.5 3.0 2.0 - ) - - itk_python_add_test(NAME PythonThresholdSegmentationLevelSetVentricleTest - TEST_DRIVER_ARGS - --compare ${ITK_TEST_OUTPUT_DIR}/PythonThresholdSegmentationLevelSetVentricleTest.png - DATA{PythonThresholdSegmentationLevelSetVentricleTest.png} - COMMAND ThresholdSegmentationLevelSetImageFilterTest.py - DATA{Input/BrainProtonDensitySlice.png} - ${ITK_TEST_OUTPUT_DIR}/PythonThresholdSegmentationLevelSetVentricleTest.png - 81 112 5 210 250 - ) - - itk_python_add_test(NAME PythonThresholdSegmentationLevelSetWhiteMatterTest - TEST_DRIVER_ARGS - --compare ${ITK_TEST_OUTPUT_DIR}/ThresholdSegmentationLevelSetWhiteMatterTest.png - DATA{PythonThresholdSegmentationLevelSetWhiteMatterTest.png} - COMMAND ThresholdSegmentationLevelSetImageFilterTest.py - DATA{Input/BrainProtonDensitySlice.png} - ${ITK_TEST_OUTPUT_DIR}/ThresholdSegmentationLevelSetWhiteMatterTest.png - 60 116 5 150 180 - ) - - itk_python_add_test(NAME PythonThresholdSegmentationLevelSetGrayMatterTest - TEST_DRIVERS_ARGS - --compare ${ITK_TEST_OUTPUT_DIR}/PythonThresholdSegmentationLevelSetGrayMatterTest.png - DATA{Baseline/PythonThresholdSegmentationLevelSetGrayMatterTest.png} - COMMAND ThresholdSegmentationLevelSetImageFilterTest.py - DATA{Input/BrainProtonDensitySlice.png} - ${ITK_TEST_OUTPUT_DIR}/PythonThresholdSegmentationLevelSetGrayMatterTest.png - 107 69 5 180 210 - ) - - itk_python_expression_add_test(NAME itkBinaryMaskToNarrowBandPointSetFilterPythonTest - EXPRESSION "filt = itk.BinaryMaskToNarrowBandPointSetFilter.New()") -endif() diff --git a/Modules/Segmentation/LevelSets/wrapping/test/CMakeLists.txt b/Modules/Segmentation/LevelSets/wrapping/test/CMakeLists.txt new file mode 100644 index 00000000000..38dfe586171 --- /dev/null +++ b/Modules/Segmentation/LevelSets/wrapping/test/CMakeLists.txt @@ -0,0 +1,52 @@ +set(test_input_dir ${itk-module_SOURCE_DIR}/test/Input) + +itk_python_add_test(NAME PythonLazyLoadingImage COMMAND LazyLoadingImageTest.py) + +list(FIND ITK_WRAP_IMAGE_DIMS 2 wrap_2_index) +if(ITK_WRAP_float AND wrap_2_index GREATER -1) +# TODO: reenable the geodesic test once we get why the result is not the +# same than with c++ +# keep just one to be sure it run, but don't compare the images + + itk_python_add_test(NAME PythonGeodesicActiveContourLeftVentricleTest +# --compare GeodesicActiveContourLeftVentricleTest.png +# DATA{${WrapITK_SOURCE_DIR}/images/GeodesicActiveContourLeftVentricleTest.png} + COMMAND GeodesicActiveContourImageFilterTest.py + DATA{${test_input_dir}/BrainProtonDensitySlice.png} + ${ITK_TEST_OUTPUT_DIR}/GeodesicActiveContourLeftVentricleTest.png + 81 114 5.0 1.0 -0.5 3.0 2.0 + ) + + itk_python_add_test(NAME PythonThresholdSegmentationLevelSetVentricleTest + TEST_DRIVER_ARGS + --compare ${ITK_TEST_OUTPUT_DIR}/PythonThresholdSegmentationLevelSetVentricleTest.png + DATA{PythonThresholdSegmentationLevelSetVentricleTest.png} + COMMAND ThresholdSegmentationLevelSetImageFilterTest.py + DATA{${test_input_dir}/BrainProtonDensitySlice.png} + ${ITK_TEST_OUTPUT_DIR}/PythonThresholdSegmentationLevelSetVentricleTest.png + 81 112 5 210 250 + ) + + itk_python_add_test(NAME PythonThresholdSegmentationLevelSetWhiteMatterTest + TEST_DRIVER_ARGS + --compare ${ITK_TEST_OUTPUT_DIR}/ThresholdSegmentationLevelSetWhiteMatterTest.png + DATA{PythonThresholdSegmentationLevelSetWhiteMatterTest.png} + COMMAND ThresholdSegmentationLevelSetImageFilterTest.py + DATA{${test_input_dir}/BrainProtonDensitySlice.png} + ${ITK_TEST_OUTPUT_DIR}/ThresholdSegmentationLevelSetWhiteMatterTest.png + 60 116 5 150 180 + ) + + itk_python_add_test(NAME PythonThresholdSegmentationLevelSetGrayMatterTest + TEST_DRIVERS_ARGS + --compare ${ITK_TEST_OUTPUT_DIR}/PythonThresholdSegmentationLevelSetGrayMatterTest.png + DATA{Baseline/PythonThresholdSegmentationLevelSetGrayMatterTest.png} + COMMAND ThresholdSegmentationLevelSetImageFilterTest.py + DATA{${WrapITK_SOURCE_DIR}/images/BrainProtonDensitySlice.png} + ${ITK_TEST_OUTPUT_DIR}/PythonThresholdSegmentationLevelSetGrayMatterTest.png + 107 69 5 180 210 + ) + + itk_python_expression_add_test(NAME itkBinaryMaskToNarrowBandPointSetFilterPythonTest + EXPRESSION "filt = itk.BinaryMaskToNarrowBandPointSetFilter.New()") +endif() diff --git a/Modules/Segmentation/LevelSets/test/GeodesicActiveContourImageFilterTest.py b/Modules/Segmentation/LevelSets/wrapping/test/GeodesicActiveContourImageFilterTest.py similarity index 100% rename from Modules/Segmentation/LevelSets/test/GeodesicActiveContourImageFilterTest.py rename to Modules/Segmentation/LevelSets/wrapping/test/GeodesicActiveContourImageFilterTest.py diff --git a/Modules/Segmentation/LevelSets/test/LazyLoadingImageTest.py b/Modules/Segmentation/LevelSets/wrapping/test/LazyLoadingImageTest.py similarity index 100% rename from Modules/Segmentation/LevelSets/test/LazyLoadingImageTest.py rename to Modules/Segmentation/LevelSets/wrapping/test/LazyLoadingImageTest.py diff --git a/Modules/Segmentation/LevelSets/test/PythonThresholdSegmentationLevelSetGrayMatterTest.png.md5 b/Modules/Segmentation/LevelSets/wrapping/test/PythonThresholdSegmentationLevelSetGrayMatterTest.png.md5 similarity index 100% rename from Modules/Segmentation/LevelSets/test/PythonThresholdSegmentationLevelSetGrayMatterTest.png.md5 rename to Modules/Segmentation/LevelSets/wrapping/test/PythonThresholdSegmentationLevelSetGrayMatterTest.png.md5 diff --git a/Modules/Segmentation/LevelSets/test/PythonThresholdSegmentationLevelSetGrayMatterTest.png.sha512 b/Modules/Segmentation/LevelSets/wrapping/test/PythonThresholdSegmentationLevelSetGrayMatterTest.png.sha512 similarity index 100% rename from Modules/Segmentation/LevelSets/test/PythonThresholdSegmentationLevelSetGrayMatterTest.png.sha512 rename to Modules/Segmentation/LevelSets/wrapping/test/PythonThresholdSegmentationLevelSetGrayMatterTest.png.sha512 diff --git a/Modules/Segmentation/LevelSets/test/PythonThresholdSegmentationLevelSetVentricleTest.png.md5 b/Modules/Segmentation/LevelSets/wrapping/test/PythonThresholdSegmentationLevelSetVentricleTest.png.md5 similarity index 100% rename from Modules/Segmentation/LevelSets/test/PythonThresholdSegmentationLevelSetVentricleTest.png.md5 rename to Modules/Segmentation/LevelSets/wrapping/test/PythonThresholdSegmentationLevelSetVentricleTest.png.md5 diff --git a/Modules/Segmentation/LevelSets/test/PythonThresholdSegmentationLevelSetVentricleTest.png.sha512 b/Modules/Segmentation/LevelSets/wrapping/test/PythonThresholdSegmentationLevelSetVentricleTest.png.sha512 similarity index 100% rename from Modules/Segmentation/LevelSets/test/PythonThresholdSegmentationLevelSetVentricleTest.png.sha512 rename to Modules/Segmentation/LevelSets/wrapping/test/PythonThresholdSegmentationLevelSetVentricleTest.png.sha512 diff --git a/Modules/Segmentation/LevelSets/test/PythonThresholdSegmentationLevelSetWhiteMatterTest.png.md5 b/Modules/Segmentation/LevelSets/wrapping/test/PythonThresholdSegmentationLevelSetWhiteMatterTest.png.md5 similarity index 100% rename from Modules/Segmentation/LevelSets/test/PythonThresholdSegmentationLevelSetWhiteMatterTest.png.md5 rename to Modules/Segmentation/LevelSets/wrapping/test/PythonThresholdSegmentationLevelSetWhiteMatterTest.png.md5 diff --git a/Modules/Segmentation/LevelSets/test/PythonThresholdSegmentationLevelSetWhiteMatterTest.png.sha512 b/Modules/Segmentation/LevelSets/wrapping/test/PythonThresholdSegmentationLevelSetWhiteMatterTest.png.sha512 similarity index 100% rename from Modules/Segmentation/LevelSets/test/PythonThresholdSegmentationLevelSetWhiteMatterTest.png.sha512 rename to Modules/Segmentation/LevelSets/wrapping/test/PythonThresholdSegmentationLevelSetWhiteMatterTest.png.sha512 diff --git a/Modules/Segmentation/LevelSets/test/ThresholdSegmentationLevelSetImageFilterTest.py b/Modules/Segmentation/LevelSets/wrapping/test/ThresholdSegmentationLevelSetImageFilterTest.py similarity index 100% rename from Modules/Segmentation/LevelSets/test/ThresholdSegmentationLevelSetImageFilterTest.py rename to Modules/Segmentation/LevelSets/wrapping/test/ThresholdSegmentationLevelSetImageFilterTest.py diff --git a/Modules/Segmentation/SignedDistanceFunction/test/CMakeLists.txt b/Modules/Segmentation/SignedDistanceFunction/test/CMakeLists.txt index 8aaa0cec638..4af67fa8c85 100644 --- a/Modules/Segmentation/SignedDistanceFunction/test/CMakeLists.txt +++ b/Modules/Segmentation/SignedDistanceFunction/test/CMakeLists.txt @@ -6,8 +6,6 @@ itkPCAShapeSignedDistanceFunctionTest.cxx CreateTestDriver(ITKSignedDistanceFunction "${ITKSignedDistanceFunction-Test_LIBRARIES}" "${ITKSignedDistanceFunctionTests}") -itk_python_expression_add_test(NAME itkPCAShapeSignedDistanceFunctionPythonTest EXPRESSION "itkPCAShapeSignedDistanceFunction = itk.PCAShapeSignedDistanceFunction.New()") - itk_add_test(NAME itkSphereSignedDistanceFunctionTest COMMAND ITKSignedDistanceFunctionTestDriver itkSphereSignedDistanceFunctionTest) itk_add_test(NAME itkPCAShapeSignedDistanceFunctionTest diff --git a/Modules/Segmentation/SignedDistanceFunction/wrapping/test/CMakeLists.txt b/Modules/Segmentation/SignedDistanceFunction/wrapping/test/CMakeLists.txt new file mode 100644 index 00000000000..fab32abfbf8 --- /dev/null +++ b/Modules/Segmentation/SignedDistanceFunction/wrapping/test/CMakeLists.txt @@ -0,0 +1 @@ +itk_python_expression_add_test(NAME itkPCAShapeSignedDistanceFunctionPythonTest EXPRESSION "itkPCAShapeSignedDistanceFunction = itk.PCAShapeSignedDistanceFunction.New()") diff --git a/Modules/Segmentation/Watersheds/test/CMakeLists.txt b/Modules/Segmentation/Watersheds/test/CMakeLists.txt index 003934f2f42..204234009a8 100644 --- a/Modules/Segmentation/Watersheds/test/CMakeLists.txt +++ b/Modules/Segmentation/Watersheds/test/CMakeLists.txt @@ -158,15 +158,3 @@ itk_add_test(NAME itkMorphologicalWatershedImageFilterTestLevel50 --compare DATA{Baseline/itkMorphologicalWatershedImageFilterTestLevel50.png} ${ITK_TEST_OUTPUT_DIR}/itkMorphologicalWatershedImageFilterTestLevel50.png itkMorphologicalWatershedImageFilterTest DATA{${ITK_DATA_ROOT}/Input/level.png} ${ITK_TEST_OUTPUT_DIR}/itkMorphologicalWatershedImageFilterTestLevel50.png 1 0 50) - -list(FIND ITK_WRAP_IMAGE_DIMS 2 wrap_2_index) -if(ITK_WRAP_float AND wrap_2_index GREATER -1) - itk_python_add_test(NAME PythonWatershedSegmentation1Test - TEST_DRIVER_ARGS - --compare ${ITK_TEST_OUTPUT_DIR}/PythonWatershedSegmentation1Test.png - DATA{Baseline/PythonWatershedSegmentation1Test.png} - COMMAND WatershedSegmentation1Test.py - DATA{Input/VisibleWomanEyeSlice.png} - ${ITK_TEST_OUTPUT_DIR}/PythonWatershedSegmentation1Test.png - ) -endif() diff --git a/Modules/Segmentation/Watersheds/wrapping/test/CMakeLists.txt b/Modules/Segmentation/Watersheds/wrapping/test/CMakeLists.txt new file mode 100644 index 00000000000..5c7b9206d43 --- /dev/null +++ b/Modules/Segmentation/Watersheds/wrapping/test/CMakeLists.txt @@ -0,0 +1,14 @@ +set(test_input_dir ${itk-module_SOURCE_DIR}/test/Input) +set(test_baseline_dir ${itk-module_SOURCE_DIR}/test/Baseline) + +list(FIND ITK_WRAP_IMAGE_DIMS 2 wrap_2_index) +if(ITK_WRAP_float AND wrap_2_index GREATER -1) + itk_python_add_test(NAME PythonWatershedSegmentation1Test + TEST_DRIVER_ARGS + --compare ${ITK_TEST_OUTPUT_DIR}/PythonWatershedSegmentation1Test.png + DATA{${test_baseline_dir}/PythonWatershedSegmentation1Test.png} + COMMAND WatershedSegmentation1Test.py + DATA{${test_input_dir}/VisibleWomanEyeSlice.png} + ${ITK_TEST_OUTPUT_DIR}/PythonWatershedSegmentation1Test.png + ) +endif() diff --git a/Modules/Segmentation/Watersheds/test/WatershedSegmentation1Test.py b/Modules/Segmentation/Watersheds/wrapping/test/WatershedSegmentation1Test.py similarity index 100% rename from Modules/Segmentation/Watersheds/test/WatershedSegmentation1Test.py rename to Modules/Segmentation/Watersheds/wrapping/test/WatershedSegmentation1Test.py diff --git a/Testing/ContinuousIntegration/AzurePipelinesLinuxPython.yml b/Testing/ContinuousIntegration/AzurePipelinesLinuxPython.yml index 9622f52b1db..6888909bdac 100644 --- a/Testing/ContinuousIntegration/AzurePipelinesLinuxPython.yml +++ b/Testing/ContinuousIntegration/AzurePipelinesLinuxPython.yml @@ -48,6 +48,7 @@ jobs: set(CTEST_CMAKE_GENERATOR "Ninja") set(BUILD_NAME_SUFFIX "-Python") set(dashboard_cache " + DISABLE_MODULE_TESTS:BOOL=ON BUILD_SHARED_LIBS:BOOL=OFF BUILD_EXAMPLES:BOOL=OFF ITK_WRAP_PYTHON:BOOL=ON diff --git a/Testing/ContinuousIntegration/AzurePipelinesMacOSPython.yml b/Testing/ContinuousIntegration/AzurePipelinesMacOSPython.yml index 796e0335d5e..d54afaceda7 100644 --- a/Testing/ContinuousIntegration/AzurePipelinesMacOSPython.yml +++ b/Testing/ContinuousIntegration/AzurePipelinesMacOSPython.yml @@ -46,6 +46,7 @@ jobs: set(CTEST_CMAKE_GENERATOR "Ninja") set(BUILD_NAME_SUFFIX "-Python") set(dashboard_cache " + DISABLE_MODULE_TESTS:BOOL=ON BUILD_SHARED_LIBS:BOOL=OFF BUILD_EXAMPLES:BOOL=OFF ITK_WRAP_PYTHON:BOOL=ON diff --git a/Testing/ContinuousIntegration/AzurePipelinesWindowsPython.yml b/Testing/ContinuousIntegration/AzurePipelinesWindowsPython.yml index a498d60062e..834cccf902a 100644 --- a/Testing/ContinuousIntegration/AzurePipelinesWindowsPython.yml +++ b/Testing/ContinuousIntegration/AzurePipelinesWindowsPython.yml @@ -43,6 +43,7 @@ jobs: set(ENV{CC} cl.exe) set(ENV{CXX} cl.exe) set(dashboard_cache " + DISABLE_MODULE_TESTS:BOOL=ON BUILD_SHARED_LIBS:BOOL=ON BUILD_EXAMPLES:BOOL=OFF ITK_WRAP_PYTHON:BOOL=ON diff --git a/Wrapping/Generators/Python/CMakeLists.txt b/Wrapping/Generators/Python/CMakeLists.txt index c022b69653f..7fc64fcb0d0 100644 --- a/Wrapping/Generators/Python/CMakeLists.txt +++ b/Wrapping/Generators/Python/CMakeLists.txt @@ -346,7 +346,6 @@ endmacro() macro(itk_end_wrap_module_python) - # Loop over the extra swig input files and add them to the generated files # lists. Guess that the generated cxx output will have the same name as # the .i input file. @@ -542,7 +541,6 @@ ${DO_NOT_WAIT_FOR_THREADS_DECLS} endforeach() endif() endif() - endmacro() diff --git a/Wrapping/Modules/CMakeLists.txt b/Wrapping/Modules/CMakeLists.txt index 9c4effdc505..c022b38e9ec 100644 --- a/Wrapping/Modules/CMakeLists.txt +++ b/Wrapping/Modules/CMakeLists.txt @@ -5,7 +5,9 @@ if(ITK_SOURCE_DIR) foreach(m ${ITK_CONFIG_MODULES_ENABLED}) if(EXISTS "${${m}_SOURCE_DIR}/wrapping/CMakeLists.txt") list(APPEND WRAP_ITK_MODULES ${m}) + set(itk-module_SOURCE_DIR ${${m}_SOURCE_DIR}) add_subdirectory("${${m}_SOURCE_DIR}/wrapping" ${CMAKE_CURRENT_BINARY_DIR}/${m}) + unset(itk-module_SOURCE_DIR) endif() endforeach() else() # Building a module externally diff --git a/Wrapping/TypedefMacros.cmake b/Wrapping/TypedefMacros.cmake index 1f09063d23f..e6f8d0bf32e 100644 --- a/Wrapping/TypedefMacros.cmake +++ b/Wrapping/TypedefMacros.cmake @@ -121,6 +121,11 @@ macro(itk_end_wrap_module) endif() itk_end_wrap_module_all_generators() + # Add testing + set(wrapping_test_directory ${CMAKE_CURRENT_SOURCE_DIR}/test) + if(BUILD_TESTING AND EXISTS ${wrapping_test_directory}/CMakeLists.txt) + add_subdirectory(${wrapping_test_directory}) + endif() endmacro() From fa05cc84d27c11ae5678d2076891250ffae58ae7 Mon Sep 17 00:00:00 2001 From: Francois Budin Date: Mon, 8 Apr 2019 11:34:47 -0400 Subject: [PATCH 2/3] BUG: Correct CMake variable name and move baseline files to appropriate folder CMake variable was incorrectly named and therefore not used. The name is now correct. Baseline files were store in test folder instead of being propertly organized in a 'Baseline' subfolder. --- ...ythonThresholdSegmentationLevelSetGrayMatterTest.png.md5 | 0 ...onThresholdSegmentationLevelSetGrayMatterTest.png.sha512 | 0 ...PythonThresholdSegmentationLevelSetVentricleTest.png.md5 | 0 ...honThresholdSegmentationLevelSetVentricleTest.png.sha512 | 0 ...thonThresholdSegmentationLevelSetWhiteMatterTest.png.md5 | 0 ...nThresholdSegmentationLevelSetWhiteMatterTest.png.sha512 | 0 Modules/Segmentation/LevelSets/wrapping/test/CMakeLists.txt | 6 +++--- 7 files changed, 3 insertions(+), 3 deletions(-) rename Modules/Segmentation/LevelSets/wrapping/test/{ => Baseline}/PythonThresholdSegmentationLevelSetGrayMatterTest.png.md5 (100%) rename Modules/Segmentation/LevelSets/wrapping/test/{ => Baseline}/PythonThresholdSegmentationLevelSetGrayMatterTest.png.sha512 (100%) rename Modules/Segmentation/LevelSets/wrapping/test/{ => Baseline}/PythonThresholdSegmentationLevelSetVentricleTest.png.md5 (100%) rename Modules/Segmentation/LevelSets/wrapping/test/{ => Baseline}/PythonThresholdSegmentationLevelSetVentricleTest.png.sha512 (100%) rename Modules/Segmentation/LevelSets/wrapping/test/{ => Baseline}/PythonThresholdSegmentationLevelSetWhiteMatterTest.png.md5 (100%) rename Modules/Segmentation/LevelSets/wrapping/test/{ => Baseline}/PythonThresholdSegmentationLevelSetWhiteMatterTest.png.sha512 (100%) diff --git a/Modules/Segmentation/LevelSets/wrapping/test/PythonThresholdSegmentationLevelSetGrayMatterTest.png.md5 b/Modules/Segmentation/LevelSets/wrapping/test/Baseline/PythonThresholdSegmentationLevelSetGrayMatterTest.png.md5 similarity index 100% rename from Modules/Segmentation/LevelSets/wrapping/test/PythonThresholdSegmentationLevelSetGrayMatterTest.png.md5 rename to Modules/Segmentation/LevelSets/wrapping/test/Baseline/PythonThresholdSegmentationLevelSetGrayMatterTest.png.md5 diff --git a/Modules/Segmentation/LevelSets/wrapping/test/PythonThresholdSegmentationLevelSetGrayMatterTest.png.sha512 b/Modules/Segmentation/LevelSets/wrapping/test/Baseline/PythonThresholdSegmentationLevelSetGrayMatterTest.png.sha512 similarity index 100% rename from Modules/Segmentation/LevelSets/wrapping/test/PythonThresholdSegmentationLevelSetGrayMatterTest.png.sha512 rename to Modules/Segmentation/LevelSets/wrapping/test/Baseline/PythonThresholdSegmentationLevelSetGrayMatterTest.png.sha512 diff --git a/Modules/Segmentation/LevelSets/wrapping/test/PythonThresholdSegmentationLevelSetVentricleTest.png.md5 b/Modules/Segmentation/LevelSets/wrapping/test/Baseline/PythonThresholdSegmentationLevelSetVentricleTest.png.md5 similarity index 100% rename from Modules/Segmentation/LevelSets/wrapping/test/PythonThresholdSegmentationLevelSetVentricleTest.png.md5 rename to Modules/Segmentation/LevelSets/wrapping/test/Baseline/PythonThresholdSegmentationLevelSetVentricleTest.png.md5 diff --git a/Modules/Segmentation/LevelSets/wrapping/test/PythonThresholdSegmentationLevelSetVentricleTest.png.sha512 b/Modules/Segmentation/LevelSets/wrapping/test/Baseline/PythonThresholdSegmentationLevelSetVentricleTest.png.sha512 similarity index 100% rename from Modules/Segmentation/LevelSets/wrapping/test/PythonThresholdSegmentationLevelSetVentricleTest.png.sha512 rename to Modules/Segmentation/LevelSets/wrapping/test/Baseline/PythonThresholdSegmentationLevelSetVentricleTest.png.sha512 diff --git a/Modules/Segmentation/LevelSets/wrapping/test/PythonThresholdSegmentationLevelSetWhiteMatterTest.png.md5 b/Modules/Segmentation/LevelSets/wrapping/test/Baseline/PythonThresholdSegmentationLevelSetWhiteMatterTest.png.md5 similarity index 100% rename from Modules/Segmentation/LevelSets/wrapping/test/PythonThresholdSegmentationLevelSetWhiteMatterTest.png.md5 rename to Modules/Segmentation/LevelSets/wrapping/test/Baseline/PythonThresholdSegmentationLevelSetWhiteMatterTest.png.md5 diff --git a/Modules/Segmentation/LevelSets/wrapping/test/PythonThresholdSegmentationLevelSetWhiteMatterTest.png.sha512 b/Modules/Segmentation/LevelSets/wrapping/test/Baseline/PythonThresholdSegmentationLevelSetWhiteMatterTest.png.sha512 similarity index 100% rename from Modules/Segmentation/LevelSets/wrapping/test/PythonThresholdSegmentationLevelSetWhiteMatterTest.png.sha512 rename to Modules/Segmentation/LevelSets/wrapping/test/Baseline/PythonThresholdSegmentationLevelSetWhiteMatterTest.png.sha512 diff --git a/Modules/Segmentation/LevelSets/wrapping/test/CMakeLists.txt b/Modules/Segmentation/LevelSets/wrapping/test/CMakeLists.txt index 38dfe586171..14176982ffd 100644 --- a/Modules/Segmentation/LevelSets/wrapping/test/CMakeLists.txt +++ b/Modules/Segmentation/LevelSets/wrapping/test/CMakeLists.txt @@ -20,7 +20,7 @@ if(ITK_WRAP_float AND wrap_2_index GREATER -1) itk_python_add_test(NAME PythonThresholdSegmentationLevelSetVentricleTest TEST_DRIVER_ARGS --compare ${ITK_TEST_OUTPUT_DIR}/PythonThresholdSegmentationLevelSetVentricleTest.png - DATA{PythonThresholdSegmentationLevelSetVentricleTest.png} + DATA{Baseline/PythonThresholdSegmentationLevelSetVentricleTest.png} COMMAND ThresholdSegmentationLevelSetImageFilterTest.py DATA{${test_input_dir}/BrainProtonDensitySlice.png} ${ITK_TEST_OUTPUT_DIR}/PythonThresholdSegmentationLevelSetVentricleTest.png @@ -30,7 +30,7 @@ if(ITK_WRAP_float AND wrap_2_index GREATER -1) itk_python_add_test(NAME PythonThresholdSegmentationLevelSetWhiteMatterTest TEST_DRIVER_ARGS --compare ${ITK_TEST_OUTPUT_DIR}/ThresholdSegmentationLevelSetWhiteMatterTest.png - DATA{PythonThresholdSegmentationLevelSetWhiteMatterTest.png} + DATA{Baseline/PythonThresholdSegmentationLevelSetWhiteMatterTest.png} COMMAND ThresholdSegmentationLevelSetImageFilterTest.py DATA{${test_input_dir}/BrainProtonDensitySlice.png} ${ITK_TEST_OUTPUT_DIR}/ThresholdSegmentationLevelSetWhiteMatterTest.png @@ -38,7 +38,7 @@ if(ITK_WRAP_float AND wrap_2_index GREATER -1) ) itk_python_add_test(NAME PythonThresholdSegmentationLevelSetGrayMatterTest - TEST_DRIVERS_ARGS + TEST_DRIVER_ARGS --compare ${ITK_TEST_OUTPUT_DIR}/PythonThresholdSegmentationLevelSetGrayMatterTest.png DATA{Baseline/PythonThresholdSegmentationLevelSetGrayMatterTest.png} COMMAND ThresholdSegmentationLevelSetImageFilterTest.py From 5498f78c1c82d32148b7174733266acd3d1dd613 Mon Sep 17 00:00:00 2001 From: Francois Budin Date: Tue, 9 Apr 2019 15:51:56 -0400 Subject: [PATCH 3/3] ENH: Only run Python tests on Linux and Windows Filtering tests that are run by label on Linux and Windows to save a little bit of time. Do not worry about MacOS where there is no timing out issue on CI infrastructure. --- Testing/ContinuousIntegration/AzurePipelinesLinuxPython.yml | 2 +- Testing/ContinuousIntegration/AzurePipelinesWindowsPython.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Testing/ContinuousIntegration/AzurePipelinesLinuxPython.yml b/Testing/ContinuousIntegration/AzurePipelinesLinuxPython.yml index 6888909bdac..180bf8f00be 100644 --- a/Testing/ContinuousIntegration/AzurePipelinesLinuxPython.yml +++ b/Testing/ContinuousIntegration/AzurePipelinesLinuxPython.yml @@ -65,7 +65,7 @@ jobs: c++ --version cmake --version - ctest -S $(Agent.BuildDirectory)/ITK-dashboard/dashboard.cmake -VV -j 4 + ctest -S $(Agent.BuildDirectory)/ITK-dashboard/dashboard.cmake -VV -j 4 -L Python displayName: 'Build and test' env: CTEST_OUTPUT_ON_FAILURE: 1 diff --git a/Testing/ContinuousIntegration/AzurePipelinesWindowsPython.yml b/Testing/ContinuousIntegration/AzurePipelinesWindowsPython.yml index 834cccf902a..ba77b03ed53 100644 --- a/Testing/ContinuousIntegration/AzurePipelinesWindowsPython.yml +++ b/Testing/ContinuousIntegration/AzurePipelinesWindowsPython.yml @@ -59,7 +59,7 @@ jobs: - script: | cmake --version call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvars64.bat" - ctest -S $(Agent.BuildDirectory)/ITK-dashboard/dashboard.cmake -VV -j 4 + ctest -S $(Agent.BuildDirectory)/ITK-dashboard/dashboard.cmake -VV -j 4 -L Python displayName: 'Build and test' env: CTEST_OUTPUT_ON_FAILURE: 1