summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CMakeLists.txt27
-rw-r--r--Tests/CTestTestFailedSubmits/test.cmake.in44
2 files changed, 70 insertions, 1 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index f21efd7..aa1f607 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -1111,7 +1111,32 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=CVS -P ${CMake_SOURCE_DIR}/Utilities/Rel
PASS_REGULAR_EXPRESSION "\\*\\*\\*Timeout")
ADD_TEST(CTestTestShowOnly ${CMAKE_CTEST_COMMAND} -N)
-
+
+
+ function(add_failed_submit_test name source build in out log regex)
+ configure_file("${in}" "${out}" @ONLY)
+ add_test(${name} ${CMAKE_CTEST_COMMAND} -S "${out}" -V --output-log "${log}")
+ set_tests_properties(${name} PROPERTIES PASS_REGULAR_EXPRESSION "${regex}")
+ endfunction()
+
+ set(regex "(Problems when submitting via S*CP")
+ set(regex "${regex}|Error message was: ")
+ set(regex "${regex}(Couldn.t resolve host ")
+ set(regex "${regex}|libcurl was built with SSL disabled. https: not supported)")
+ set(regex "${regex}|Submission method .xmlrpc. not compiled into CTest)")
+
+ foreach(drop_method cp ftp http https scp xmlrpc)
+ add_failed_submit_test(CTestTestFailedSubmit-${drop_method}
+ "${CMake_SOURCE_DIR}/Tests/CTestTest/SmallAndFast"
+ "${CMake_BINARY_DIR}/Tests/CTestTestFailedSubmits/${drop_method}"
+ "${CMake_SOURCE_DIR}/Tests/CTestTestFailedSubmits/test.cmake.in"
+ "${CMake_BINARY_DIR}/Tests/CTestTestFailedSubmits/test-${drop_method}.cmake"
+ "${CMake_BINARY_DIR}/Tests/CTestTestFailedSubmits/test-${drop_method}.log"
+ "${regex}"
+ )
+ endforeach()
+
+
IF (CTEST_TEST_CTEST AND CMAKE_RUN_LONG_TESTS)
CONFIGURE_FILE("${CMake_SOURCE_DIR}/Tests/CTestTest/test.cmake.in"
"${CMake_BINARY_DIR}/Tests/CTestTest/test.cmake" @ONLY ESCAPE_QUOTES)
diff --git a/Tests/CTestTestFailedSubmits/test.cmake.in b/Tests/CTestTestFailedSubmits/test.cmake.in
new file mode 100644
index 0000000..ef723c9
--- /dev/null
+++ b/Tests/CTestTestFailedSubmits/test.cmake.in
@@ -0,0 +1,44 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
+
+# CTestConfig.cmake settings:
+set(CTEST_PROJECT_NAME "SmallAndFast")
+
+# Intentionally leave out other upload-related CTestConfig.cmake settings
+# so that the ctest_submit call below fails with an error message...
+#
+set(CTEST_DROP_METHOD "@drop_method@")
+
+# Settings:
+SET(CTEST_USE_LAUNCHERS 1)
+
+SET(CTEST_SITE "@SITE@")
+SET(CTEST_BUILD_NAME "CTestTestLaunchers-@drop_method@")
+
+SET(CTEST_SOURCE_DIRECTORY "@source@")
+SET(CTEST_BINARY_DIRECTORY "@build@")
+SET(CTEST_CVS_COMMAND "@CVSCOMMAND@")
+SET(CTEST_CMAKE_GENERATOR "@CMAKE_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_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY})
+
+CTEST_START(Experimental)
+
+# explicitly do not use CTEST_UPDATE - avoid network activity
+
+CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}"
+ OPTIONS "-DCTEST_USE_LAUNCHERS:BOOL=${CTEST_USE_LAUNCHERS}"
+ RETURN_VALUE res)
+CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+CTEST_COVERAGE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+
+# ok to call ctest_submit - still avoids network activity because there is
+# not a valid drop location given above...
+CTEST_SUBMIT(RETURN_VALUE res)