Tests: Honor CMake_TEST_NO_NETWORK in RunCMake.file-DOWNLOAD

Most of the test uses `file://` URLs instead of hitting the network.
However, a case covering an invalid hostname does try to make a real
connection, expecting it to fail DNS resolution.  Turn off that case
if we are asked not to hit the network during testing.
This commit is contained in:
Brad King
2022-11-18 09:09:36 -05:00
parent 52b9c7b958
commit 28513a5fba
2 changed files with 5 additions and 2 deletions

View File

@@ -466,7 +466,7 @@ add_RunCMake_test(ctest_fixtures)
add_RunCMake_test(define_property)
add_RunCMake_test(file -DCYGWIN=${CYGWIN} -DMSYS=${MSYS})
add_RunCMake_test(file-CHMOD -DMSYS=${MSYS})
add_RunCMake_test(file-DOWNLOAD)
add_RunCMake_test(file-DOWNLOAD -DCMake_TEST_NO_NETWORK=${CMake_TEST_NO_NETWORK})
add_RunCMake_test(file-RPATH -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME})
add_RunCMake_test(find_file)
add_RunCMake_test(find_library -DCYGWIN=${CYGWIN} -DMSYS=${MSYS})

View File

@@ -14,10 +14,13 @@ run_cmake(tls-verify-not-set)
run_cmake(pass-not-set)
run_cmake(no-save-hash)
run_cmake(bad-hostname)
run_cmake(basic)
run_cmake(EXPECTED_HASH)
run_cmake(file-without-path)
run_cmake(no-file)
run_cmake(range)
run_cmake(SHOW_PROGRESS)
if(NOT CMake_TEST_NO_NETWORK)
run_cmake(bad-hostname)
endif()