From ed294c1664cafe573c813f2a95ebec3159e0d21e Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 22 Aug 2019 15:21:06 -0400 Subject: Add option to skip CMake tests that need network access --- CMakeLists.txt | 2 +- Tests/CMakeLists.txt | 22 ++++++++++++---------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3daebee..d6e7278 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -677,7 +677,7 @@ endif() # to a cdash4simpletest database. In these cases, the CDash dashboards # should be run first. # -if("x${CMAKE_TESTS_CDASH_SERVER}" STREQUAL "x") +if("x${CMAKE_TESTS_CDASH_SERVER}" STREQUAL "x" AND NOT CMake_TEST_NO_NETWORK) set(CMAKE_TESTS_CDASH_SERVER "http://open.cdash.org") endif() diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 34858b8..7098c75 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -2619,16 +2619,18 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH PASS_REGULAR_EXPRESSION "Could not find executable" FAIL_REGULAR_EXPRESSION "SegFault") - configure_file( - "${CMake_SOURCE_DIR}/Tests/CTestTestUpload/test.cmake.in" - "${CMake_BINARY_DIR}/Tests/CTestTestUpload/test.cmake" - @ONLY ESCAPE_QUOTES) - add_test(CTestTestUpload ${CMAKE_CTEST_COMMAND} - -S "${CMake_BINARY_DIR}/Tests/CTestTestUpload/test.cmake" -V - --output-log "${CMake_BINARY_DIR}/Tests/CTestTestUpload/testOut.log" - ) - set_tests_properties(CTestTestUpload PROPERTIES - PASS_REGULAR_EXPRESSION "Upload\\.xml") + if(NOT CMake_TEST_NO_NETWORK) + configure_file( + "${CMake_SOURCE_DIR}/Tests/CTestTestUpload/test.cmake.in" + "${CMake_BINARY_DIR}/Tests/CTestTestUpload/test.cmake" + @ONLY ESCAPE_QUOTES) + add_test(CTestTestUpload ${CMAKE_CTEST_COMMAND} + -S "${CMake_BINARY_DIR}/Tests/CTestTestUpload/test.cmake" -V + --output-log "${CMake_BINARY_DIR}/Tests/CTestTestUpload/testOut.log" + ) + set_tests_properties(CTestTestUpload PROPERTIES + PASS_REGULAR_EXPRESSION "Upload\\.xml") + endif() configure_file( "${CMake_SOURCE_DIR}/Tests/CTestCoverageCollectGCOV/test.cmake.in" -- cgit v0.12