diff --git a/CMake/mitkTestPluginGenerator.cmake b/CMake/mitkTestPluginGenerator.cmake index 7fcaca889f..e148dcdd64 100644 --- a/CMake/mitkTestPluginGenerator.cmake +++ b/CMake/mitkTestPluginGenerator.cmake @@ -1,99 +1,99 @@ if(BUILD_TESTING) set(proj GeneratedTestProject) set(test_project_out_dir "${MITK_BINARY_DIR}") set(test_project_source_dir "${MITK_BINARY_DIR}/${proj}") set(test_project_binary_dir "${MITK_BINARY_DIR}/${proj}-bin") add_test(NAME mitkPluginGeneratorCleanTest COMMAND ${CMAKE_COMMAND} -E remove_directory "${test_project_source_dir}" ) set_tests_properties(mitkPluginGeneratorCleanTest PROPERTIES - LABLES "MITK;BlueBerry") + LABELS "MITK;BlueBerry") add_test(NAME mitkPluginGeneratorCleanTest2 COMMAND ${CMAKE_COMMAND} -E remove_directory "${test_project_binary_dir}" ) set_tests_properties(mitkPluginGeneratorCleanTest2 PROPERTIES - LABLES "MITK;BlueBerry") + LABELS "MITK;BlueBerry") add_test(NAME mitkPluginGeneratorCleanTest3 COMMAND ${CMAKE_COMMAND} -E make_directory "${test_project_binary_dir}" ) set_tests_properties(mitkPluginGeneratorCleanTest3 PROPERTIES DEPENDS mitkPluginGeneratorCleanTest2 - LABLES "MITK;BlueBerry") + LABELS "MITK;BlueBerry") add_test(NAME mitkPluginGeneratorCreateTest COMMAND ${exec_target} --project-name "${proj}" --project-app-name "TestApp" -ps org.test.plugin -pn "Test Plugin" -vn "Test View" -o ${test_project_out_dir} -y -n ) set_tests_properties(mitkPluginGeneratorCreateTest PROPERTIES DEPENDS "${exec_target};mitkPluginGeneratorCleanTest;mitkPluginGeneratorCleanTest3" LABELS "MITK;BlueBerry") if(CMAKE_CONFIGURATION_TYPES) foreach(config ${CMAKE_CONFIGURATION_TYPES}) add_test(NAME mitkPluginGeneratorConfigureTest-${config} CONFIGURATIONS ${config} WORKING_DIRECTORY "${test_project_binary_dir}" COMMAND ${CMAKE_COMMAND} -D MITK_DIR:PATH=${MITK_BINARY_DIR} -G ${CMAKE_GENERATOR} "${test_project_source_dir}") set_tests_properties(mitkPluginGeneratorConfigureTest-${config} PROPERTIES DEPENDS mitkPluginGeneratorCreateTest LABELS "MITK;BlueBerry") add_test(NAME mitkPluginGeneratorBuildTest-${config} CONFIGURATIONS ${config} COMMAND ${CMAKE_COMMAND} --build ${test_project_binary_dir} --config ${config}) set_tests_properties(mitkPluginGeneratorBuildTest-${config} PROPERTIES DEPENDS mitkPluginGeneratorConfigureTest-${config} LABELS "MITK;BlueBerry") endforeach() else() add_test(NAME mitkPluginGeneratorConfigureTest-${CMAKE_BUILD_TYPE} WORKING_DIRECTORY "${test_project_binary_dir}" COMMAND ${CMAKE_COMMAND} -D MITK_DIR:PATH=${MITK_BINARY_DIR} -D CMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} -G ${CMAKE_GENERATOR} "${test_project_source_dir}") set_tests_properties(mitkPluginGeneratorConfigureTest-${CMAKE_BUILD_TYPE} PROPERTIES DEPENDS mitkPluginGeneratorCreateTest LABELS "MITK;BlueBerry") - add_test(mitkPluginGeneratorBuildTest-${CMAKE_BUILD_TYPE} - ${CMAKE_COMMAND} --build ${test_project_binary_dir} --config ${CMAKE_BUILD_TYPE}) + add_test(NAME mitkPluginGeneratorBuildTest-${CMAKE_BUILD_TYPE} + COMMAND ${CMAKE_COMMAND} --build ${test_project_binary_dir} --config ${CMAKE_BUILD_TYPE}) set_tests_properties(mitkPluginGeneratorBuildTest-${CMAKE_BUILD_TYPE} PROPERTIES DEPENDS mitkPluginGeneratorConfigureTest-${CMAKE_BUILD_TYPE} LABELS "MITK;BlueBerry") endif() set(package_test_configurations) if(WIN32) # Only test packaging if build type is "Release" on Windows set(package_test_configurations CONFIGURATIONS Release) endif() if(NOT MITK_FAST_TESTING) if(WIN32) # Only test packaging if build type is "Release" on Windows add_test(NAME mitkPluginGeneratorPackageTest CONFIGURATIONS Release COMMAND ${CMAKE_COMMAND} --build ${test_project_binary_dir}/${proj}-build --config Release --target package) set_tests_properties(mitkPluginGeneratorPackageTest PROPERTIES DEPENDS mitkPluginGeneratorBuildTest-Release TIMEOUT 3600 LABELS "MITK;BlueBerry") elseif(CMAKE_BUILD_TYPE) add_test(mitkPluginGeneratorPackageTest ${CMAKE_COMMAND} --build ${test_project_binary_dir}/${proj}-build --config ${CMAKE_BUILD_TYPE} --target package) set_tests_properties(mitkPluginGeneratorPackageTest PROPERTIES DEPENDS mitkPluginGeneratorBuildTest-${CMAKE_BUILD_TYPE} TIMEOUT 3600 LABELS "MITK;BlueBerry") endif() endif() endif() diff --git a/CMake/mitkTestProjectTemplate.cmake b/CMake/mitkTestProjectTemplate.cmake index 07ccbafbb2..83d390308a 100644 --- a/CMake/mitkTestProjectTemplate.cmake +++ b/CMake/mitkTestProjectTemplate.cmake @@ -1,94 +1,94 @@ if(BUILD_TESTING) include(ExternalProject) set(proj MITK-ProjectTemplate) set(MITK-ProjectTemplate_BINARY_DIR "${MITK_BINARY_DIR}/${proj}-build") ExternalProject_Add(${proj} GIT_REPOSITORY http://git.mitk.org/MITK-ProjectTemplate.git GIT_TAG origin/master SOURCE_DIR "${MITK_BINARY_DIR}/${proj}" BINARY_DIR "${MITK-ProjectTemplate_BINARY_DIR}" PREFIX "${proj}-cmake" BUILD_COMMAND "" INSTALL_COMMAND "" CMAKE_GENERATOR "${CMAKE_GENERATOR}" CMAKE_ARGS -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE} -DMITK_DIR:PATH=${MITK_BINARY_DIR} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DAwesomeProject_BUILD_ALL_PLUGINS:BOOL=ON -DAwesomeProject_BUILD_ALL_APPS:BOOL=ON ) add_test(NAME mitkProjectTemplateCleanTest COMMAND ${CMAKE_COMMAND} -E remove_directory "${MITK-ProjectTemplate_BINARY_DIR}" ) set_tests_properties(mitkProjectTemplateCleanTest PROPERTIES LABELS "MITK;BlueBerry") add_test(NAME mitkProjectTemplateCleanTest2 COMMAND ${CMAKE_COMMAND} -E make_directory "${MITK-ProjectTemplate_BINARY_DIR}" ) set_tests_properties(mitkProjectTemplateCleanTest2 PROPERTIES DEPENDS mitkProjectTemplateCleanTest LABELS "MITK;BlueBerry") if(CMAKE_CONFIGURATION_TYPES) foreach(config ${CMAKE_CONFIGURATION_TYPES}) add_test(NAME mitkProjectTemplateConfigureTest-${config} CONFIGURATIONS ${config} COMMAND ${CMAKE_COMMAND} --build ${MITK_BINARY_DIR} --config ${config} --target ${proj}) set_tests_properties(mitkProjectTemplateConfigureTest-${config} PROPERTIES DEPENDS mitkProjectTemplateCleanTest2 LABELS "MITK;BlueBerry") add_test(NAME mitkProjectTemplateBuildTest-${config} CONFIGURATIONS ${config} COMMAND ${CMAKE_COMMAND} --build ${MITK-ProjectTemplate_BINARY_DIR} --config ${config}) set_tests_properties(mitkProjectTemplateBuildTest-${config} PROPERTIES DEPENDS mitkProjectTemplateConfigureTest-${config} LABELS "MITK;BlueBerry") endforeach() else() - add_test(mitkProjectTemplateConfigureTest-${CMAKE_BUILD_TYPE} - ${CMAKE_COMMAND} --build ${MITK_BINARY_DIR} --config ${CMAKE_BUILD_TYPE} --target ${proj}) + add_test(NAME mitkProjectTemplateConfigureTest-${CMAKE_BUILD_TYPE} + COMMAND ${CMAKE_COMMAND} --build ${MITK_BINARY_DIR} --config ${CMAKE_BUILD_TYPE} --target ${proj}) set_tests_properties(mitkProjectTemplateConfigureTest-${CMAKE_BUILD_TYPE} PROPERTIES DEPENDS mitkProjectTemplateCleanTest2 LABELS "MITK;BlueBerry") - add_test(mitkProjectTemplateBuildTest-${CMAKE_BUILD_TYPE} - ${CMAKE_COMMAND} --build ${MITK-ProjectTemplate_BINARY_DIR} --config ${CMAKE_BUILD_TYPE}) + add_test(NAME mitkProjectTemplateBuildTest-${CMAKE_BUILD_TYPE} + COMMAND ${CMAKE_COMMAND} --build ${MITK-ProjectTemplate_BINARY_DIR} --config ${CMAKE_BUILD_TYPE}) set_tests_properties(mitkProjectTemplateBuildTest-${CMAKE_BUILD_TYPE} PROPERTIES DEPENDS mitkProjectTemplateConfigureTest-${CMAKE_BUILD_TYPE} LABELS "MITK;BlueBerry") endif() set(package_test_configurations) if(WIN32) # Only test packaging if build type is "Release" on Windows set(package_test_configurations CONFIGURATIONS Release) endif() if(NOT MITK_FAST_TESTING) if(WIN32) # Only test packaging if build type is "Release" on Windows add_test(NAME mitkProjectTemplatePackageTest CONFIGURATIONS Release COMMAND ${CMAKE_COMMAND} --build ${MITK-ProjectTemplate_BINARY_DIR}/AwesomeProject-build --config Release --target package) set_tests_properties(mitkProjectTemplatePackageTest PROPERTIES DEPENDS mitkProjectTemplateBuildTest-Release TIMEOUT 3600 LABELS "MITK;BlueBerry") elseif(CMAKE_BUILD_TYPE) - add_test(mitkProjectTemplatePackageTest - ${CMAKE_COMMAND} --build ${MITK-ProjectTemplate_BINARY_DIR}/AwesomeProject-build --config ${CMAKE_BUILD_TYPE} --target package) + add_test(NAME mitkProjectTemplatePackageTest + COMMAND ${CMAKE_COMMAND} --build ${MITK-ProjectTemplate_BINARY_DIR}/AwesomeProject-build --config ${CMAKE_BUILD_TYPE} --target package) set_tests_properties(mitkProjectTemplatePackageTest PROPERTIES DEPENDS mitkProjectTemplateBuildTest-${CMAKE_BUILD_TYPE} TIMEOUT 3600 LABELS "MITK;BlueBerry") endif() endif() endif()