diff options
author | David Cole <david.cole@kitware.com> | 2010-03-08 17:14:47 (GMT) |
---|---|---|
committer | David Cole <david.cole@kitware.com> | 2010-03-08 18:25:58 (GMT) |
commit | a61c5ab6e59a458ad34383e64d0679a7fe898c61 (patch) | |
tree | 48b29a4098c425fcd826bb63aee3c23bfca4adf9 /Tests/CMakeLists.txt | |
parent | a9ac761938441fc2e86314c8200f7f39a3c2c6c3 (diff) | |
download | CMake-a61c5ab6e59a458ad34383e64d0679a7fe898c61.zip CMake-a61c5ab6e59a458ad34383e64d0679a7fe898c61.tar.gz CMake-a61c5ab6e59a458ad34383e64d0679a7fe898c61.tar.bz2 |
Add CMAKE_TESTS_CDASH_SERVER variable and CTestSubmitLargeOutput test.
If defined and non-empty, the value of CMAKE_TESTS_CDASH_SERVER should point
to a CDash server willing to accept submissions for a project named
PublicDashboard. On machines that also run a CDash dashboard, set this
variable to "http://localhost/CDash-trunk-Testing" so that the CMake tests
that submit dashboards do not have to send those submissions over the wire.
The CTestSubmitLargeOutput test runs a dashboard that has a test that produces
very large amount of output on stdout/stderr. Since we do not even want to
attempt to send such large output over the wire, this test is off by default
unless the CMAKE_TESTS_CDASH_SERVER server is localhost. This test is expected
to cause a submission failure when sent to CDash. It passes if the submit
results contain error output. It fails if the submit succeeds.
CMAKE_TESTS_CDASH_SERVER: CDash server used by CMake/Tests.
If not defined or "", this variable defaults to the server at
http://www.cdash.org/CDash.
If set explicitly to "NOTFOUND", curl tests and ctest tests that use the
network are skipped.
If set to something starting with "http://localhost/", the CDash is expected
to be an instance of CDash used for CDash testing, pointing to a
cdash4simpletest database. In these cases, the CDash dashboards should be
run first.
Diffstat (limited to 'Tests/CMakeLists.txt')
-rw-r--r-- | Tests/CMakeLists.txt | 50 |
1 files changed, 47 insertions, 3 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 7bc8b33..6a08b3c 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1393,26 +1393,45 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ endforeach() - IF (CTEST_TEST_CTEST AND CMAKE_RUN_LONG_TESTS) + IF (CMAKE_TESTS_CDASH_SERVER) + SET(regex "^([^:]+)://([^/]+)(/.*)$") + + IF ("${CMAKE_TESTS_CDASH_SERVER}" MATCHES "${regex}") + SET(protocol "${CMAKE_MATCH_1}") + SET(server "${CMAKE_MATCH_2}") + SET(path "${CMAKE_MATCH_3}") + ELSE ("${CMAKE_TESTS_CDASH_SERVER}" MATCHES "${regex}") + SET(protocol "http") + SET(server "www.cdash.org") + SET(path "/CDash") + MESSAGE("warning: CMAKE_TESTS_CDASH_SERVER does not match expected regex...") + MESSAGE(" ...using default url='${protocol}://${server}${path}' for CTestTest[23]") + ENDIF ("${CMAKE_TESTS_CDASH_SERVER}" MATCHES "${regex}") + ENDIF (CMAKE_TESTS_CDASH_SERVER) + + + IF (CTEST_TEST_CTEST AND CMAKE_RUN_LONG_TESTS AND CMAKE_TESTS_CDASH_SERVER) CONFIGURE_FILE("${CMake_SOURCE_DIR}/Tests/CTestTest/test.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestTest/test.cmake" @ONLY ESCAPE_QUOTES) ADD_TEST(CTestTest ${CMAKE_CTEST_COMMAND} -S "${CMake_BINARY_DIR}/Tests/CTestTest/test.cmake" -V --output-log "${CMake_BINARY_DIR}/Tests/CTestTest/testOutput.log" ) + CONFIGURE_FILE("${CMake_SOURCE_DIR}/Tests/CTestTest2/test.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestTest2/test.cmake" @ONLY ESCAPE_QUOTES) ADD_TEST(CTestTest2 ${CMAKE_CTEST_COMMAND} -S "${CMake_BINARY_DIR}/Tests/CTestTest2/test.cmake" -V --output-log "${CMake_BINARY_DIR}/Tests/CTestTest2/testOutput.log" ) + CONFIGURE_FILE("${CMake_SOURCE_DIR}/Tests/CTestTest3/test.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestTest3/test.cmake" @ONLY ESCAPE_QUOTES) ADD_TEST(CTestTest3 ${CMAKE_CTEST_COMMAND} -S "${CMake_BINARY_DIR}/Tests/CTestTest3/test.cmake" -V --output-log "${CMake_BINARY_DIR}/Tests/CTestTest3/testOutput.log" ) - + # 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) @@ -1432,7 +1451,32 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ SET_TESTS_PROPERTIES ( CTestTest3 PROPERTIES TIMEOUT ${CMAKE_LONG_TEST_TIMEOUT}) ENDIF ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND) - ENDIF (CTEST_TEST_CTEST AND CMAKE_RUN_LONG_TESTS) + 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") + ENDIF(CTEST_RUN_CTestSubmitLargeOutput) IF (CMAKE_RUN_LONG_TESTS AND TEST_KDE4_STABLE_BRANCH) IF(UNIX) |