diff options
Diffstat (limited to 'Tests')
25 files changed, 253 insertions, 116 deletions
diff --git a/Tests/CMakeInstall.cmake b/Tests/CMakeInstall.cmake index f141b53..dabc852 100644 --- a/Tests/CMakeInstall.cmake +++ b/Tests/CMakeInstall.cmake @@ -33,7 +33,7 @@ if(CMake_TEST_INSTALL) add_test(CMake.Install ${CMake_TEST_INSTALL_CTest} ${CMake_TEST_INSTALL_CONFIG} - --build-and-test ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} + --build-and-test ${CMake_SOURCE_DIR} ${CMake_BINARY_DIR} --build-generator ${CMAKE_GENERATOR} # Not CMAKE_TEST_GENERATOR --build-project CMake --build-makeprogram ${CMAKE_MAKE_PROGRAM} # Not CMAKE_TEST_MAKEPROGRAM diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 2c7056d..8e8d0ca 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -404,7 +404,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ # --test-command t4 #--test-command "${CMAKE_COMMAND}" #"-DCONFIGURATION=\${CTEST_CONFIGURATION_TYPE}" - #-P "${CMAKE_BINARY_DIR}/Tests/SimpleExclude/run.cmake" + #-P "${CMake_BINARY_DIR}/Tests/SimpleExclude/run.cmake" #) # ADD_TEST(SameName ${CMAKE_CTEST_COMMAND} @@ -1051,7 +1051,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-target install # --build-target package --build-options "-DCMAKE_INSTALL_PREFIX:PATH=${BundleTestInstallDir}" - "-DCMake_SOURCE_DIR:PATH=${CMAKE_SOURCE_DIR}" + "-DCMake_SOURCE_DIR:PATH=${CMake_SOURCE_DIR}" --test-command ${BundleTestInstallDir}/Applications/SecondBundleExe.app/Contents/MacOS/SecondBundleExe) LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BundleTest") @@ -1315,6 +1315,11 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --output-log "${CMake_BINARY_DIR}/Tests/CTestTestParallel/testOutput.log" ) + ADD_TEST(CTestTestPrintLabels ${CMAKE_CTEST_COMMAND} --print-labels) + SET_TESTS_PROPERTIES(CTestTestPrintLabels PROPERTIES LABELS "Label1;Label2") + SET_TESTS_PROPERTIES(CTestTestPrintLabels PROPERTIES PASS_REGULAR_EXPRESSION + "All Labels:.* Label1.* Label2") + CONFIGURE_FILE( "${CMake_SOURCE_DIR}/Tests/CTestTestResourceLock/test.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestTestResourceLock/test.cmake" @@ -1373,7 +1378,29 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ ) SET_TESTS_PROPERTIES(CTestTestTimeout PROPERTIES PASS_REGULAR_EXPRESSION "TestTimeout *\\.+ *\\*\\*\\*Timeout.*CheckChild *\\.+ *Passed") - + + CONFIGURE_FILE( + "${CMake_SOURCE_DIR}/Tests/CTestTestDepends/test.cmake.in" + "${CMake_BINARY_DIR}/Tests/CTestTestDepends/test.cmake" + @ONLY ESCAPE_QUOTES) + ADD_TEST(CTestTestDepends ${CMAKE_CTEST_COMMAND} + -C "\${CTestTest_CONFIG}" + -S "${CMake_BINARY_DIR}/Tests/CTestTestDepends/test.cmake" -V + --output-log "${CMake_BINARY_DIR}/Tests/CTestTestDepends/testOutput.log" + ) + + CONFIGURE_FILE( + "${CMake_SOURCE_DIR}/Tests/CTestTestCycle/test.cmake.in" + "${CMake_BINARY_DIR}/Tests/CTestTestCycle/test.cmake" + @ONLY ESCAPE_QUOTES) + ADD_TEST(CTestTestCycle ${CMAKE_CTEST_COMMAND} + -C "\${CTestTest_CONFIG}" + -S "${CMake_BINARY_DIR}/Tests/CTestTestCycle/test.cmake" -V + --output-log "${CMake_BINARY_DIR}/Tests/CTestTestCycle/testOutput.log" + ) + SET_TESTS_PROPERTIES(CTestTestCycle PROPERTIES + PASS_REGULAR_EXPRESSION "a cycle exists in the test dependency graph") + CONFIGURE_FILE( "${CMake_SOURCE_DIR}/Tests/CTestTestRunScript/test.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestTestRunScript/test.cmake" @@ -1410,9 +1437,11 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ set(regex "${regex}|Error message was: ") set(regex "${regex}([Cc]ould *n.t resolve host") set(regex "${regex}|[Cc]ould *n.t connect to host") + set(regex "${regex}|Empty reply from server") set(regex "${regex}|The requested URL returned error") set(regex "${regex}|libcurl was built with SSL disabled. https: not supported)") set(regex "${regex}|Submission method .xmlrpc. not compiled into CTest") + set(regex "${regex}|Submission problem") set(regex "${regex}|Submission successful)") set(ctest_coverage_labels_args "") @@ -1470,6 +1499,17 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --output-log "${CMake_BINARY_DIR}/Tests/CTestTest2/testOutput.log" ) + CONFIGURE_FILE("${CMake_SOURCE_DIR}/Tests/CTestTestChecksum/test.cmake.in" + "${CMake_BINARY_DIR}/Tests/CTestTestChecksum/test.cmake" @ONLY + ESCAPE_QUOTES) + ADD_TEST(CTestTestChecksum ${CMAKE_CTEST_COMMAND} + -S "${CMake_BINARY_DIR}/Tests/CTestTestChecksum/test.cmake" -V + --output-log + "${CMake_BINARY_DIR}/Tests/CTestTestChecksum/testOutput.log" + ) + SET_TESTS_PROPERTIES(CTestTestChecksum PROPERTIES PASS_REGULAR_EXPRESSION + "Submission failed: Checksum failed for file") + # these tests take a long time, make sure they have it # if timeouts have not already been set GET_TEST_PROPERTY(CTestTest TIMEOUT PREVIOUS_TIMEOUT) @@ -1485,36 +1525,6 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ ENDIF ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND) ENDIF (CTEST_TEST_CTEST AND CMAKE_RUN_LONG_TESTS AND CMAKE_TESTS_CDASH_SERVER) - IF(NOT DEFINED CTEST_RUN_CTestSubmitLargeOutput) - SET(CTEST_RUN_CTestSubmitLargeOutput OFF) - - IF (CMAKE_TESTS_CDASH_SERVER AND "${server}" STREQUAL "localhost") - SET(CTEST_RUN_CTestSubmitLargeOutput ON) - ENDIF (CMAKE_TESTS_CDASH_SERVER AND "${server}" STREQUAL "localhost") - ENDIF(NOT DEFINED CTEST_RUN_CTestSubmitLargeOutput) - - IF(CTEST_RUN_CTestSubmitLargeOutput) - CONFIGURE_FILE( - "${CMake_SOURCE_DIR}/Tests/CTestSubmitLargeOutput/test.cmake.in" - "${CMake_BINARY_DIR}/Tests/CTestSubmitLargeOutput/test.cmake" - @ONLY ESCAPE_QUOTES - ) - ADD_TEST(CTestSubmitLargeOutput ${CMAKE_CTEST_COMMAND} - -S "${CMake_BINARY_DIR}/Tests/CTestSubmitLargeOutput/test.cmake" -V - --output-log "${CMake_BINARY_DIR}/Tests/CTestSubmitLargeOutput/testOutput.log" - ) - - # This test only passes if it fails to submit properly... - # - SET_TESTS_PROPERTIES(CTestSubmitLargeOutput PROPERTIES - PASS_REGULAR_EXPRESSION "Errors occurred during submission") - - # Give this test plenty of time to run on slower machines: - # - SET_TESTS_PROPERTIES(CTestSubmitLargeOutput PROPERTIES - TIMEOUT ${CMAKE_LONG_TEST_TIMEOUT}) - ENDIF(CTEST_RUN_CTestSubmitLargeOutput) - IF (CMAKE_RUN_LONG_TESTS AND TEST_KDE4_STABLE_BRANCH) IF(UNIX) IF(NOT QT4_FOUND) @@ -1555,10 +1565,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ IF("${CMAKE_TEST_GENERATOR}" MATCHES Xcode) SET(CMAKE_SKIP_BOOTSTRAP_TEST 1) ENDIF("${CMAKE_TEST_GENERATOR}" MATCHES Xcode) - IF(EXISTS "${CMAKE_BINARY_DIR}/CMakeLists.txt") + IF(EXISTS "${CMake_BINARY_DIR}/CMakeLists.txt") # If there is CMakeLists.txt in the binary tree, assume in-source build SET(CMAKE_SKIP_BOOTSTRAP_TEST 1) - ENDIF(EXISTS "${CMAKE_BINARY_DIR}/CMakeLists.txt") + ENDIF(EXISTS "${CMake_BINARY_DIR}/CMakeLists.txt") SET(bootstrap "") IF(CMAKE_RUN_LONG_TESTS AND NOT CMAKE_SKIP_BOOTSTRAP_TEST) IF(UNIX) @@ -1730,14 +1740,14 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ # If this is not an in-source build, provide a target to wipe out # all the test build directories. - IF(NOT EXISTS "${CMAKE_BINARY_DIR}/CMakeLists.txt") + IF(NOT EXISTS "${CMake_BINARY_DIR}/CMakeLists.txt") CONFIGURE_FILE(${CMake_SOURCE_DIR}/Tests/test_clean.cmake.in ${CMake_BINARY_DIR}/Tests/test_clean.cmake @ONLY) ADD_CUSTOM_TARGET(test_clean COMMAND ${CMAKE_COMMAND} -P ${CMake_BINARY_DIR}/Tests/test_clean.cmake COMMENT "Removing test build directories." ) - ENDIF(NOT EXISTS "${CMAKE_BINARY_DIR}/CMakeLists.txt") + ENDIF(NOT EXISTS "${CMake_BINARY_DIR}/CMakeLists.txt") ADD_TEST(CMakeWizardTest ${CMAKE_CMAKE_COMMAND} -D build_dir:STRING=${CMAKE_CURRENT_BINARY_DIR}/CMakeWizardTest diff --git a/Tests/CMakeTests/CheckSourceTreeTest.cmake.in b/Tests/CMakeTests/CheckSourceTreeTest.cmake.in index 9150aef..73f8b01 100644 --- a/Tests/CMakeTests/CheckSourceTreeTest.cmake.in +++ b/Tests/CMakeTests/CheckSourceTreeTest.cmake.in @@ -149,26 +149,77 @@ if(is_git_checkout AND NOT GIT_EXECUTABLE) # from it: # if(ctest_ini_file) - file(STRINGS "${ctest_ini_file}" lines REGEX "^GITCommand: (.*)$") - string(REGEX REPLACE "^GITCommand: (.*)$" "\\1" exe "${lines}") + file(STRINGS "${ctest_ini_file}" line REGEX "^GITCommand: (.*)$") + string(REGEX REPLACE "^GITCommand: (.*)$" "\\1" line "${line}") + if("${line}" MATCHES "^\"") + string(REGEX REPLACE "^\"([^\"]+)\" *.*$" "\\1" line "${line}") + else() + string(REGEX REPLACE "^([^ ]+) *.*$" "\\1" line "${line}") + endif() + set(exe "${line}") if("${exe}" STREQUAL "GITCOMMAND-NOTFOUND") set(exe "") endif() + if(exe) + message("info: GIT_EXECUTABLE set by 'GITCommand:' from '${ctest_ini_file}'") + endif() if(NOT exe) - file(STRINGS "${ctest_ini_file}" lines REGEX "^UpdateCommand: (.*)$") - string(REGEX REPLACE "^UpdateCommand: (.*)$" "\\1" exe "${lines}") + file(STRINGS "${ctest_ini_file}" line REGEX "^UpdateCommand: (.*)$") + string(REGEX REPLACE "^UpdateCommand: (.*)$" "\\1" line "${line}") + if("${line}" MATCHES "^\"") + string(REGEX REPLACE "^\"([^\"]+)\" *.*$" "\\1" line "${line}") + else() + string(REGEX REPLACE "^([^ ]+) *.*$" "\\1" line "${line}") + endif() + set(exe "${line}") if("${exe}" STREQUAL "GITCOMMAND-NOTFOUND") set(exe "") endif() + if(exe) + message("info: GIT_EXECUTABLE set by 'UpdateCommand:' from '${ctest_ini_file}'") + endif() + endif() + else() + message("info: no DartConfiguration.tcl or CTestConfiguration.ini file...") + endif() + + # If we have still not grokked the exe, look in the Update.xml file to see + # if we can parse it from there... + # + if(NOT exe) + file(GLOB_RECURSE update_xml_file "${CMake_BINARY_DIR}/Testing/Update.xml") + if(update_xml_file) + file(STRINGS "${update_xml_file}" line + REGEX "^.*<UpdateCommand>(.*)</UpdateCommand>$" LIMIT_COUNT 1) + string(REPLACE ""\;" "\"" line "${line}") + string(REGEX REPLACE "^.*<UpdateCommand>(.*)</UpdateCommand>$" "\\1" line "${line}") + if("${line}" MATCHES "^\"") + string(REGEX REPLACE "^\"([^\"]+)\" *.*$" "\\1" line "${line}") + else() + string(REGEX REPLACE "^([^ ]+) *.*$" "\\1" line "${line}") + endif() + if(line) + set(exe "${line}") + endif() + if(exe) + message("info: GIT_EXECUTABLE set by '<UpdateCommand>' from '${update_xml_file}'") + endif() + else() + message("info: no Update.xml file...") endif() endif() if(exe) set(GIT_EXECUTABLE "${exe}") - message("info: set GIT_EXECUTABLE to '${GIT_EXECUTABLE}' based on '${ctest_ini_file}'") + message("GIT_EXECUTABLE='${GIT_EXECUTABLE}'") + message("") + + if(NOT EXISTS "${GIT_EXECUTABLE}") + message(FATAL_ERROR "GIT_EXECUTABLE does not exist...") + endif() else() - message(FATAL_ERROR "could not determine GIT_EXECUTABLE based on '${ctest_ini_file}'...") + message(FATAL_ERROR "could not determine GIT_EXECUTABLE...") endif() endif() diff --git a/Tests/CMakeTests/FindBaseTest.cmake.in b/Tests/CMakeTests/FindBaseTest.cmake.in index 02f7001..47c1692 100644 --- a/Tests/CMakeTests/FindBaseTest.cmake.in +++ b/Tests/CMakeTests/FindBaseTest.cmake.in @@ -55,7 +55,7 @@ if(NOT "${FOO_H_5}" STREQUAL "${_HEADER_FULL}") message(FATAL_ERROR "Did not find \"${_HEADER_FULL}\"\ngot ${FOO_H_5} instead !") endif(NOT "${FOO_H_5}" STREQUAL "${_HEADER_FULL}") -# by explicitely disabling CMAKE_FIND_ROOT_PATH again it shouldn't be found +# by explicitly disabling CMAKE_FIND_ROOT_PATH again it shouldn't be found find_file(FOO_H_6 ${_HEADER} NO_CMAKE_FIND_ROOT_PATH) if(FOO_H_6) message(FATAL_ERROR "${_HEADER} found: ${FOO_H_6}, it should not exist !") diff --git a/Tests/CMakeTests/ModuleNoticesTest.cmake.in b/Tests/CMakeTests/ModuleNoticesTest.cmake.in index 4d295ef..8ecebd3 100644 --- a/Tests/CMakeTests/ModuleNoticesTest.cmake.in +++ b/Tests/CMakeTests/ModuleNoticesTest.cmake.in @@ -3,7 +3,7 @@ # match any additional copyright holder notices. set(notice_regex " #============================================================================= -# Copyright (20[0-9][0-9]-)?20[0-9][0-9] Kitware[^\n]+( +# Copyright (20[0-9][0-9]-)?20[0-9][0-9] [^\n]+( # Copyright (20[0-9][0-9]-)?20[0-9][0-9] [^\n]+)* # # Distributed under the OSI-approved BSD License \\(the \"License\"\\); @@ -13,7 +13,7 @@ set(notice_regex " # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE\\. # See the License for more information\\. #============================================================================= -# \\(To distributed this file outside of CMake, substitute the full +# \\(To distribute this file outside of CMake, substitute the full # License text for the above reference.\\) ") string(REPLACE "\n" "\r?\n" notice_regex "${notice_regex}") diff --git a/Tests/CTestSubmitLargeOutput/CMakeLists.txt b/Tests/CTestSubmitLargeOutput/CMakeLists.txt deleted file mode 100644 index 6c30e7a..0000000 --- a/Tests/CTestSubmitLargeOutput/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 2.8) -project(SubmitLargeOutput NONE) - -include(CTest) - -add_test(GenerateRandomOutput ${CMAKE_COMMAND} - -P ${CMAKE_CURRENT_SOURCE_DIR}/GenerateRandomOutput.cmake - ) diff --git a/Tests/CTestSubmitLargeOutput/GenerateRandomOutput.cmake b/Tests/CTestSubmitLargeOutput/GenerateRandomOutput.cmake deleted file mode 100644 index c7f4f29..0000000 --- a/Tests/CTestSubmitLargeOutput/GenerateRandomOutput.cmake +++ /dev/null @@ -1,31 +0,0 @@ -# -# This script generates random lines of output. -# -# By default, it generates 100M of output (a million lines of 100 bytes each), -# but you can override that by passing in -D line_count and/or -D line_size... -# - -# Default values: -# -if(NOT DEFINED line_count) - set(line_count 1000000) -endif() - -if(NOT DEFINED line_size) - set(line_size 100) -endif() - -if(NOT DEFINED random_seed) - set(random_seed 1987) -endif() - -# Use RANDOM_SEED once before the loop: -# -string(RANDOM LENGTH ${line_size} RANDOM_SEED ${random_seed} s) - -# Emit line_count lines of random output: -# -foreach(i RANGE 1 ${line_count}) - string(RANDOM LENGTH ${line_size} s) - message(${s}) -endforeach() diff --git a/Tests/CTestSubmitLargeOutput/test.cmake.in b/Tests/CTestSubmitLargeOutput/test.cmake.in deleted file mode 100644 index 17a7c7d..0000000 --- a/Tests/CTestSubmitLargeOutput/test.cmake.in +++ /dev/null @@ -1,27 +0,0 @@ -SET(CTEST_SITE "@SITE@") -SET(CTEST_BUILD_NAME "LargeOutput-@BUILDNAME@") -SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") - -SET(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestSubmitLargeOutput") -SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestSubmitLargeOutput/build") -SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") - -CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY}) - -CTEST_START(Experimental) -CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) -CTEST_READ_CUSTOM_FILES("${CTEST_BINARY_DIRECTORY}") -CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) - -SET(CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE 1000000000) -SET(CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE 1000000000) -SET(CTEST_TEST_TIMEOUT @CMAKE_LONG_TEST_TIMEOUT@) - -CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) - -set(CTEST_DROP_METHOD "@protocol@") -set(CTEST_DROP_SITE "@server@") -set(CTEST_DROP_LOCATION "@path@/submit.php?project=PublicDashboard") - -CTEST_SUBMIT(RETURN_VALUE res) diff --git a/Tests/CTestTestChecksum/test.cmake.in b/Tests/CTestTestChecksum/test.cmake.in new file mode 100644 index 0000000..c3c41a5 --- /dev/null +++ b/Tests/CTestTestChecksum/test.cmake.in @@ -0,0 +1,28 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 2.1) + +# Settings: +SET(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") +SET(CTEST_SITE "@SITE@") +SET(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-Checksum") + +SET(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestParallel") +SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestParallel") +SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") +SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") +SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") +SET(CTEST_MEMORYCHECK_COMMAND "@MEMORYCHECK_COMMAND@") +SET(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "@MEMORYCHECK_SUPPRESSIONS_FILE@") +SET(CTEST_MEMORYCHECK_COMMAND_OPTIONS "@MEMORYCHECK_COMMAND_OPTIONS@") +SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") +SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") + +CTEST_START(Experimental) +CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) +CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) +CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res PARALLEL_LEVEL 4) + +SET(CTEST_DROP_METHOD "@protocol@") +SET(CTEST_DROP_SITE "@server@") +SET(CTEST_DROP_LOCATION "@path@/submit.php?project=PublicDashboard") + +CTEST_SUBMIT(RETRY_DELAY 3 RETRY_COUNT 2 INTERNAL_TEST_CHECKSUM RETURN_VALUE res) diff --git a/Tests/CTestTestCycle/CMakeLists.txt b/Tests/CTestTestCycle/CMakeLists.txt new file mode 100644 index 0000000..6ba6b8c --- /dev/null +++ b/Tests/CTestTestCycle/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required (VERSION 2.6) +project(CTestTestCycle) +include(CTest) + +add_executable (simple simple.cxx) +add_test (one simple) +add_test (two simple) +add_test (three simple) + +# Add cyclical test dependency +set_tests_properties(one PROPERTIES DEPENDS "two") +set_tests_properties(two PROPERTIES DEPENDS "three") +set_tests_properties(three PROPERTIES DEPENDS "one") diff --git a/Tests/CTestSubmitLargeOutput/CTestConfig.cmake b/Tests/CTestTestCycle/CTestConfig.cmake index ffd6efc..43e9986 100644 --- a/Tests/CTestSubmitLargeOutput/CTestConfig.cmake +++ b/Tests/CTestTestCycle/CTestConfig.cmake @@ -1,5 +1,6 @@ -set(CTEST_PROJECT_NAME "SubmitLargeOutput") -set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC") +set (CTEST_PROJECT_NAME "CTestTestCycle") +set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") +set (CTEST_DART_SERVER_VERSION "2") set(CTEST_DROP_METHOD "http") set(CTEST_DROP_SITE "www.cdash.org") set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard") diff --git a/Tests/CTestTestCycle/simple.cxx b/Tests/CTestTestCycle/simple.cxx new file mode 100644 index 0000000..766b775 --- /dev/null +++ b/Tests/CTestTestCycle/simple.cxx @@ -0,0 +1,5 @@ + +int main() +{ + return 0; +} diff --git a/Tests/CTestTestCycle/test.cmake.in b/Tests/CTestTestCycle/test.cmake.in new file mode 100644 index 0000000..a17adca --- /dev/null +++ b/Tests/CTestTestCycle/test.cmake.in @@ -0,0 +1,22 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 2.1) + +# Settings: +SET(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") +SET(CTEST_SITE "@SITE@") +SET(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-Cycle") + +SET(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestCycle") +SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestCycle") +SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") +SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") +SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") +SET(CTEST_MEMORYCHECK_COMMAND "@MEMORYCHECK_COMMAND@") +SET(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "@MEMORYCHECK_SUPPRESSIONS_FILE@") +SET(CTEST_MEMORYCHECK_COMMAND_OPTIONS "@MEMORYCHECK_COMMAND_OPTIONS@") +SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") +SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") + +CTEST_START(Experimental) +CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) +CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) +CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) diff --git a/Tests/CTestTestDepends/CMakeLists.txt b/Tests/CTestTestDepends/CMakeLists.txt new file mode 100644 index 0000000..26367a6 --- /dev/null +++ b/Tests/CTestTestDepends/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required (VERSION 2.6) +project(CTestTestDepends) +include(CTest) + +add_executable (simple simple.cxx) +add_test (one simple) +add_test (two simple) +add_test (three simple) + +# Add redundant (but not cyclical) dependencies +set_tests_properties(two PROPERTIES DEPENDS "one") +set_tests_properties(three PROPERTIES DEPENDS "one;two") diff --git a/Tests/CTestTestDepends/CTestConfig.cmake b/Tests/CTestTestDepends/CTestConfig.cmake new file mode 100644 index 0000000..e3af7dd --- /dev/null +++ b/Tests/CTestTestDepends/CTestConfig.cmake @@ -0,0 +1,7 @@ +set (CTEST_PROJECT_NAME "CTestTestDepends") +set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") +set (CTEST_DART_SERVER_VERSION "2") +set(CTEST_DROP_METHOD "http") +set(CTEST_DROP_SITE "www.cdash.org") +set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard") +set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestDepends/simple.cxx b/Tests/CTestTestDepends/simple.cxx new file mode 100644 index 0000000..766b775 --- /dev/null +++ b/Tests/CTestTestDepends/simple.cxx @@ -0,0 +1,5 @@ + +int main() +{ + return 0; +} diff --git a/Tests/CTestTestDepends/test.cmake.in b/Tests/CTestTestDepends/test.cmake.in new file mode 100644 index 0000000..ed4e182 --- /dev/null +++ b/Tests/CTestTestDepends/test.cmake.in @@ -0,0 +1,22 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 2.1) + +# Settings: +SET(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") +SET(CTEST_SITE "@SITE@") +SET(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-Depends") + +SET(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestDepends") +SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestDepends") +SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") +SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") +SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") +SET(CTEST_MEMORYCHECK_COMMAND "@MEMORYCHECK_COMMAND@") +SET(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "@MEMORYCHECK_SUPPRESSIONS_FILE@") +SET(CTEST_MEMORYCHECK_COMMAND_OPTIONS "@MEMORYCHECK_COMMAND_OPTIONS@") +SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") +SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") + +CTEST_START(Experimental) +CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) +CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) +CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) diff --git a/Tests/CTestUpdateGIT.cmake.in b/Tests/CTestUpdateGIT.cmake.in index f672a52..793b987 100644 --- a/Tests/CTestUpdateGIT.cmake.in +++ b/Tests/CTestUpdateGIT.cmake.in @@ -275,6 +275,11 @@ execute_process( WORKING_DIRECTORY \"${TOP}\" COMMAND \"${GIT}\" clone \"${REPO}\" dash-source ) + +# Test .git file. +file(RENAME \"${TOP}/dash-source/.git\" \"${TOP}/dash-source/repo.git\") +file(WRITE \"${TOP}/dash-source/.git\" \"gitdir: repo.git\n\") + execute_process( WORKING_DIRECTORY \"${TOP}/dash-source\" COMMAND \"${GIT}\" reset --hard ${revision1} diff --git a/Tests/CheckFortran.cmake b/Tests/CheckFortran.cmake index 8adcafc..ebbb426 100644 --- a/Tests/CheckFortran.cmake +++ b/Tests/CheckFortran.cmake @@ -9,7 +9,7 @@ # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # See the License for more information. #============================================================================= -# (To distributed this file outside of CMake, substitute the full +# (To distribute this file outside of CMake, substitute the full # License text for the above reference.) if(NOT DEFINED CMAKE_Fortran_COMPILER) diff --git a/Tests/Dependency/Four/CMakeLists.txt b/Tests/Dependency/Four/CMakeLists.txt index ba3711f..df0f162 100644 --- a/Tests/Dependency/Four/CMakeLists.txt +++ b/Tests/Dependency/Four/CMakeLists.txt @@ -1,3 +1,6 @@ +INCLUDE_DIRECTORIES(${Dependency_BINARY_DIR}/Two) ADD_LIBRARY( Four FourSrc.c ) TARGET_LINK_LIBRARIES( Four One Two NoDepA ) +# TwoCustom must build before Four. +ADD_DEPENDENCIES(Four TwoCustom) diff --git a/Tests/Dependency/Four/FourSrc.c b/Tests/Dependency/Four/FourSrc.c index e8fefcd..23a66a4 100644 --- a/Tests/Dependency/Four/FourSrc.c +++ b/Tests/Dependency/Four/FourSrc.c @@ -1,3 +1,4 @@ +#include <two-test.h> /* Requires TwoCustom to be built first. */ void NoDepAFunction(); void OneFunction(); void TwoFunction(); diff --git a/Tests/ExternalProject/CMakeLists.txt b/Tests/ExternalProject/CMakeLists.txt index 00db5d4..bf90a52 100644 --- a/Tests/ExternalProject/CMakeLists.txt +++ b/Tests/ExternalProject/CMakeLists.txt @@ -13,6 +13,7 @@ set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER set(base "${CMAKE_BINARY_DIR}/CMakeExternals") set(binary_base "${base}/Build") set_property(DIRECTORY PROPERTY EP_BASE ${base}) +set_property(DIRECTORY PROPERTY EP_STEP_TARGETS configure build test) if(NOT DEFINED can_build_tutorial_step5) set(can_build_tutorial_step5 1) @@ -80,6 +81,7 @@ ExternalProject_Add(${proj} DOWNLOAD_COMMAND "" INSTALL_COMMAND "" PATCH_COMMAND "" + STEP_TARGETS install update SVN_REPOSITORY "" SVN_REVISION "" TEST_COMMAND "" @@ -99,6 +101,7 @@ if(can_build_tutorial_step5) URL "${CMAKE_CURRENT_SOURCE_DIR}/../Tutorial/Step5" CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> -G ${CMAKE_GENERATOR} <SOURCE_DIR> TEST_BEFORE_INSTALL 1 + LOG_INSTALL 1 ) set_property(TARGET ${proj} PROPERTY FOLDER "Local") ExternalProject_Get_Property(${proj} install_dir) @@ -109,6 +112,7 @@ if(can_build_tutorial_step5) URL "${CMAKE_CURRENT_SOURCE_DIR}/../Tutorial/Step5" CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> -G ${CMAKE_GENERATOR} <SOURCE_DIR> TEST_AFTER_INSTALL 1 + LOG_TEST 1 ) set_property(TARGET ${proj} PROPERTY FOLDER "Local") endif() @@ -126,6 +130,7 @@ ExternalProject_Add(${proj} CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> -DTEST_LIST:STRING=A::B::C INSTALL_COMMAND "" + LOG_CONFIGURE 1 ) set_property(TARGET ${proj} PROPERTY FOLDER "Local/TAR") @@ -156,6 +161,7 @@ ExternalProject_Add(${proj} URL_MD5 38c648e817339c356f6be00eeed79bd0 CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> -G ${CMAKE_GENERATOR} <SOURCE_DIR> INSTALL_COMMAND "" + LOG_BUILD 1 ) set_property(TARGET ${proj} PROPERTY FOLDER "Local/TGZ") @@ -395,6 +401,7 @@ if(do_svn_tests) CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> INSTALL_COMMAND "" DEPENDS "SetupLocalSVNRepository" + LOG_DOWNLOAD 1 ) set_property(TARGET ${proj} PROPERTY FOLDER "SVN") endif() @@ -474,6 +481,7 @@ if(do_git_tests) CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> INSTALL_COMMAND "" DEPENDS "SetupLocalGITRepository" + LOG_UPDATE 1 ) set_property(TARGET ${proj} PROPERTY FOLDER "GIT") endif() diff --git a/Tests/FindPackageTest/CMakeLists.txt b/Tests/FindPackageTest/CMakeLists.txt index 74cc115..a472bea 100644 --- a/Tests/FindPackageTest/CMakeLists.txt +++ b/Tests/FindPackageTest/CMakeLists.txt @@ -54,6 +54,10 @@ SET(CMAKE_FIND_APPBUNDLE FIRST) # Set the wrong answer for a find to make sure it re-finds. set(VersionedA_DIR ${CMAKE_CURRENT_SOURCE_DIR}/lib/cmake/zot-4.0) +# Test that CMAKE_IGNORE_PATH can ignore the purposely bad package +# files in the lib/cmake/zot-3.1 directory. +set(CMAKE_IGNORE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/lib/cmake/zot-3.1) + # Look for packages with new-style signatures. FIND_PACKAGE(foo NO_MODULE) FIND_PACKAGE(Foo CONFIGS FooConfig.cmake) diff --git a/Tests/FindPackageTest/lib/cmake/zot-3.1/zot-config-version.cmake b/Tests/FindPackageTest/lib/cmake/zot-3.1/zot-config-version.cmake new file mode 100644 index 0000000..bee2f0e --- /dev/null +++ b/Tests/FindPackageTest/lib/cmake/zot-3.1/zot-config-version.cmake @@ -0,0 +1,4 @@ +# Claim to be any version to test that CMAKE_IGNORE_PATH hides us. +SET(PACKAGE_VERSION 3.1) +SET(PACKAGE_VERSION_COMPATIBLE 1) +SET(PACKAGE_VERSION_EXACT 1) diff --git a/Tests/FindPackageTest/lib/cmake/zot-3.1/zot-config.cmake b/Tests/FindPackageTest/lib/cmake/zot-3.1/zot-config.cmake new file mode 100644 index 0000000..2fbd525 --- /dev/null +++ b/Tests/FindPackageTest/lib/cmake/zot-3.1/zot-config.cmake @@ -0,0 +1,2 @@ +# Test config file. +message(WARNING "CMAKE_IGNORE_PATH failed to ignore this file!") |