diff --git a/testing/CMakeLists.txt b/testing/CMakeLists.txt index 8691e7c..d3d25f2 100644 --- a/testing/CMakeLists.txt +++ b/testing/CMakeLists.txt @@ -1,90 +1,93 @@ MESSAGE(STATUS "processing RTToolbox testing code") # Testing branch PROJECT(RTTBTesting) #----------------------------------------------------------------------------- # extract and build Litmus #----------------------------------------------------------------------------- include(ExternalProject) message(STATUS "Litmus will be automatically downloaded and built.") set(LITMUS_SOURCE_DIR "${CMAKE_BINARY_DIR}/external/Litmus-src") set(LITMUS_BUILD_DIR "${CMAKE_BINARY_DIR}/external/Litmus-build") set(LITMUS_CMAKE_DIR "${CMAKE_BINARY_DIR}/external/Litmus-cmake") IF ((BUILD_RTToolbox_interpolation_Tester AND BUILD_InterpolationMatchPointTransformation) OR (BUILD_RTToolbox_io_Tester AND BUILD_IO_ITK)) set(ENABLE_ITK "-DLIT_ENABLE_ITK_SUPPORT:BOOL=ON") set(ITK_DIRECTORY "-DITK_DIR:STRING=${ITK_DIR}") ENDIF() #extract and build Litmus ExternalProject_Add( Litmus URL ${RTToolbox_SOURCE_DIR}/utilities/Litmus/Litmus.tar.gz SOURCE_DIR ${LITMUS_SOURCE_DIR} BINARY_DIR ${LITMUS_BUILD_DIR} PREFIX ${LITMUS_CMAKE_DIR} INSTALL_COMMAND "" UPDATE_COMMAND "" # Don't update SVN on every build CMAKE_ARGS -DBUILD_TESTING:BOOL=OFF ${ENABLE_ITK} ${ITK_DIRECTORY} ) #----------------------------------------------------------------------------- # Configure Testing branch #----------------------------------------------------------------------------- MAKE_DIRECTORY(${RTTBTesting_BINARY_DIR}/Temporary) MESSAGE(STATUS "Process All Tests...") #----------------------------------------------------------------------------- # Include sub directories #----------------------------------------------------------------------------- OPTION(BUILD_RTToolbox_core_Tester "build project on/off" OFF) OPTION(BUILD_RTToolbox_Test_examples "build project on/off" OFF) OPTION(BUILD_RTToolbox_algorithms_Tester "build project on/off" OFF) OPTION(BUILD_RTToolbox_models_Tester "build project on/off" OFF) OPTION(BUILD_RTToolbox_io_Tester "build project on/off" OFF) OPTION(BUILD_RTToolbox_masks_Tester "build project on/off" OFF) OPTION(BUILD_RTToolbox_interpolation_Tester "build project on/off" OFF) OPTION(BUILD_RTToolbox_apps_Tester "build project on/off" OFF) OPTION(BUILD_RTToolbox_validation_Tester "build project on/off" OFF) IF(BUILD_RTToolbox_core_Tester) ADD_SUBDIRECTORY(core) ENDIF() IF(BUILD_RTToolbox_Test_examples) ADD_SUBDIRECTORY(examples) + IF(RTTB_VIRTUOS_SUPPORT AND BUILD_IO_Virtuos) + ADD_SUBDIRECTORY(examples_virtuos) + ENDIF() ENDIF() IF(BUILD_RTToolbox_algorithms_Tester) ADD_SUBDIRECTORY(algorithms) ENDIF() IF(BUILD_RTToolbox_models_Tester) ADD_SUBDIRECTORY(models) ENDIF() IF(BUILD_RTToolbox_io_Tester) ADD_SUBDIRECTORY(io) ENDIF() IF(BUILD_RTToolbox_masks_Tester) ADD_SUBDIRECTORY(masks) ENDIF() IF(BUILD_RTToolbox_interpolation_Tester) ADD_SUBDIRECTORY(interpolation) ENDIF() IF(BUILD_RTToolbox_validation_Tester) ADD_SUBDIRECTORY(validation) ENDIF() IF(BUILD_RTToolbox_apps_Tester) ADD_SUBDIRECTORY(apps) ENDIF() diff --git a/testing/examples/CMakeLists.txt b/testing/examples/CMakeLists.txt index 13bd3b8..b12fbef 100644 --- a/testing/examples/CMakeLists.txt +++ b/testing/examples/CMakeLists.txt @@ -1,39 +1,29 @@ #----------------------------------------------------------------------------- # Setup the system information test. Write out some basic failsafe # information in case the test doesn't run. #----------------------------------------------------------------------------- SET(CORE_TEST_EXAMPLES ${EXECUTABLE_OUTPUT_PATH}/rttbExamplesTests) SET(TEST_DATA_ROOT ${RTTBTesting_SOURCE_DIR}/data) SET(TEMP ${RTTBTesting_BINARY_DIR}/Temporary) #----------------------------------------------------------------------------- ADD_TEST(RTBioModelExampleTest ${CORE_TEST_EXAMPLES} RTBioModelExampleTest "${TEST_DATA_ROOT}/DVH/Text/dvh_PTV_HIT.txt" "${TEST_DATA_ROOT}/DVH/Text/dvh_test_HT1.txt" "${TEST_DATA_ROOT}/DVH/Text/dvh_test_HT2.txt" "${TEST_DATA_ROOT}/DVH/Text/dvh_test_HT3.txt" "${TEST_DATA_ROOT}/DVH/Text/dvh_test_TV.txt" "${TEST_DATA_ROOT}/DVH/Text/dvh_virtuos_diff_trunk6.txt" "${TEST_DATA_ROOT}/DVH/Text/dvh_virtuos_diff_trunk8.txt") ADD_TEST(RTDoseIndexTest ${CORE_TEST_EXAMPLES} RTDoseIndexTest "${TEST_DATA_ROOT}/DVH/Text/dvh_test_TV.txt" "${TEST_DATA_ROOT}/DVH/Text/dvh_test_HT1.txt" "${TEST_DATA_ROOT}/DVH/Text/dvh_test_HT2.txt" "${TEST_DATA_ROOT}/DVH/Text/dvh_test_HT3.txt") ADD_TEST(RTDoseStatisticsDicomTest ${CORE_TEST_EXAMPLES} RTDoseStatisticsDicomTest "${TEST_DATA_ROOT}/Dose/DICOM/ConstantTwo_withDoseGridScaling.dcm") -IF(RTTB_VIRTUOS_SUPPORT AND BUILD_IO_Virtuos) - ADD_TEST(RTDoseStatisticsVirtuosTest ${CORE_TEST_EXAMPLES} RTDoseStatisticsVirtuosTest - "${TEST_DATA_ROOT}/Virtuos/prostate_ac/prostate_ac101.dos.gz" - "${TEST_DATA_ROOT}/Virtuos/prostate_ac/prostate_ac000.vdx" - "${TEST_DATA_ROOT}/Virtuos/prostate_ac/prostate_ac101.pln") -ENDIF() ADD_TEST(RTDVHTest ${CORE_TEST_EXAMPLES} RTDVHTest "${TEST_DATA_ROOT}/DVH/Text/dvh_test.txt") ADD_TEST(RTBioModelScatterPlotExampleTest ${CORE_TEST_EXAMPLES} RTBioModelScatterPlotExampleTest "${TEST_DATA_ROOT}/DVH/Text/dvh_PTV_HIT.txt" "${TEST_DATA_ROOT}/DVH/Text/dvh_test_HT1.txt" "${TEST_DATA_ROOT}/DVH/Text/dvh_test_TV.txt") -IF(RTTB_VIRTUOS_SUPPORT AND BUILD_IO_Virtuos) - RTTB_CREATE_TEST_MODULE(rttbExamples DEPENDS RTTBCore RTTBAlgorithms RTTBMasks RTTBBoostMask RTTBIndices RTTBDicomIO RTTBVirtuosIO RTTBITKIO RTTBOtherIO RTTBModels PACKAGE_DEPENDS Litmus) -ELSE() - RTTB_CREATE_TEST_MODULE(rttbExamples DEPENDS RTTBCore RTTBAlgorithms RTTBMasks RTTBBoostMask RTTBIndices RTTBDicomIO RTTBITKIO RTTBOtherIO RTTBModels PACKAGE_DEPENDS Litmus) -ENDIF() +RTTB_CREATE_TEST_MODULE(rttbExamples DEPENDS RTTBCore RTTBAlgorithms RTTBMasks RTTBBoostMask RTTBIndices RTTBDicomIO RTTBITKIO RTTBOtherIO RTTBModels PACKAGE_DEPENDS Litmus) \ No newline at end of file diff --git a/testing/examples/files.cmake b/testing/examples/files.cmake index 3cfc88c..f071ff8 100644 --- a/testing/examples/files.cmake +++ b/testing/examples/files.cmake @@ -1,19 +1,13 @@ -SET(DOSESTATISTICSVIRTUOSTEST "") -IF(RTTB_VIRTUOS_SUPPORT AND BUILD_IO_Virtuos) - SET(DOSESTATISTICSVIRTUOSTEST "RTDoseStatisticsVirtuosTest.cpp") -ENDIF() - SET(CPP_FILES RTBioModelExampleTest.cpp RTBioModelScatterPlotExampleTest.cpp RTDoseIndexTest.cpp RTDoseStatisticsDicomTest.cpp - ${DOSESTATISTICSVIRTUOSTEST} RTDVHTest.cpp ../models/rttbScatterTester.cpp rttbTestExamples.cpp ) SET(H_FILES ../models/rttbScatterTester.h ) diff --git a/testing/examples/rttbTestExamples.cpp b/testing/examples/rttbTestExamples.cpp index 0bd7b87..ebaf066 100644 --- a/testing/examples/rttbTestExamples.cpp +++ b/testing/examples/rttbTestExamples.cpp @@ -1,74 +1,68 @@ // ----------------------------------------------------------------------- // RTToolbox - DKFZ radiotherapy quantitative evaluation library // // Copyright (c) German Cancer Research Center (DKFZ), // Software development for Integrated Diagnostics and Therapy (SIDT). // ALL RIGHTS RESERVED. // See rttbCopyright.txt or // http://www.dkfz.de/en/sidt/projects/rttb/copyright.html [^] // // This software is distributed WITHOUT ANY WARRANTY; without even // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR // PURPOSE. See the above copyright notices for more information. // //------------------------------------------------------------------------ /*! // @file // @version $Revision$ (last changed revision) // @date $Date$ (last change date) // @author $Author$ (last changed by) */ // this file defines the rttbCoreTests for the test driver // and all it expects is that you have a function called RegisterTests #if defined(_MSC_VER) #pragma warning ( disable : 4786 ) #endif #include "litMultiTestsMain.h" #include "RTToolboxConfigure.h" namespace rttb { namespace testing { void registerTests() { LIT_REGISTER_TEST(RTBioModelExampleTest); LIT_REGISTER_TEST(RTDVHTest); LIT_REGISTER_TEST(RTDoseIndexTest); - - if (RTTB_VIRTUOS_SUPPORT) - { - LIT_REGISTER_TEST(RTDoseStatisticsVirtuosTest); - } - LIT_REGISTER_TEST(RTDoseStatisticsDicomTest); LIT_REGISTER_TEST(RTBioModelScatterPlotExampleTest); } } } int main(int argc, char* argv[]) { int result = 0; rttb::testing::registerTests(); try { result = lit::multiTestsMain(argc, argv); } catch (const std::exception& /*e*/) { result = -1; } catch (...) { result = -1; } return result; } diff --git a/testing/examples_virtuos/CMakeLists.txt b/testing/examples_virtuos/CMakeLists.txt new file mode 100644 index 0000000..28992c3 --- /dev/null +++ b/testing/examples_virtuos/CMakeLists.txt @@ -0,0 +1,22 @@ +#----------------------------------------------------------------------------- +# Setup the system information test. Write out some basic failsafe +# information in case the test doesn't run. +#----------------------------------------------------------------------------- + + +SET(VIRTUOS_TEST_EXAMPLES ${EXECUTABLE_OUTPUT_PATH}/rttbExamplesVirtuosTests) + +SET(TEST_DATA_ROOT ${RTTBTesting_SOURCE_DIR}/data) + +SET(TEMP ${RTTBTesting_BINARY_DIR}/Temporary) + + +#----------------------------------------------------------------------------- + +ADD_TEST(RTDoseStatisticsVirtuosTest ${VIRTUOS_TEST_EXAMPLES} RTDoseStatisticsVirtuosTest +"${TEST_DATA_ROOT}/Virtuos/prostate_ac/prostate_ac101.dos.gz" +"${TEST_DATA_ROOT}/Virtuos/prostate_ac/prostate_ac000.vdx" +"${TEST_DATA_ROOT}/Virtuos/prostate_ac/prostate_ac101.pln") + +RTTB_CREATE_TEST_MODULE(rttbExamplesVirtuos DEPENDS RTTBCore RTTBAlgorithms RTTBMasks RTTBBoostMask RTTBIndices RTTBDicomIO RTTBVirtuosIO RTTBITKIO RTTBOtherIO RTTBModels PACKAGE_DEPENDS Litmus) + diff --git a/testing/examples/RTDoseStatisticsVirtuosTest.cpp b/testing/examples_virtuos/RTDoseStatisticsVirtuosTest.cpp similarity index 100% rename from testing/examples/RTDoseStatisticsVirtuosTest.cpp rename to testing/examples_virtuos/RTDoseStatisticsVirtuosTest.cpp diff --git a/testing/examples_virtuos/files.cmake b/testing/examples_virtuos/files.cmake new file mode 100644 index 0000000..7ee8b7a --- /dev/null +++ b/testing/examples_virtuos/files.cmake @@ -0,0 +1,9 @@ + +SET(CPP_FILES + RTDoseStatisticsVirtuosTest.cpp + rttbTestVirtuosExamples.cpp + ) + +SET(H_FILES + +) diff --git a/testing/examples/rttbTestExamples.cpp b/testing/examples_virtuos/rttbTestVirtuosExamples.cpp similarity index 71% copy from testing/examples/rttbTestExamples.cpp copy to testing/examples_virtuos/rttbTestVirtuosExamples.cpp index 0bd7b87..414ef44 100644 --- a/testing/examples/rttbTestExamples.cpp +++ b/testing/examples_virtuos/rttbTestVirtuosExamples.cpp @@ -1,74 +1,65 @@ // ----------------------------------------------------------------------- // RTToolbox - DKFZ radiotherapy quantitative evaluation library // // Copyright (c) German Cancer Research Center (DKFZ), // Software development for Integrated Diagnostics and Therapy (SIDT). // ALL RIGHTS RESERVED. // See rttbCopyright.txt or // http://www.dkfz.de/en/sidt/projects/rttb/copyright.html [^] // // This software is distributed WITHOUT ANY WARRANTY; without even // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR // PURPOSE. See the above copyright notices for more information. // //------------------------------------------------------------------------ /*! // @file -// @version $Revision$ (last changed revision) -// @date $Date$ (last change date) -// @author $Author$ (last changed by) +// @version $Revision: 1512 $ (last changed revision) +// @date $Date: 2016-10-12 09:51:30 +0200 (Mi, 12 Okt 2016) $ (last change date) +// @author $Author: hentsch $ (last changed by) */ // this file defines the rttbCoreTests for the test driver // and all it expects is that you have a function called RegisterTests #if defined(_MSC_VER) #pragma warning ( disable : 4786 ) #endif #include "litMultiTestsMain.h" #include "RTToolboxConfigure.h" namespace rttb { namespace testing { void registerTests() { - LIT_REGISTER_TEST(RTBioModelExampleTest); - LIT_REGISTER_TEST(RTDVHTest); - LIT_REGISTER_TEST(RTDoseIndexTest); - - if (RTTB_VIRTUOS_SUPPORT) - { - LIT_REGISTER_TEST(RTDoseStatisticsVirtuosTest); - } - - LIT_REGISTER_TEST(RTDoseStatisticsDicomTest); - LIT_REGISTER_TEST(RTBioModelScatterPlotExampleTest); + + LIT_REGISTER_TEST(RTDoseStatisticsVirtuosTest); } } } int main(int argc, char* argv[]) { int result = 0; rttb::testing::registerTests(); try { result = lit::multiTestsMain(argc, argv); } catch (const std::exception& /*e*/) { result = -1; } catch (...) { result = -1; } return result; }