diff options
author | Brad King <brad.king@kitware.com> | 2011-01-04 20:46:07 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2011-01-04 20:46:07 (GMT) |
commit | 70950edde06305f9bfcb2f6bfd5442add72dc947 (patch) | |
tree | 7a7ddef4ac5ee6fa9b2b59a2f71779a25ffadf23 /Tests | |
parent | 45b61209f972cc6f1f644f14739a67c6fc530da7 (diff) | |
parent | 51bb49357495ea2742858ffe9d76ab3f44efc06e (diff) | |
download | CMake-70950edde06305f9bfcb2f6bfd5442add72dc947.zip CMake-70950edde06305f9bfcb2f6bfd5442add72dc947.tar.gz CMake-70950edde06305f9bfcb2f6bfd5442add72dc947.tar.bz2 |
Merge topic 'honor-explicit-zero-timeout'
51bb493 Test TIMEOUT property explicitly set to zero should be honored
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/CMakeLists.txt | 57 | ||||
-rw-r--r-- | Tests/CTestTestZeroTimeout/CMakeLists.txt | 8 | ||||
-rw-r--r-- | Tests/CTestTestZeroTimeout/CTestConfig.cmake | 7 | ||||
-rw-r--r-- | Tests/CTestTestZeroTimeout/sleep.c | 16 | ||||
-rw-r--r-- | Tests/CTestTestZeroTimeout/test.cmake.in | 23 |
5 files changed, 88 insertions, 23 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 6c937b0..c86accf 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -45,18 +45,18 @@ IF(BUILD_TESTING) SET(TEST_BUILD_DIRS) # Should the long tests be run? - OPTION(CMAKE_RUN_LONG_TESTS + OPTION(CMAKE_RUN_LONG_TESTS "Should the long tests be run (such as Bootstrap)." ON) MARK_AS_ADVANCED(CMAKE_RUN_LONG_TESTS) IF (CMAKE_RUN_LONG_TESTS) - OPTION(CTEST_TEST_CTEST - "Should the tests that run a full sub ctest process be run?" + OPTION(CTEST_TEST_CTEST + "Should the tests that run a full sub ctest process be run?" OFF) MARK_AS_ADVANCED(CTEST_TEST_CTEST) OPTION(TEST_KDE4_STABLE_BRANCH - "Should the KDE4 stable branch test be run?" + "Should the KDE4 stable branch test be run?" OFF) MARK_AS_ADVANCED(TEST_KDE4_STABLE_BRANCH) ENDIF (CMAKE_RUN_LONG_TESTS) @@ -228,7 +228,7 @@ IF(BUILD_TESTING) # If we are running right now with a UnixMakefiles based generator, # build the "Simple" test with the ExtraGenerators, if available - # This doesn't test whether the generated project files work (unfortunately), + # This doesn't test whether the generated project files work (unfortunately), # 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 @@ -299,10 +299,10 @@ IF(BUILD_TESTING) ADD_TEST(SubProject-Stage2 ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/SubProject/foo" - "${CMake_BINARY_DIR}/Tests/SubProject/foo" + "${CMake_BINARY_DIR}/Tests/SubProject/foo" --build-generator ${CMAKE_TEST_GENERATOR} --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} - --build-nocmake + --build-nocmake --build-project foo --build-target foo --test-command foo @@ -360,7 +360,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-generator ${CMAKE_TEST_GENERATOR} --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --build-project TargetName - --test-command ${CMAKE_CMAKE_COMMAND} -E compare_files + --test-command ${CMAKE_CMAKE_COMMAND} -E compare_files ${CMake_SOURCE_DIR}/Tests/TargetName/scripts/hello_world ${CMake_BINARY_DIR}/Tests/TargetName/scripts/hello_world) LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/TargetName") @@ -372,7 +372,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-two-config --build-generator ${CMAKE_TEST_GENERATOR} --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} - --build-project LibName + --build-project LibName --build-exe-dir "${CMake_BINARY_DIR}/Tests/LibName/lib" --test-command foobar ) @@ -385,7 +385,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-two-config --build-generator ${CMAKE_TEST_GENERATOR} --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} - --build-project CustComDepend + --build-project CustComDepend --build-exe-dir "${CMake_BINARY_DIR}/Tests/CustComDepend/bin" --test-command foo bar.c ) @@ -464,7 +464,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} ) LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BuildDepends") - + SET(SimpleInstallInstallDir "${CMake_BINARY_DIR}/Tests/SimpleInstall/InstallDirectory") ADD_TEST(SimpleInstall ${CMAKE_CTEST_COMMAND} @@ -897,7 +897,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ # RPATH isn't supported under Syllable, so the tests don't # find their libraries. In order to fix that LIBRARY_OUTPUT_DIR # in the tests would have to be adjusted to ${EXECUTABLE_OUTPUT_DIR}/lib . -# For now we just require on Syllable that the user adjusts the DLL_PATH +# For now we just require on Syllable that the user adjusts the DLL_PATH # environment variable, so except the two tests below all other tests will succeed. SET(_DLL_PATH "$ENV{DLL_PATH}") @@ -1006,14 +1006,14 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ # 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 + IF (MAKE_IS_GNU OR "${CMAKE_TEST_MAKEPROGRAM}" MATCHES "nmake|gmake|wmake" OR "${CMAKE_TEST_GENERATOR}" MATCHES "Visual Studio|XCode|Borland") ADD_TEST(SubDirSpaces ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/SubDirSpaces" "${CMake_BINARY_DIR}/Tests/SubDirSpaces" - --build-exe-dir + --build-exe-dir "${CMake_BINARY_DIR}/Tests/SubDirSpaces/Executable Sources" --build-generator ${CMAKE_TEST_GENERATOR} --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} @@ -1120,7 +1120,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ "${CMake_BINARY_DIR}/Tests/BundleGeneratorTest" --build-two-config --build-generator ${CMAKE_TEST_GENERATOR} - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} + --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --build-project BundleGeneratorTest --build-target package --build-options "-DCMAKE_INSTALL_PREFIX:PATH=${CMake_BINARY_DIR}/Tests/BundleGeneratorTest/InstallDirectory" @@ -1355,7 +1355,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ SET_TESTS_PROPERTIES(CTestTestCrash PROPERTIES PASS_REGULAR_EXPRESSION "SegFault") ENDIF(CMAKE_TEST_GENERATOR MATCHES "Watcom WMake") - + CONFIGURE_FILE( "${CMake_SOURCE_DIR}/Tests/CTestTestBadExe/test.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestTestBadExe/test.cmake" @@ -1433,7 +1433,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ #make sure all 3 subdirs were added SET_TESTS_PROPERTIES(CTestTestSubdir PROPERTIES PASS_REGULAR_EXPRESSION "0 tests failed out of 3") - + CONFIGURE_FILE( "${CMake_SOURCE_DIR}/Tests/CTestTestTimeout/test.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestTestTimeout/test.cmake" @@ -1447,6 +1447,17 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ PASS_REGULAR_EXPRESSION "TestTimeout *\\.+ *\\*\\*\\*Timeout.*CheckChild *\\.+ *Passed") CONFIGURE_FILE( + "${CMake_SOURCE_DIR}/Tests/CTestTestZeroTimeout/test.cmake.in" + "${CMake_BINARY_DIR}/Tests/CTestTestZeroTimeout/test.cmake" + @ONLY ESCAPE_QUOTES) + ADD_TEST(CTestTestZeroTimeout ${CMAKE_CTEST_COMMAND} + -S "${CMake_BINARY_DIR}/Tests/CTestTestZeroTimeout/test.cmake" -V + --output-log + "${CMake_BINARY_DIR}/Tests/CTestTestZeroTimeout/testOutput.log") + SET_TESTS_PROPERTIES(CTestTestZeroTimeout PROPERTIES + FAIL_REGULAR_EXPRESSION "\\*\\*\\*Timeout") + + CONFIGURE_FILE( "${CMake_SOURCE_DIR}/Tests/CTestTestDepends/test.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestTestDepends/test.cmake" @ONLY ESCAPE_QUOTES) @@ -1628,7 +1639,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ ENDIF(UNIX) ENDIF (CMAKE_RUN_LONG_TESTS AND TEST_KDE4_STABLE_BRANCH) - + IF("${CMAKE_TEST_GENERATOR}" MATCHES Xcode) SET(CMAKE_SKIP_BOOTSTRAP_TEST 1) ENDIF("${CMAKE_TEST_GENERATOR}" MATCHES Xcode) @@ -1655,7 +1666,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-noclean --build-makeprogram ${bootstrap} --build-generator "${CMAKE_TEST_GENERATOR}" - --test-command + --test-command ${CMake_BINARY_DIR}/Tests/BootstrapTest/Bootstrap.cmk/cmake) LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BootstrapTest") # Make this test run early during parallel execution @@ -1749,8 +1760,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ "-DCMAKE_C_COMPILER=${SDCC_EXECUTABLE}") LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SimpleCOnly_sdcc") ENDIF(SDCC_EXECUTABLE) - - + + FIND_PROGRAM(MINGW_CC_LINUX2WIN_EXECUTABLE i586-mingw32msvc-gcc) FIND_PROGRAM(MINGW_CXX_LINUX2WIN_EXECUTABLE i586-mingw32msvc-g++) MARK_AS_ADVANCED(MINGW_CC_LINUX2WIN_EXECUTABLE MINGW_CXX_LINUX2WIN_EXECUTABLE) @@ -1768,8 +1779,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ "-DCMAKE_CXX_COMPILER=${MINGW_CXX_LINUX2WIN_EXECUTABLE}") LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_Mingw_Linux2Win") ENDIF(MINGW_CC_LINUX2WIN_EXECUTABLE AND MINGW_CXX_LINUX2WIN_EXECUTABLE) - - + + ENDIF(CMAKE_TEST_GENERATOR MATCHES "Makefiles" OR CMAKE_TEST_GENERATOR MATCHES "KDevelop") IF(UNIX) diff --git a/Tests/CTestTestZeroTimeout/CMakeLists.txt b/Tests/CTestTestZeroTimeout/CMakeLists.txt new file mode 100644 index 0000000..8a5246d --- /dev/null +++ b/Tests/CTestTestZeroTimeout/CMakeLists.txt @@ -0,0 +1,8 @@ +CMAKE_MINIMUM_REQUIRED (VERSION 2.6) +PROJECT (CTestTestZeroTimeout) +INCLUDE (CTest) + +ADD_EXECUTABLE (Sleep sleep.c) + +ADD_TEST (TestExplicitZeroTimeout Sleep) +SET_TESTS_PROPERTIES(TestExplicitZeroTimeout PROPERTIES TIMEOUT 0) diff --git a/Tests/CTestTestZeroTimeout/CTestConfig.cmake b/Tests/CTestTestZeroTimeout/CTestConfig.cmake new file mode 100644 index 0000000..f8e0609 --- /dev/null +++ b/Tests/CTestTestZeroTimeout/CTestConfig.cmake @@ -0,0 +1,7 @@ +set(CTEST_PROJECT_NAME "CTestTestZeroTimeout") +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/CTestTestZeroTimeout/sleep.c b/Tests/CTestTestZeroTimeout/sleep.c new file mode 100644 index 0000000..d40d59d --- /dev/null +++ b/Tests/CTestTestZeroTimeout/sleep.c @@ -0,0 +1,16 @@ +#if defined(_WIN32) +# include <windows.h> +#else +# include <unistd.h> +#endif + +/* sleeps for 5 seconds */ +int main(int argc, char** argv) +{ +#if defined(_WIN32) + Sleep(5000); +#else + sleep(5); +#endif + return 0; +} diff --git a/Tests/CTestTestZeroTimeout/test.cmake.in b/Tests/CTestTestZeroTimeout/test.cmake.in new file mode 100644 index 0000000..0ff32a4 --- /dev/null +++ b/Tests/CTestTestZeroTimeout/test.cmake.in @@ -0,0 +1,23 @@ +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@-ZeroTimeout") + +SET(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestZeroTimeout") +SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestZeroTimeout") +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}") +SET(CTEST_TEST_TIMEOUT 2) + +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) |