diff options
author | Brad King <brad.king@kitware.com> | 2024-02-28 14:03:06 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2024-02-28 14:03:20 (GMT) |
commit | c481ddda14b3aa26a47da3a3f49b9fdaac5b77c7 (patch) | |
tree | e96ca16373136bd64aac31693b0a0d79f7572444 /Tests | |
parent | ecfb0532f074664b66e7e28ce4382a16be163189 (diff) | |
parent | 434fe8a34b654ca2a6fee489dc02a2ddc308d1e1 (diff) | |
download | CMake-c481ddda14b3aa26a47da3a3f49b9fdaac5b77c7.zip CMake-c481ddda14b3aa26a47da3a3f49b9fdaac5b77c7.tar.gz CMake-c481ddda14b3aa26a47da3a3f49b9fdaac5b77c7.tar.bz2 |
Merge topic 'curl-tls-version'
434fe8a34b file(DOWNLOAD|UPLOAD): Add CMAKE_TLS_VERSION environment variable
fb9a6cf909 file(DOWNLOAD|UPLOAD): Add CMAKE_TLS_VERSION variable
8e6776b9f3 file(DOWNLOAD|UPLOAD): Add TLS_VERSION option for https connections
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9290
Diffstat (limited to 'Tests')
13 files changed, 51 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index a2a9ee9..d4bb490 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -553,6 +553,7 @@ add_RunCMake_test(file-CHMOD -DMSYS=${MSYS}) foreach(var CMake_TEST_NO_NETWORK CMake_TEST_TLS_VERIFY_URL + CMake_TEST_TLS_VERSION ) if(DEFINED ${var}) list(APPEND file-DOWNLOAD_ARGS -D${var}=${${var}}) diff --git a/Tests/RunCMake/file-DOWNLOAD/RunCMakeTest.cmake b/Tests/RunCMake/file-DOWNLOAD/RunCMakeTest.cmake index d757eea..33f519f 100644 --- a/Tests/RunCMake/file-DOWNLOAD/RunCMakeTest.cmake +++ b/Tests/RunCMake/file-DOWNLOAD/RunCMakeTest.cmake @@ -11,6 +11,7 @@ run_cmake(httpheader-not-set) run_cmake(netrc-bad) run_cmake(tls-cainfo-not-set) run_cmake(tls-verify-not-set) +run_cmake(TLS_VERSION-missing) run_cmake(pass-not-set) run_cmake(no-save-hash) @@ -25,7 +26,12 @@ if(NOT CMake_TEST_NO_NETWORK) run_cmake(bad-hostname) endif() +run_cmake_with_options(TLS_VERSION-bad) + if(CMake_TEST_TLS_VERIFY_URL) run_cmake(TLS_VERIFY-bad) run_cmake_with_options(TLS_VERIFY-good -Durl=${CMake_TEST_TLS_VERIFY_URL}) + if(CMake_TEST_TLS_VERSION) + run_cmake_with_options(TLS_VERSION-good -Durl=${CMake_TEST_TLS_VERIFY_URL} -Dtls_version=${CMake_TEST_TLS_VERSION}) + endif() endif() diff --git a/Tests/RunCMake/file-DOWNLOAD/TLS_VERSION-bad-result.txt b/Tests/RunCMake/file-DOWNLOAD/TLS_VERSION-bad-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/file-DOWNLOAD/TLS_VERSION-bad-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/file-DOWNLOAD/TLS_VERSION-bad-stderr.txt b/Tests/RunCMake/file-DOWNLOAD/TLS_VERSION-bad-stderr.txt new file mode 100644 index 0000000..421c8cf --- /dev/null +++ b/Tests/RunCMake/file-DOWNLOAD/TLS_VERSION-bad-stderr.txt @@ -0,0 +1,14 @@ +^CMake Error at TLS_VERSION-bad\.cmake:[0-9]+ \(file\): + file DOWNLOAD given unknown TLS/SSL version bad-env +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) ++ +CMake Error at TLS_VERSION-bad\.cmake:[0-9]+ \(file\): + file DOWNLOAD given unknown TLS/SSL version bad-var +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) ++ +CMake Error at TLS_VERSION-bad\.cmake:[0-9]+ \(file\): + file DOWNLOAD given unknown TLS/SSL version bad-arg +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/file-DOWNLOAD/TLS_VERSION-bad.cmake b/Tests/RunCMake/file-DOWNLOAD/TLS_VERSION-bad.cmake new file mode 100644 index 0000000..51ae4a2 --- /dev/null +++ b/Tests/RunCMake/file-DOWNLOAD/TLS_VERSION-bad.cmake @@ -0,0 +1,10 @@ +# The environment variable provides a default. +set(ENV{CMAKE_TLS_VERSION} bad-env) +file(DOWNLOAD "" TLS_VERIFY 1 STATUS status LOG log) + +# The cmake variable overrides the environment variable. +set(CMAKE_TLS_VERSION bad-var) +file(DOWNLOAD "" TLS_VERIFY 1 STATUS status LOG log) + +# The explicit argument overrides the cmake variable. +file(DOWNLOAD "" TLS_VERSION bad-arg TLS_VERIFY 1 STATUS status LOG log) diff --git a/Tests/RunCMake/file-DOWNLOAD/TLS_VERSION-good.cmake b/Tests/RunCMake/file-DOWNLOAD/TLS_VERSION-good.cmake new file mode 100644 index 0000000..fcbf650 --- /dev/null +++ b/Tests/RunCMake/file-DOWNLOAD/TLS_VERSION-good.cmake @@ -0,0 +1,6 @@ +file(DOWNLOAD ${url} TLS_VERSION "${tls_version}" TLS_VERIFY 1 STATUS status LOG log) +message(STATUS "${status}") +list(GET status 0 code) +if(NOT code EQUAL 0) + message("${log}") +endif() diff --git a/Tests/RunCMake/file-DOWNLOAD/TLS_VERSION-missing-result.txt b/Tests/RunCMake/file-DOWNLOAD/TLS_VERSION-missing-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/file-DOWNLOAD/TLS_VERSION-missing-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/file-DOWNLOAD/TLS_VERSION-missing-stderr.txt b/Tests/RunCMake/file-DOWNLOAD/TLS_VERSION-missing-stderr.txt new file mode 100644 index 0000000..05d9d90 --- /dev/null +++ b/Tests/RunCMake/file-DOWNLOAD/TLS_VERSION-missing-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at TLS_VERSION-missing\.cmake:[0-9]+ \(file\): + file DOWNLOAD missing value for TLS_VERSION\. +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/file-DOWNLOAD/TLS_VERSION-missing.cmake b/Tests/RunCMake/file-DOWNLOAD/TLS_VERSION-missing.cmake new file mode 100644 index 0000000..29fcd96 --- /dev/null +++ b/Tests/RunCMake/file-DOWNLOAD/TLS_VERSION-missing.cmake @@ -0,0 +1 @@ +file(DOWNLOAD "" "" TLS_VERSION) diff --git a/Tests/RunCMake/file/RunCMakeTest.cmake b/Tests/RunCMake/file/RunCMakeTest.cmake index c75e062..be8ee7c 100644 --- a/Tests/RunCMake/file/RunCMakeTest.cmake +++ b/Tests/RunCMake/file/RunCMakeTest.cmake @@ -12,6 +12,7 @@ run_cmake(UPLOAD-httpheader-not-set) run_cmake(UPLOAD-netrc-bad) run_cmake(UPLOAD-tls-cainfo-not-set) run_cmake(UPLOAD-tls-verify-not-set) +run_cmake(UPLOAD-TLS_VERSION-missing) run_cmake(UPLOAD-pass-not-set) run_cmake(INSTALL-DIRECTORY) run_cmake(INSTALL-FILES_FROM_DIR) diff --git a/Tests/RunCMake/file/UPLOAD-TLS_VERSION-missing-result.txt b/Tests/RunCMake/file/UPLOAD-TLS_VERSION-missing-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/file/UPLOAD-TLS_VERSION-missing-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/file/UPLOAD-TLS_VERSION-missing-stderr.txt b/Tests/RunCMake/file/UPLOAD-TLS_VERSION-missing-stderr.txt new file mode 100644 index 0000000..d61aba7 --- /dev/null +++ b/Tests/RunCMake/file/UPLOAD-TLS_VERSION-missing-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at UPLOAD-TLS_VERSION-missing\.cmake:[0-9]+ \(file\): + file UPLOAD missing value for TLS_VERSION\. +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/file/UPLOAD-TLS_VERSION-missing.cmake b/Tests/RunCMake/file/UPLOAD-TLS_VERSION-missing.cmake new file mode 100644 index 0000000..dff9a9c --- /dev/null +++ b/Tests/RunCMake/file/UPLOAD-TLS_VERSION-missing.cmake @@ -0,0 +1 @@ +file(UPLOAD "" "" TLS_VERSION) |