diff options
Diffstat (limited to 'Tests/CMakeLists.txt')
-rw-r--r-- | Tests/CMakeLists.txt | 399 |
1 files changed, 235 insertions, 164 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index bbf804bb1..44e9450a4 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -8,18 +8,14 @@ macro(ADD_TEST_MACRO NAME COMMAND) "${CMake_SOURCE_DIR}/Tests/${dir}" "${CMake_BINARY_DIR}/Tests/${dir}" --build-two-config - --build-generator ${CMAKE_TEST_GENERATOR} - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} + ${build_generator_args} --build-project ${proj} ${${NAME}_EXTRA_OPTIONS} --test-command ${COMMAND} ${ARGN}) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${dir}") endmacro() -macro(REGEX_ESCAPE_STRING _OUT _IN) - # Escape special regex metacharacters with a backslash - string(REGEX REPLACE "([$^.[|*+?()]|])" "\\\\\\1" ${_OUT} "${_IN}") -endmacro() +include(${CMAKE_CURRENT_SOURCE_DIR}/RegexEscapeString.cmake) include(${CMAKE_CURRENT_SOURCE_DIR}/CheckFortran.cmake) @@ -51,6 +47,36 @@ if(BUILD_TESTING) set(TEST_CompileCommandOutput 1) endif() + set(MAKE_IS_GNU ) + if(${CMAKE_TEST_MAKEPROGRAM} MATCHES make) + execute_process(COMMAND ${CMAKE_TEST_MAKEPROGRAM} no_such_target --version + RESULT_VARIABLE res OUTPUT_VARIABLE out ERROR_VARIABLE out) + if("${res}" STREQUAL "0") + if("${out}" MATCHES "GNU") + set(MAKE_IS_GNU 1) + endif() + endif() + endif() + + # some old versions of make simply cannot handle spaces in paths + if (MAKE_IS_GNU OR + "${CMAKE_TEST_MAKEPROGRAM}" MATCHES "nmake|gmake|wmake" OR + "${CMAKE_TEST_GENERATOR}" MATCHES "Visual Studio|XCode|Borland") + set(MAKE_SUPPORTS_SPACES 1) + else() + set(MAKE_SUPPORTS_SPACES 0) + endif() + + set(build_generator_args + --build-generator ${CMAKE_TEST_GENERATOR} + --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} + ) + if(CMAKE_TEST_GENERATOR_TOOLSET) + list(APPEND build_generator_args + --build-generator-toolset ${CMAKE_TEST_GENERATOR_TOOLSET} + ) + endif() + add_subdirectory(CMakeLib) add_subdirectory(CMakeOnly) add_subdirectory(RunCMake) @@ -216,6 +242,7 @@ if(BUILD_TESTING) ADD_TEST_MACRO(PolicyScope PolicyScope) ADD_TEST_MACRO(EmptyLibrary EmptyLibrary) ADD_TEST_MACRO(CompileDefinitions CompileDefinitions) + ADD_TEST_MACRO(CompatibleInterface CompatibleInterface) set_tests_properties(EmptyLibrary PROPERTIES PASS_REGULAR_EXPRESSION "CMake Error: CMake can not determine linker language for target:test") ADD_TEST_MACRO(CrossCompile CrossCompile) @@ -257,6 +284,7 @@ if(BUILD_TESTING) # run test for BundleUtilities on supported platforms/compilers if(MSVC OR + MINGW OR CMAKE_SYSTEM_NAME MATCHES "Linux" OR CMAKE_SYSTEM_NAME MATCHES "Darwin") if(NOT "${CMAKE_TEST_GENERATOR}" STREQUAL "Watcom WMake") @@ -265,8 +293,7 @@ if(BUILD_TESTING) --build-and-test "${CMake_SOURCE_DIR}/Tests/BundleUtilities" "${CMake_BINARY_DIR}/Tests/BundleUtilities" - --build-generator ${CMAKE_TEST_GENERATOR} - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} + ${build_generator_args} --build-project BundleUtilities ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BundleUtilities") @@ -278,8 +305,7 @@ if(BUILD_TESTING) --build-and-test "${CMake_SOURCE_DIR}/Tests/Qt4Deploy" "${CMake_BINARY_DIR}/Tests/Qt4Deploy" - --build-generator ${CMAKE_TEST_GENERATOR} - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} + ${build_generator_args} --build-project Qt4Deploy --build-options -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} @@ -311,6 +337,19 @@ if(BUILD_TESTING) ADD_TEST_MACRO(Module.CheckTypeSize CheckTypeSize) + add_test(Module.ExternalData ${CMAKE_CTEST_COMMAND} + --build-and-test + "${CMake_SOURCE_DIR}/Tests/Module/ExternalData" + "${CMake_BINARY_DIR}/Tests/Module/ExternalData" + ${build_generator_args} + --build-project ExternalDataTest + --build-noclean + --force-new-ctest-process + --build-options -DMAKE_SUPPORTS_SPACES=${MAKE_SUPPORTS_SPACES} + --test-command ${CMAKE_CTEST_COMMAND} -C \${CTEST_CONFIGURATION_TYPE} -V + ) + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Module/ExternalData") + ADD_TEST_MACRO(Module.GenerateExportHeader GenerateExportHeader) if (APPLE OR CMAKE_CXX_COMPILER_ID MATCHES "GNU") @@ -336,8 +375,7 @@ if(BUILD_TESTING) --build-and-test "${CMake_SOURCE_DIR}/Tests/LinkFlags" "${CMake_BINARY_DIR}/Tests/LinkFlags" - --build-generator ${CMAKE_TEST_GENERATOR} - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} + ${build_generator_args} --build-project LinkFlags --build-target LinkFlags --build-options -DTEST_CONFIG=\${CTEST_CONFIGURATION_TYPE} @@ -365,7 +403,8 @@ if(BUILD_TESTING) # mainly it tests that cmake doesn't crash when generating these project files. if(${CMAKE_TEST_GENERATOR} MATCHES "Unix Makefiles" OR ${CMAKE_TEST_GENERATOR} MATCHES "KDevelop") # check which generators we have - exec_program(${CMAKE_CMAKE_COMMAND} ARGS --help OUTPUT_VARIABLE cmakeOutput ) + execute_process(COMMAND ${CMAKE_CMAKE_COMMAND} --help + OUTPUT_VARIABLE cmakeOutput ERROR_VARIABLE cmakeOutput) # check for the Eclipse generator if ("${cmakeOutput}" MATCHES Eclipse) add_test(Simple_EclipseGenerator ${CMAKE_CTEST_COMMAND} @@ -374,6 +413,7 @@ if(BUILD_TESTING) "${CMake_BINARY_DIR}/Tests/Simple_EclipseGenerator" --build-two-config --build-generator "Eclipse CDT4 - Unix Makefiles" + --build-generator-toolset "${CMAKE_TEST_GENERATOR_TOOLSET}" --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --build-project Simple --test-command Simple) @@ -388,6 +428,7 @@ if(BUILD_TESTING) "${CMake_BINARY_DIR}/Tests/Simple_CodeBlocksGenerator" --build-two-config --build-generator "CodeBlocks - Unix Makefiles" + --build-generator-toolset "${CMAKE_TEST_GENERATOR_TOOLSET}" --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --build-project Simple --test-command Simple) @@ -401,6 +442,7 @@ if(BUILD_TESTING) "${CMake_BINARY_DIR}/Tests/Simple_KDevelop3Generator" --build-two-config --build-generator "KDevelop3 - Unix Makefiles" + --build-generator-toolset "${CMAKE_TEST_GENERATOR_TOOLSET}" --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --build-project Simple --test-command Simple) @@ -419,8 +461,7 @@ if(BUILD_TESTING) "${CMake_SOURCE_DIR}/Tests/SubProject" "${CMake_BINARY_DIR}/Tests/SubProject" --build-project SubProject - --build-generator ${CMAKE_TEST_GENERATOR} - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} + ${build_generator_args} --build-target car --test-command car ) @@ -442,8 +483,7 @@ if(BUILD_TESTING) --build-and-test "${CMake_SOURCE_DIR}/Tests/SubProject${SubProject_SUBDIR}" "${CMake_BINARY_DIR}/Tests/SubProject${SubProject_SUBDIR}" - --build-generator ${CMAKE_TEST_GENERATOR} - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} + ${build_generator_args} --build-nocmake --build-project foo --build-target foo @@ -489,8 +529,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ "${CMake_SOURCE_DIR}/Tests/Framework" "${CMake_BINARY_DIR}/Tests/Framework" --build-two-config - --build-generator ${CMAKE_TEST_GENERATOR} - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} + ${build_generator_args} --build-project Framework --build-options "-DCMAKE_INSTALL_PREFIX:PATH=${CMake_BINARY_DIR}/Tests/Framework/Install" @@ -502,8 +541,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ "${CMake_SOURCE_DIR}/Tests/TargetName" "${CMake_BINARY_DIR}/Tests/TargetName" --build-two-config - --build-generator ${CMAKE_TEST_GENERATOR} - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} + ${build_generator_args} --build-project TargetName --test-command ${CMAKE_CMAKE_COMMAND} -E compare_files ${CMake_SOURCE_DIR}/Tests/TargetName/scripts/hello_world @@ -515,8 +553,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ "${CMake_SOURCE_DIR}/Tests/LibName" "${CMake_BINARY_DIR}/Tests/LibName" --build-two-config - --build-generator ${CMAKE_TEST_GENERATOR} - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} + ${build_generator_args} --build-project LibName --build-exe-dir "${CMake_BINARY_DIR}/Tests/LibName/lib" --test-command foobar @@ -528,8 +565,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ "${CMake_SOURCE_DIR}/Tests/CustComDepend" "${CMake_BINARY_DIR}/Tests/CustComDepend" --build-two-config - --build-generator ${CMAKE_TEST_GENERATOR} - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} + ${build_generator_args} --build-project CustComDepend --build-exe-dir "${CMake_BINARY_DIR}/Tests/CustComDepend/bin" --test-command foo bar.c @@ -540,9 +576,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-and-test "${CMake_SOURCE_DIR}/Tests/ArgumentExpansion" "${CMake_BINARY_DIR}/Tests/ArgumentExpansion" - --build-generator ${CMAKE_TEST_GENERATOR} + ${build_generator_args} --build-project ArgumentExpansion - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --build-exe-dir "${CMake_BINARY_DIR}/Tests/ArgumentExpansion/bin" ) set_tests_properties(ArgumentExpansion PROPERTIES @@ -553,9 +588,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-and-test "${CMake_SOURCE_DIR}/Tests/GeneratorExpression" "${CMake_BINARY_DIR}/Tests/GeneratorExpression" - --build-generator ${CMAKE_TEST_GENERATOR} + ${build_generator_args} --build-project GeneratorExpression - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --build-options -DCMAKE_BUILD_TYPE=\${CTEST_CONFIGURATION_TYPE} ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/GeneratorExpression") @@ -565,22 +599,22 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ "${CMake_SOURCE_DIR}/Tests/CustomCommand" "${CMake_BINARY_DIR}/Tests/CustomCommand" --build-two-config - --build-generator ${CMAKE_TEST_GENERATOR} + ${build_generator_args} --build-project CustomCommand - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --build-exe-dir "${CMake_BINARY_DIR}/Tests/CustomCommand/bin" --test-command CustomCommand ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CustomCommand") + ADD_TEST_MACRO(EmptyDepends ${CMAKE_CTEST_COMMAND}) + add_test(CustomCommandWorkingDirectory ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/CustomCommandWorkingDirectory" "${CMake_BINARY_DIR}/Tests/CustomCommandWorkingDirectory" --build-two-config - --build-generator ${CMAKE_TEST_GENERATOR} + ${build_generator_args} --build-project TestWorkingDir - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --test-command working ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CustomCommandWorkingDirectory") @@ -589,9 +623,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ # --build-and-test # "${CMake_SOURCE_DIR}/Tests/SimpleExclude" # "${CMake_BINARY_DIR}/Tests/SimpleExclude" - # --build-generator ${CMAKE_TEST_GENERATOR} + # ${build_generator_args} # --build-project SimpleExclude - # --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} # --build-two-config # --test-command t4 #--test-command "${CMAKE_COMMAND}" @@ -603,9 +636,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ # --build-and-test # "${CMake_SOURCE_DIR}/Tests/SameName" # "${CMake_BINARY_DIR}/Tests/SameName" -# --build-generator ${CMAKE_TEST_GENERATOR} +# ${build_generator_args} # --build-project SameName -# --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} # --build-two-config # --test-command # "${CMake_BINARY_DIR}/Tests/SameName/Exe1/mytest2") @@ -614,9 +646,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-and-test "${CMake_SOURCE_DIR}/Tests/OutOfSource" "${CMake_BINARY_DIR}/Tests/OutOfSource" - --build-generator ${CMAKE_TEST_GENERATOR} + ${build_generator_args} --build-project OutOfSource - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --build-two-config --test-command "${CMake_BINARY_DIR}/Tests/OutOfSource/SubDir/OutOfSourceSubdir/simple") @@ -628,9 +659,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-and-test "${CMake_SOURCE_DIR}/Tests/BuildDepends" "${CMake_BINARY_DIR}/Tests/BuildDepends" - --build-generator ${CMAKE_TEST_GENERATOR} + ${build_generator_args} --build-project BuildDepends - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BuildDepends") @@ -640,9 +670,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-and-test "${CMake_SOURCE_DIR}/Tests/SimpleInstall" "${CMake_BINARY_DIR}/Tests/SimpleInstall" - --build-generator ${CMAKE_TEST_GENERATOR} + ${build_generator_args} --build-project TestSimpleInstall - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --build-two-config --build-options "-DCMAKE_INSTALL_PREFIX:PATH=${SimpleInstallInstallDir}" @@ -653,9 +682,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-and-test "${CMake_SOURCE_DIR}/Tests/SimpleInstallS2" "${CMake_BINARY_DIR}/Tests/SimpleInstallS2" - --build-generator ${CMAKE_TEST_GENERATOR} + ${build_generator_args} --build-project TestSimpleInstall - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --build-two-config --build-options "-DCMAKE_INSTALL_PREFIX:PATH=${SimpleInstallInstallDir}" @@ -695,6 +723,28 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ endif() endif() + # On Windows run the CPackWiXGenerator test + # if the WiX Toolset seems to be available + if(WIN32) + file(TO_CMAKE_PATH "$ENV{WIX}" WIX_ROOT) + + find_program(WIX_LIGHT_EXECUTABLE light + PATHS "${WIX_ROOT}/bin" + DOC "WiX Toolset light.exe location") + + if(WIX_LIGHT_EXECUTABLE) + add_test(CPackWiXGenerator ${CMAKE_CTEST_COMMAND} + --build-and-test + "${CMake_SOURCE_DIR}/Tests/CPackWiXGenerator" + "${CMake_BINARY_DIR}/Tests/CPackWiXGenerator" + ${build_generator_args} + --build-project CPackWiXGenerator + --test-command ${CMAKE_CMAKE_COMMAND} + "-DCPackWiXGenerator_BINARY_DIR:PATH=${CMake_BINARY_DIR}/Tests/CPackWiXGenerator" + -P "${CMake_SOURCE_DIR}/Tests/CPackWiXGenerator/RunCPackVerifyResult.cmake") + endif() + endif() + if(CTEST_RUN_CPackComponents) set(CPackComponents_EXTRA_OPTIONS) if(APPLE) @@ -709,9 +759,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-and-test "${CMake_SOURCE_DIR}/Tests/CPackComponents" "${CMake_BINARY_DIR}/Tests/CPackComponents" - --build-generator ${CMAKE_TEST_GENERATOR} + ${build_generator_args} --build-project CPackComponents - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --build-two-config --build-target package --build-options @@ -742,7 +791,6 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ # ACTIVE_CPACK_GENERATORS variable # now contains the list of 'active generators' set(CPackComponentsForAll_EXTRA_OPTIONS) - set(CPackRun_CPackCommand "-DCPackCommand=${CMAKE_CPACK_COMMAND}") # set up list of CPack generators list(APPEND GENLST "ZIP") if(APPLE) @@ -772,9 +820,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-and-test "${CMake_SOURCE_DIR}/Tests/CPackComponentsForAll" "${CMake_BINARY_DIR}/Tests/CPackComponentsForAll/build${CPackGen}-${CPackComponentWay}" - --build-generator ${CMAKE_TEST_GENERATOR} + ${build_generator_args} --build-project CPackComponentsForAll - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --build-options -DCPACK_BINARY_${CPackGen}:BOOL=ON ${CPackRun_CPackComponentWay} @@ -782,7 +829,6 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --graphviz=CPackComponentsForAll.dot --test-command ${CMAKE_CMAKE_COMMAND} "-DCPackComponentsForAll_BINARY_DIR:PATH=${CMake_BINARY_DIR}/Tests/CPackComponentsForAll/build${CPackGen}-${CPackComponentWay}" - "${CPackRun_CPackCommand}" "${CPackRun_CPackGen}" "${CPackRun_CPackComponentWay}" -P "${CMake_SOURCE_DIR}/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake") @@ -811,13 +857,11 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-and-test "${CMake_SOURCE_DIR}/Tests/CPackTestAllGenerators" "${CMake_BINARY_DIR}/Tests/CPackTestAllGenerators" - --build-generator ${CMAKE_TEST_GENERATOR} + ${build_generator_args} --build-project CPackTestAllGenerators - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --test-command ${CMAKE_CMAKE_COMMAND} -D dir=${CMake_BINARY_DIR}/Tests/CPackTestAllGenerators - -D cpack=${CMAKE_CPACK_COMMAND} -P ${CMake_SOURCE_DIR}/Tests/CPackTestAllGenerators/RunCPack.cmake ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CPackTestAllGenerators") @@ -833,9 +877,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-and-test "${CMake_SOURCE_DIR}/Tests/X11" "${CMake_BINARY_DIR}/Tests/X11" - --build-generator ${CMAKE_TEST_GENERATOR} + ${build_generator_args} --build-project UseX11 - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --build-two-config ${X11_build_target_arg} --test-command UseX11) @@ -889,9 +932,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-and-test "${CMake_SOURCE_DIR}/Tests/LoadCommandOneConfig" "${CMake_BINARY_DIR}/Tests/LoadCommandOneConfig" - --build-generator ${CMAKE_TEST_GENERATOR} + ${build_generator_args} --build-project LoadCommand - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --test-command LoadedCommand ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/LoadCommandOneConfig") @@ -902,9 +944,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ "${CMake_BINARY_DIR}/Tests/Complex" --build-two-config --build-config-sample "${CMAKE_CTEST_COMMAND}" - --build-generator ${CMAKE_TEST_GENERATOR} + ${build_generator_args} --build-project Complex - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --build-exe-dir "${CMake_BINARY_DIR}/Tests/Complex/bin" --build-options -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} @@ -916,9 +957,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-and-test "${CMake_SOURCE_DIR}/Tests/ComplexOneConfig" "${CMake_BINARY_DIR}/Tests/ComplexOneConfig" - --build-generator ${CMAKE_TEST_GENERATOR} + ${build_generator_args} --build-project Complex - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --build-exe-dir "${CMake_BINARY_DIR}/Tests/ComplexOneConfig/bin" --build-options -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} @@ -931,9 +971,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-and-test "${CMake_SOURCE_DIR}/Example" "${CMake_BINARY_DIR}/Example" - --build-generator ${CMAKE_TEST_GENERATOR} + ${build_generator_args} --build-project HELLO - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --build-exe-dir "${CMake_BINARY_DIR}/Example/Demo" --test-command helloDemo ) @@ -943,23 +982,31 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-and-test "${CMake_SOURCE_DIR}/Tests/Environment" "${CMake_BINARY_DIR}/Tests/Environment" - --build-generator ${CMAKE_TEST_GENERATOR} + ${build_generator_args} --build-project EnvironmentProj - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --build-exe-dir "${CMake_BINARY_DIR}/Tests/Environment" --force-new-ctest-process --test-command ${CMAKE_CTEST_COMMAND} -V ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Environment") + add_test(QtAutomocNoQt ${CMAKE_CTEST_COMMAND} + --build-and-test + "${CMake_SOURCE_DIR}/Tests/QtAutomocNoQt" + "${CMake_BINARY_DIR}/Tests/QtAutomocNoQt" + ${build_generator_args} + --build-project QtAutomocNoQt + --build-options -DCMAKE_BUILD_TYPE=\${CTEST_CONFIGURATION_TYPE} + ) + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/QtAutomocNoQt") + if(QT4_WORKS AND QT_QTGUI_FOUND) add_test(QtAutomoc ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/QtAutomoc" "${CMake_BINARY_DIR}/Tests/QtAutomoc" - --build-generator ${CMAKE_TEST_GENERATOR} + ${build_generator_args} --build-project QtAutomoc - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --build-exe-dir "${CMake_BINARY_DIR}/Tests/QtAutomoc" --force-new-ctest-process --build-options -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE} @@ -967,14 +1014,27 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/QtAutomoc") endif() + if(QT4_WORKS AND QT_QTGUI_FOUND) + add_test(Qt4Targets ${CMAKE_CTEST_COMMAND} + --build-and-test + "${CMake_SOURCE_DIR}/Tests/Qt4Targets" + "${CMake_BINARY_DIR}/Tests/Qt4Targets" + ${build_generator_args} + --build-project Qt4Targets + --build-exe-dir "${CMake_BINARY_DIR}/Tests/Qt4Targets" + --force-new-ctest-process + --build-options -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE} + --test-command ${CMAKE_CTEST_COMMAND} -V + ) + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt4Targets") + endif() add_test(ExternalProject ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/ExternalProject" "${CMake_BINARY_DIR}/Tests/ExternalProject" - --build-generator ${CMAKE_TEST_GENERATOR} + ${build_generator_args} --build-project ExternalProjectTest - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --build-exe-dir "${CMake_BINARY_DIR}/Tests/ExternalProject" --force-new-ctest-process --test-command ${CMAKE_CTEST_COMMAND} -V @@ -983,6 +1043,36 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ set_tests_properties(ExternalProject PROPERTIES TIMEOUT ${CMAKE_LONG_TEST_TIMEOUT}) + add_test(ExternalProjectUpdateSetup ${CMAKE_CTEST_COMMAND} + --build-and-test + "${CMake_SOURCE_DIR}/Tests/ExternalProjectUpdate" + "${CMake_BINARY_DIR}/Tests/ExternalProjectUpdate" + ${build_generator_args} + --build-project ExternalProjectUpdateTest + --build-exe-dir "${CMake_BINARY_DIR}/Tests/ExternalProjectUpdate" + --force-new-ctest-process + --test-command ${CMAKE_CTEST_COMMAND} -V + ) + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ExternalProjectUpdate") + set_tests_properties(ExternalProjectUpdateSetup PROPERTIES + TIMEOUT ${CMAKE_LONG_TEST_TIMEOUT}) + + add_test(NAME ExternalProjectUpdate + COMMAND ${CMAKE_CMAKE_COMMAND} + -DExternalProjectUpdate_SOURCE_DIR:PATH=${CMake_SOURCE_DIR}/Tests/ExternalProjectUpdate + -DExternalProjectUpdate_BINARY_DIR:PATH=${CMake_BINARY_DIR}/Tests/ExternalProjectUpdate + -DCMAKE_TEST_GENERATOR=${CMAKE_TEST_GENERATOR} + -DCMAKE_TEST_GENERATOR_TOOLSET=${CMAKE_TEST_GENERATOR_TOOLSET} + -DCMAKE_TEST_MAKEPROGRAM=${CMAKE_TEST_MAKEPROGRAM} + -DCMAKE_CTEST_COMMAND=${CMAKE_CTEST_COMMAND} + -P ${CMake_SOURCE_DIR}/Tests/ExternalProjectUpdate/ExternalProjectUpdateTest.cmake + ) + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ExternalProjectUpdate") + set_tests_properties(ExternalProjectUpdate PROPERTIES + TIMEOUT ${CMAKE_LONG_TEST_TIMEOUT} + WORKING_DIRECTORY ${CMake_SOURCE_DIR}/Tests/ExternalProjectUpdate + DEPENDS ExternalProjectUpdateSetup ) + # do each of the tutorial steps foreach(STP RANGE 1 7) add_test(TutorialStep${STP} ${CMAKE_CTEST_COMMAND} @@ -990,8 +1080,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ "${CMake_SOURCE_DIR}/Tests/Tutorial/Step${STP}" "${CMake_BINARY_DIR}/Tests/Tutorial/Step${STP}" --build-two-config - --build-generator ${CMAKE_TEST_GENERATOR} - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} + ${build_generator_args} --build-project Tutorial --test-command Tutorial 25.0) endforeach() @@ -1001,9 +1090,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-and-test "${CMake_SOURCE_DIR}/Tests/Testing" "${CMake_BINARY_DIR}/Tests/Testing" - --build-generator ${CMAKE_TEST_GENERATOR} + ${build_generator_args} --build-project Testing - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --test-command ${CMAKE_CTEST_COMMAND} -C \${CTEST_CONFIGURATION_TYPE} ) set_tests_properties(testing PROPERTIES PASS_REGULAR_EXPRESSION "Passed") @@ -1013,9 +1101,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-and-test "${CMake_SOURCE_DIR}/Tests/Wrapping" "${CMake_BINARY_DIR}/Tests/Wrapping" - --build-generator ${CMAKE_TEST_GENERATOR} + ${build_generator_args} --build-project Wrapping - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --build-exe-dir "${CMake_BINARY_DIR}/Tests/Wrapping/bin" --test-command wrapping ) @@ -1023,9 +1110,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-and-test "${CMake_SOURCE_DIR}/Tests/Wrapping" "${CMake_BINARY_DIR}/Tests/Wrapping" - --build-generator ${CMAKE_TEST_GENERATOR} + ${build_generator_args} --build-project Wrapping - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --build-exe-dir "${CMake_BINARY_DIR}/Tests/Wrapping/bin" --test-command qtwrapping ) @@ -1035,8 +1121,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-and-test "${CMake_SOURCE_DIR}/Tests/TestDriver" "${CMake_BINARY_DIR}/Tests/TestDriver" - --build-generator ${CMAKE_TEST_GENERATOR} - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} + ${build_generator_args} --build-exe-dir "${CMake_BINARY_DIR}/Tests/Wrapping/bin" --build-project TestDriverTest --test-command TestDriverTest test1 @@ -1046,8 +1131,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-and-test "${CMake_SOURCE_DIR}/Tests/TestDriver" "${CMake_BINARY_DIR}/Tests/TestDriver" - --build-generator ${CMAKE_TEST_GENERATOR} - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} + ${build_generator_args} --build-exe-dir "${CMake_BINARY_DIR}/Tests/Wrapping/bin" --build-project TestDriverTest --test-command TestDriverTest test2 @@ -1057,8 +1141,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-and-test "${CMake_SOURCE_DIR}/Tests/TestDriver" "${CMake_BINARY_DIR}/Tests/TestDriver" - --build-generator ${CMAKE_TEST_GENERATOR} - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} + ${build_generator_args} --build-exe-dir "${CMake_BINARY_DIR}/Tests/Wrapping/bin" --build-project TestDriverTest --test-command TestDriverTest subdir/test3 @@ -1070,8 +1153,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ "${CMake_SOURCE_DIR}/Tests/Dependency" "${CMake_BINARY_DIR}/Tests/Dependency" --build-exe-dir "${CMake_BINARY_DIR}/Tests/Dependency/Exec" - --build-generator ${CMAKE_TEST_GENERATOR} - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} + ${build_generator_args} --build-project Dependency --test-command exec ) @@ -1101,8 +1183,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ "${CMake_BINARY_DIR}/Tests/Jump/WithLibOut" --build-exe-dir "${CMake_BINARY_DIR}/Tests/Jump/WithLibOut/Executable" --build-project Jump - --build-generator ${CMAKE_TEST_GENERATOR} - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} + ${build_generator_args} --build-options -DLIBRARY_OUTPUT_PATH:PATH=${CMake_BINARY_DIR}/Tests/Jump/WithLibOut/Lib --test-command jumpExecutable @@ -1115,8 +1196,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-exe-dir "${CMake_BINARY_DIR}/Tests/Jump/NoLibOut/Executable" --build-run-dir "${CMake_BINARY_DIR}/Tests/Jump/NoLibOut/Executable" --build-project Jump - --build-generator ${CMAKE_TEST_GENERATOR} - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} + ${build_generator_args} --test-command jumpExecutable ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Jump") @@ -1125,9 +1205,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-and-test "${CMake_SOURCE_DIR}/Tests/Plugin" "${CMake_BINARY_DIR}/Tests/Plugin" - --build-generator ${CMAKE_TEST_GENERATOR} + ${build_generator_args} --build-project Plugin - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --build-two-config --test-command bin/example) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Plugin") @@ -1141,8 +1220,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-and-test "${CMake_SOURCE_DIR}/Tests/LinkLineOrder" "${CMake_BINARY_DIR}/Tests/LinkLineOrder" - --build-generator ${CMAKE_TEST_GENERATOR} - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} + ${build_generator_args} --build-project LinkLineOrder --test-command Exec1 ) @@ -1151,8 +1229,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-and-test "${CMake_SOURCE_DIR}/Tests/LinkLineOrder" "${CMake_BINARY_DIR}/Tests/LinkLineOrder" - --build-generator ${CMAKE_TEST_GENERATOR} - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} + ${build_generator_args} --build-project LinkLineOrder --test-command Exec2 ) @@ -1172,8 +1249,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-and-test "${CMake_SOURCE_DIR}/Tests/LinkStatic" "${CMake_BINARY_DIR}/Tests/LinkStatic" - --build-generator ${CMAKE_TEST_GENERATOR} - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} + ${build_generator_args} --build-project LinkStatic --build-options -DMATH_LIBRARY:FILEPATH=/usr/lib/libm.a --test-command LinkStatic @@ -1185,39 +1261,21 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-and-test "${CMake_SOURCE_DIR}/Source/kwsys" "${CMake_BINARY_DIR}/Tests/kwsys" - --build-generator ${CMAKE_TEST_GENERATOR} - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} + ${build_generator_args} --build-project kwsys --test-command kwsysTestsCxx testIOS ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/kwsys") endif() - set(MAKE_IS_GNU ) - if(${CMAKE_TEST_MAKEPROGRAM} MATCHES make) - exec_program( - ${CMAKE_TEST_MAKEPROGRAM} ARGS no_such_target --version - RETURN_VALUE res OUTPUT_VARIABLE out - ) - if("${res}" EQUAL 0) - if("${out}" MATCHES "GNU") - set(MAKE_IS_GNU 1) - endif() - endif() - endif() - # only add this test on platforms that support it - # some old versions of make simply cannot handle spaces in paths - if (MAKE_IS_GNU OR - "${CMAKE_TEST_MAKEPROGRAM}" MATCHES "nmake|gmake|wmake" OR - "${CMAKE_TEST_GENERATOR}" MATCHES "Visual Studio|XCode|Borland") + if(MAKE_SUPPORTS_SPACES) add_test(SubDirSpaces ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/SubDirSpaces" "${CMake_BINARY_DIR}/Tests/SubDirSpaces" --build-exe-dir "${CMake_BINARY_DIR}/Tests/SubDirSpaces/Executable Sources" - --build-generator ${CMAKE_TEST_GENERATOR} - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} + ${build_generator_args} --build-project SUBDIR --test-command test "${CMake_BINARY_DIR}/Tests/SubDirSpaces/ShouldBeHere" @@ -1232,8 +1290,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ "${CMake_SOURCE_DIR}/Tests/SubDir" "${CMake_BINARY_DIR}/Tests/SubDir" --build-exe-dir "${CMake_BINARY_DIR}/Tests/SubDir/Executable" - --build-generator ${CMAKE_TEST_GENERATOR} - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} + ${build_generator_args} --build-project SUBDIR --test-command test "${CMake_BINARY_DIR}/Tests/SubDir/ShouldBeHere" @@ -1245,8 +1302,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ "${CMake_SOURCE_DIR}/Tests/SubDir" "${CMake_BINARY_DIR}/Tests/SubDir" --build-exe-dir "${CMake_BINARY_DIR}/Tests/SubDir/Executable" - --build-generator ${CMAKE_TEST_GENERATOR} - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} + ${build_generator_args} --build-project SUBDIR --test-command test "${CMake_BINARY_DIR}/Tests/SubDir/ShouldBeHere" @@ -1272,9 +1328,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-and-test "${CMake_SOURCE_DIR}/Tests/MakeClean" "${CMake_BINARY_DIR}/Tests/MakeClean" - --build-generator ${CMAKE_TEST_GENERATOR} + ${build_generator_args} --build-project MakeClean - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --build-exe-dir "${CMake_BINARY_DIR}/MakeClean" --test-command check_clean ) @@ -1378,9 +1433,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ "${CMake_SOURCE_DIR}/Tests/MFC" "${CMake_BINARY_DIR}/Tests/MFC" --build-two-config - --build-generator ${CMAKE_TEST_GENERATOR} + ${build_generator_args} --build-project mfc_driver - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --test-command ${CMAKE_CTEST_COMMAND} -C \${CTEST_CONFIGURATION_TYPE} -VV) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/MFC") @@ -1396,9 +1450,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ "${CMake_SOURCE_DIR}/Tests/VSExternalInclude" "${CMake_BINARY_DIR}/Tests/VSExternalInclude" --build-two-config - --build-generator ${CMAKE_TEST_GENERATOR} + ${build_generator_args} --build-project VSExternalInclude - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --test-command VSExternalInclude) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSExternalInclude") @@ -1407,11 +1460,38 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ "${CMake_SOURCE_DIR}/Tests/VSMidl" "${CMake_BINARY_DIR}/Tests/VSMidl" --build-two-config - --build-generator ${CMAKE_TEST_GENERATOR} + ${build_generator_args} --build-project VSMidl - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --test-command VSMidl) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSMidl") + + if(NOT MSVC60 AND NOT CMAKE_TEST_MAKEPROGRAM MATCHES "[mM][sS][bB][uU][iI][lL][dD]\\.[eE][xX][eE]") + # The test (and tested property) works with .sln files, so it's skipped when: + # * Using VS6, which doesn't use .sln files + # * cmake --build is set up to use MSBuild, since the MSBuild invocation does not use the .sln file + set(_last_test "") + foreach(config ${CMAKE_CONFIGURATION_TYPES}) + add_test(NAME VSExcludeFromDefaultBuild-${config} COMMAND ${CMAKE_CTEST_COMMAND} + --build-and-test + "${CMake_SOURCE_DIR}/Tests/VSExcludeFromDefaultBuild" + "${CMake_BINARY_DIR}/Tests/VSExcludeFromDefaultBuild" + --build-config ${config} + --build-two-config + ${build_generator_args} + --build-project VSExcludeFromDefaultBuild + --test-command ${CMAKE_COMMAND} + -D "activeConfig=${config}" + -D "allConfigs=${CMAKE_CONFIGURATION_TYPES}" + -D "dir=${CMake_BINARY_DIR}/Tests/VSExcludeFromDefaultBuild" + -P "${CMake_SOURCE_DIR}/Tests/VSExcludeFromDefaultBuild/ResultTest.cmake") + if(_last_test) + set_property(TEST VSExcludeFromDefaultBuild-${config} PROPERTY DEPENDS ${_last_test}) + endif() + set(_last_test "VSExcludeFromDefaultBuild-${config}") + endforeach() + unset(_last_test) + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSExcludeFromDefaultBuild") + endif() endif() if (APPLE) @@ -1423,8 +1503,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ "${CMake_SOURCE_DIR}/Tests/BundleTest" "${CMake_BINARY_DIR}/Tests/BundleTest" --build-two-config - --build-generator ${CMAKE_TEST_GENERATOR} - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} + ${build_generator_args} --build-project BundleTest --build-target install # --build-target package @@ -1439,8 +1518,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ "${CMake_SOURCE_DIR}/Tests/CFBundleTest" "${CMake_BINARY_DIR}/Tests/CFBundleTest" --build-two-config - --build-generator ${CMAKE_TEST_GENERATOR} - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} + ${build_generator_args} --build-project CFBundleTest --test-command ${CMAKE_CMAKE_COMMAND} -DCTEST_CONFIGURATION_TYPE=\${CTEST_CONFIGURATION_TYPE} @@ -1459,8 +1537,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ "${CMake_SOURCE_DIR}/Tests/BundleGeneratorTest" "${CMake_BINARY_DIR}/Tests/BundleGeneratorTest" --build-two-config - --build-generator ${CMAKE_TEST_GENERATOR} - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} + ${build_generator_args} --build-project BundleGeneratorTest --build-target package --build-options "-DCMAKE_INSTALL_PREFIX:PATH=${CMake_BINARY_DIR}/Tests/BundleGeneratorTest/InstallDirectory" @@ -1472,8 +1549,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-and-test "${CMake_SOURCE_DIR}/Tests/VariableUnusedViaSet" "${CMake_BINARY_DIR}/Tests/WarnUnusedUnusedViaSet" - --build-generator ${CMAKE_TEST_GENERATOR} - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} + ${build_generator_args} --build-noclean --build-project WarnUnusedUnusedViaSet --build-options "--warn-unused-vars") @@ -1487,8 +1563,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-and-test "${CMake_SOURCE_DIR}/Tests/VariableUnusedViaUnset" "${CMake_BINARY_DIR}/Tests/WarnUnusedUnusedViaUnset" - --build-generator ${CMAKE_TEST_GENERATOR} - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} + ${build_generator_args} --build-noclean --build-project WarnUnusedUnusedViaUnset --build-options "--warn-unused-vars") @@ -1502,8 +1577,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-and-test "${CMake_SOURCE_DIR}/Tests/VariableUsage" "${CMake_BINARY_DIR}/Tests/WarnUnusedCliUnused" - --build-generator ${CMAKE_TEST_GENERATOR} - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} + ${build_generator_args} --build-noclean --build-project WarnUnusedCliUnused --build-options "-DUNUSED_CLI_VARIABLE=Unused") @@ -1515,8 +1589,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-and-test "${CMake_SOURCE_DIR}/Tests/VariableUsage" "${CMake_BINARY_DIR}/Tests/WarnUnusedCliUsed" - --build-generator ${CMAKE_TEST_GENERATOR} - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} + ${build_generator_args} --build-noclean --build-project WarnUnusedCliUsed --build-options "-DUSED_VARIABLE=Usage proven") @@ -1530,8 +1603,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-and-test "${CMake_SOURCE_DIR}/Tests/VariableUsage" "${CMake_BINARY_DIR}/Tests/WarnUninitialized" - --build-generator ${CMAKE_TEST_GENERATOR} - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} + ${build_generator_args} --build-noclean --build-project WarnUninitialized --build-options "--warn-uninitialized") @@ -1543,9 +1615,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-and-test "${CMake_SOURCE_DIR}/Tests/TestsWorkingDirectory" "${CMake_BINARY_DIR}/Tests/TestsWorkingDirectory" - --build-generator ${CMAKE_TEST_GENERATOR} + ${build_generator_args} --build-project TestsWorkingDirectoryProj - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --build-exe-dir "${CMake_BINARY_DIR}/Tests/TestsWorkingDirectory" --force-new-ctest-process --test-command ${CMAKE_CTEST_COMMAND} -V -C \${CTEST_CONFIGURATION_TYPE} @@ -1834,6 +1905,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ ) ADD_TEST_MACRO(CMakeCommands.target_link_libraries target_link_libraries) + ADD_TEST_MACRO(CMakeCommands.target_include_directories target_include_directories) + ADD_TEST_MACRO(CMakeCommands.target_compile_definitions target_compile_definitions) configure_file( "${CMake_SOURCE_DIR}/Tests/CTestTestCrash/test.cmake.in" @@ -1878,6 +1951,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --output-log "${CMake_BINARY_DIR}/Tests/CTestTestParallel/testOutput.log" ) + set(CTestLimitDashJ_EXTRA_OPTIONS --force-new-ctest-process) + add_test_macro(CTestLimitDashJ ${CMAKE_CTEST_COMMAND} -j 4 + --output-on-failure -C "\${CTestTest_CONFIG}") + add_test(CTestTestPrintLabels ${CMAKE_CTEST_COMMAND} --print-labels) set_tests_properties(CTestTestPrintLabels PROPERTIES LABELS "Label1;Label2") set_tests_properties(CTestTestPrintLabels PROPERTIES PASS_REGULAR_EXPRESSION @@ -2157,9 +2234,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-and-test "${CMake_SOURCE_DIR}/Tests/Fortran" "${CMake_BINARY_DIR}/Tests/Fortran" - --build-generator ${CMAKE_TEST_GENERATOR} + ${build_generator_args} --build-project testf - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --build-two-config --test-command testf) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Fortran") @@ -2176,9 +2252,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-and-test "${CMake_SOURCE_DIR}/Tests/FortranC" "${CMake_BINARY_DIR}/Tests/FortranC" - --build-generator ${CMAKE_TEST_GENERATOR} + ${build_generator_args} --build-project FortranC - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --build-two-config --test-command CMakeFiles/FortranCInterface/FortranCInterface) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/FortranC") @@ -2199,9 +2274,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-and-test "${CMake_SOURCE_DIR}/Tests/Java" "${CMake_BINARY_DIR}/Tests/Java" - --build-generator ${CMAKE_TEST_GENERATOR} + ${build_generator_args} --build-project hello - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --build-two-config --build-run-dir "${CMake_BINARY_DIR}/Tests/Java/" --test-command ${JAVA_RUNTIME} -classpath hello.jar HelloWorld) @@ -2221,9 +2295,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-and-test "${CMake_SOURCE_DIR}/Tests/SimpleCOnly" "${CMake_BINARY_DIR}/Tests/SimpleCOnly_sdcc" - --build-generator ${CMAKE_TEST_GENERATOR} + ${build_generator_args} --build-project SimpleC - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --build-options "-DCMAKE_SYSTEM_NAME=Generic" "-DCMAKE_C_COMPILER=${SDCC_EXECUTABLE}") @@ -2240,9 +2313,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-and-test "${CMake_SOURCE_DIR}/Tests/Simple" "${CMake_BINARY_DIR}/Tests/Simple_Mingw_Linux2Win" - --build-generator ${CMAKE_TEST_GENERATOR} + ${build_generator_args} --build-project Simple - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --build-options "-DCMAKE_SYSTEM_NAME=Windows" "-DCMAKE_C_COMPILER=${MINGW_CC_LINUX2WIN_EXECUTABLE}" @@ -2339,7 +2411,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ if(TEST_CompileCommandOutput) set(CompileCommandOutput_EXTRA_OPTIONS - --build-options -DMAKE_SUPPORTS_SPACES=${MAKE_IS_GNU}) + --build-options -DMAKE_SUPPORTS_SPACES=${MAKE_SUPPORTS_SPACES}) ADD_TEST_MACRO(CompileCommandOutput "${CMake_BINARY_DIR}/Tests/CMakeLib/runcompilecommands") endif() @@ -2349,9 +2421,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ "${CMake_SOURCE_DIR}/Tests/IncludeDirectories" "${CMake_BINARY_DIR}/Tests/IncludeDirectories" --build-two-config - --build-generator ${CMAKE_TEST_GENERATOR} + ${build_generator_args} --build-project IncludeDirectories - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --test-command IncludeDirectories) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/IncludeDirectories") @@ -2368,6 +2439,6 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ set_tests_properties(KWStyle PROPERTIES WORKING_DIRECTORY ${CMake_BINARY_DIR}/Utilities/KWStyle) endif() -endif() -subdirs(CMakeTests) + add_subdirectory(CMakeTests) +endif() |