From: <svn...@op...> - 2009-04-26 20:24:33
|
Author: scriptor Date: Sun Apr 26 22:24:26 2009 New Revision: 5627 URL: http://www.opensync.org/changeset/5627 Log: In my ongoing battle against cmake it turned out that the trivial task of assigning a value to a variable works in the way everybody expects it ONLY if one adds "FORCE" to the CMakeLists.txt/CTestConfig.cmake. If "FORCE" is omitted, the DART_TESTING_TIMEOUT will ALWAYS be set to 1500 on the first run of cmake, no matter what has been configured in CTestConfig.cmake or CMakeLists.txt. One would have to rerun cmake to get the configured values... Not to mention, that it is only DART_TESTING_TIMEOUT that seems to get noticed by cmake/ctest. And not, as most people would have expected it, CMAKE_CTEST_TIMEOUT. Modified: plugins/ldap-sync/CTestConfig.cmake plugins/ldap-sync/tests/CMakeLists.txt Modified: plugins/ldap-sync/CTestConfig.cmake ============================================================================== --- plugins/ldap-sync/CTestConfig.cmake Sun Apr 26 22:23:33 2009 (r5626) +++ plugins/ldap-sync/CTestConfig.cmake Sun Apr 26 22:24:26 2009 (r5627) @@ -12,14 +12,23 @@ set(CTEST_DROP_LOCATION "/testing/submit.php?project=ldap-sync") set(CTEST_DROP_SITE_CDASH TRUE) + +# Setting a custom timeout for ctest is a hassle. +# The only variable that seems to be considered by cmake/ctest is +# DART_TESTING_TIMEOUT. And this works ONLY, if one adds "FORCE". +# +# DART_TESTING_TIMEOUT must be set in CTestConfig.cmake rather than here. +# At least, it seems so... IF (RUN_LONG_TESTS) - set (TIMEOUT 3600) + SET ( TIMEOUT 3600 CACHE STRING "General timeout value." FORCE ) ELSE(RUN_LONG_TESTS) - set (TIMEOUT 300) + SET ( TIMEOUT 300 CACHE STRING "General timeout value." FORCE ) ENDIF(RUN_LONG_TESTS) -set (CTEST_TEST_TIMEOUT ${TIMEOUT}) -set (CMAKE_LONG_TEST_TIMEOUT ${TIMEOUT}) -set (DART_TESTING_TIMEOUT ${TIMEOUT}) -set (CTEST_TIME_LIMIT ${TIMEOUT}) +SET ( CTEST_TEST_TIMEOUT ${TIMEOUT} CACHE STRING "The most natural variable for a timeout setting does NOT work. Great!" FORCE ) +SET ( CMAKE_LONG_TEST_TIMEOUT ${TIMEOUT} CACHE STRING "Does not work, either." FORCE ) +SET ( DART_TESTING_TIMEOUT ${TIMEOUT} CACHE STRING "Is there really no other way to set a timeout to the tests run by ctest?" FORCE ) +SET ( CTEST_TIME_LIMIT ${TIMEOUT} CACHE STRING "Taken from ChangeLog.txt in cmake-2.6.2... No chance." FORCE ) + + Modified: plugins/ldap-sync/tests/CMakeLists.txt ============================================================================== --- plugins/ldap-sync/tests/CMakeLists.txt Sun Apr 26 22:23:33 2009 (r5626) +++ plugins/ldap-sync/tests/CMakeLists.txt Sun Apr 26 22:24:26 2009 (r5627) @@ -12,25 +12,22 @@ SET ( SCHEMADIR "${LDAP_PLUGIN_OPENSYNC_SCHEMASDIR}" CACHE STRING "Path where any *.xml files are located.") - -# Setting a custom timeout does not work, at all, either. Completely buggy. -# +# Setting a custom timeout for ctest is a hassle. # The only variable that seems to be considered by cmake/ctest is -# DART_TESTING_TIMEOUT. And even this variable does not get set until -# cmake is run for the second time. This is getting on my nerves. -# +# DART_TESTING_TIMEOUT. And this works ONLY, if one adds "FORCE". +# # DART_TESTING_TIMEOUT must be set in CTestConfig.cmake rather than here. -# At least, it seems so... +# At least, it seems so... IF (RUN_LONG_TESTS) - SET ( TIMEOUT 3600 CACHE STRING "General timeout value.") + SET ( TIMEOUT 3600 CACHE STRING "General timeout value." FORCE ) ELSE(RUN_LONG_TESTS) - SET ( TIMEOUT 300 CACHE STRING "General timeout value.") + SET ( TIMEOUT 300 CACHE STRING "General timeout value." FORCE ) ENDIF(RUN_LONG_TESTS) -SET ( CTEST_TEST_TIMEOUT ${TIMEOUT} CACHE STRING "The most natural variable for a timeout setting does not work. Great!") -SET ( CMAKE_LONG_TEST_TIMEOUT ${TIMEOUT} CACHE STRING "Does not work, either." ) -SET ( DART_TESTING_TIMEOUT ${TIMEOUT} CACHE STRING "Is there really no way to set a timeout to the tests run by ctest?") -SET ( CTEST_TIME_LIMIT ${TIMEOUT} CACHE STRING "Taken from ChangeLog.txt in cmake-2.6.2... No chance.") +SET ( CTEST_TEST_TIMEOUT ${TIMEOUT} CACHE STRING "The most natural variable for a timeout setting does NOT work. Great!" FORCE ) +SET ( CMAKE_LONG_TEST_TIMEOUT ${TIMEOUT} CACHE STRING "Does not work, either." FORCE ) +SET ( DART_TESTING_TIMEOUT ${TIMEOUT} CACHE STRING "Is there really no other way to set a timeout to the tests run by ctest?" FORCE ) +SET ( CTEST_TIME_LIMIT ${TIMEOUT} CACHE STRING "Taken from ChangeLog.txt in cmake-2.6.2... No chance." FORCE ) |