diff --git a/Modules/ImageStatistics/Testing/CMakeLists.txt b/Modules/ImageStatistics/Testing/CMakeLists.txt index 261390e904..049363d78f 100644 --- a/Modules/ImageStatistics/Testing/CMakeLists.txt +++ b/Modules/ImageStatistics/Testing/CMakeLists.txt @@ -1,22 +1,34 @@ MITK_CREATE_MODULE_TESTS() mitkAddCustomModuleTest(mitkRoiMeasurementsTests mitkRoiMeasurementsTest ${MITK_DATA_DIR}/ImageStatisticsTestData/) file(GLOB allHotSpotTests RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/Data" "${CMAKE_CURRENT_SOURCE_DIR}/Data/Hotspot_Case*.xml") foreach(testcase ${allHotSpotTests}) string(REGEX REPLACE "[^a-zA-Z0-9_]" "_" testcaseName ${testcase}) mitkAddCustomModuleTest(mitkImageStatisticsHotspotTest_${testcaseName} mitkImageStatisticsHotspotTest ${CMAKE_CURRENT_SOURCE_DIR}/Data/${testcase}) endforeach() # # The following lines may be activated to generate new test cases for mitkImageStatisticsHotspotTest. # Test cases are generated by mitkMultiGaussianTest. All .xml files in Data/TestGeneration/Input will # be processed and transformed into new .xml files containing statistics in Data/TestGeneration/Output. # -file(GLOB testcasesToGenerate RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/Data/TestGeneration/Input/" "${CMAKE_CURRENT_SOURCE_DIR}/Data/TestGeneration/Input/*.xml") -foreach(testinput ${testcasesToGenerate}) - string(REGEX REPLACE "[^a-zA-Z0-9_]" "_" testcaseName ${testinput}) - string(REGEX REPLACE "\\.xml" "" testoutput ${testinput}) - message("Generate hotspot test case '${testinput}'. Output in '${testoutput}.xml' and '${testoutput}.nrrd'") - mitkAddCustomModuleTest(mitkMultiGaussianTest_${testcaseName} mitkMultiGaussianTest ${CMAKE_CURRENT_SOURCE_DIR}/Data/TestGeneration/Output/${testoutput} ${CMAKE_CURRENT_SOURCE_DIR}/Data/TestGeneration/Input/${testinput}) -endforeach() +if (false) + set(testInputDir ${CMAKE_CURRENT_SOURCE_DIR}/Data/TestGeneration/Input) + set(testOutputDir ${CMAKE_CURRENT_SOURCE_DIR}/Data/TestGeneration/Output) + file(GLOB testcasesToGenerate RELATIVE "${testInputDir}" "${testInputDir}/*.xml") + + if (NOT EXISTS ${testOutputDir}) + file(MAKE_DIRECTORY ${testOutputDir}) + endif() + + foreach(testinput ${testcasesToGenerate}) + string(REGEX REPLACE "[^a-zA-Z0-9_]\\+" "_" testcaseName ${testinput}) + string(REGEX REPLACE "\\.xml" "" testoutput ${testinput}) + message("Generate hotspot test case '${testinput}'. Output in '${testoutput}.xml' and '${testoutput}.nrrd'") + mitkAddCustomModuleTest(mitkMultiGaussianTest_${testcaseName} + mitkMultiGaussianTest + ${testOutputDir}/${testoutput} + ${testInputDir}/${testinput}) + endforeach() +endif() diff --git a/Modules/ImageStatistics/Testing/files.cmake b/Modules/ImageStatistics/Testing/files.cmake index 5fb127cbdf..6cbda61dfe 100644 --- a/Modules/ImageStatistics/Testing/files.cmake +++ b/Modules/ImageStatistics/Testing/files.cmake @@ -1,10 +1,10 @@ set(MODULE_TESTS mitkImageStatisticsCalculatorTest.cpp mitkPointSetStatisticsCalculatorTest.cpp mitkPointSetDifferenceStatisticsCalculatorTest.cpp - mitkMultiGaussianTest.cpp ) set(MODULE_CUSTOM_TESTS mitkImageStatisticsHotspotTest.cpp +# mitkMultiGaussianTest.cpp # TODO: activate test to generate new test cases for mitkImageStatisticsHotspotTest )