diff options
Diffstat (limited to 'Tests/CMakeLists.txt')
-rw-r--r-- | Tests/CMakeLists.txt | 67 |
1 files changed, 15 insertions, 52 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 7e7aa2e..08765de 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -102,6 +102,17 @@ if(BUILD_TESTING) list(APPEND build_options -DCMAKE_MAKE_PROGRAM:FILEPATH=${CMake_TEST_EXPLICIT_MAKE_PROGRAM}) endif() + # Look for rpmbuild to use for tests. + # The tool does not work with spaces in the path. + if(NOT CMAKE_CURRENT_BINARY_DIR MATCHES " ") + find_program(RPMBUILD_EXECUTABLE NAMES rpmbuild) + else() + set(RPMBUILD_EXECUTABLE "RPMBUILD_EXECUTABLE-NOTFOUND") + endif() + + #--------------------------------------------------------------------------- + # Add tests below here. + if(NOT CMake_TEST_EXTERNAL_CMAKE) add_subdirectory(CMakeLib) endif() @@ -826,11 +837,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release set(CTEST_package_X11_TEST ${CTEST_TEST_CPACK}) set(CTEST_RUN_CPackComponentsForAll ${CTEST_TEST_CPACK}) - if (CMAKE_SYSTEM_NAME MATCHES "Linux" AND NOT CMAKE_CURRENT_BINARY_DIR MATCHES " ") - find_program(RPMBUILD NAMES rpmbuild) - endif() # Do not try to build RPM - if (NOT RPMBUILD) + if (NOT RPMBUILD_EXECUTABLE) set(CPACK_BINARY_RPM OFF) endif() @@ -912,7 +920,6 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release if(CTEST_RUN_CPackComponentsForAll) # Check whether if rpmbuild command is found # before adding RPM tests - find_program(RPMBUILD_EXECUTABLE NAMES rpmbuild) if(RPMBUILD_EXECUTABLE) list(APPEND ACTIVE_CPACK_GENERATORS RPM) endif() @@ -931,11 +938,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release if(APPLE) list(APPEND GENLST "DragNDrop") endif() - if (NOT CMAKE_CURRENT_BINARY_DIR MATCHES " ") - list(FIND ACTIVE_CPACK_GENERATORS "RPM" RPM_ACTIVE) - if (NOT ${RPM_ACTIVE} EQUAL -1) - list(APPEND GENLST "RPM") - endif() + list(FIND ACTIVE_CPACK_GENERATORS "RPM" RPM_ACTIVE) + if (NOT ${RPM_ACTIVE} EQUAL -1) + list(APPEND GENLST "RPM") endif() list(FIND ACTIVE_CPACK_GENERATORS "DEB" DEB_ACTIVE) if (NOT ${DEB_ACTIVE} EQUAL -1) @@ -2738,48 +2743,6 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release --output-log "${CMake_BINARY_DIR}/Tests/CTestTestFdSetSize/testOutput.log" ) - 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}([Cc]ould *n.t resolve host") - set(regex "${regex}|[Cc]ould *n.t connect to host") - set(regex "${regex}|Failed *t*o* connect to") - set(regex "${regex}|Connection timed out after [0-9]+ milliseconds") - 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 "") - - foreach(drop_method cp ftp http https scp xmlrpc) - # Cycle through these values each time through the loop: - if(ctest_coverage_labels_args STREQUAL "") - set(ctest_coverage_labels_args "LABELS Everything") - elseif(ctest_coverage_labels_args STREQUAL "LABELS Everything") - set(ctest_coverage_labels_args "LABELS 0ArgTest") - else() - set(ctest_coverage_labels_args "") - endif() - - 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 (CMAKE_TESTS_CDASH_SERVER) set(regex "^([^:]+)://([^/]+)(.*)$") |