diff options
author | Brad King <brad.king@kitware.com> | 2021-05-06 10:39:05 -0400 |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-05-07 08:30:52 -0400 |
commit | d7522b8f864db8df25b99eeabc625e55ad690a3e (patch) | |
tree | 6f9bc3bcbc373f103696c8c20565b45d7c6a45cf /Tests | |
parent | e0b4a22ca6874a15912eea86cde16f47cb5f9d93 (diff) | |
download | cmake-d7522b8f864db8df25b99eeabc625e55ad690a3e.tar.gz |
cmSystemTools: Improve CreateLink and CreateSymlink error codes
In commit 7f89053953 (cmSystemTools: Return KWSys Status from CreateLink
and CreateSymlink, 2021-04-15) we just took the `-err` from libuv and
treated it as a POSIX error. This is accurate on POSIX, but on Windows
does not match the POSIX error codes.
Use `uv_fs_get_system_error` to get the actual system error code.
This requires libuv 1.38 or higher. Require that for Windows, but
fall back to the previous approach on POSIX.
Diffstat (limited to 'Tests')
5 files changed, 6 insertions, 6 deletions
diff --git a/Tests/RunCMake/CommandLine/E_create_hardlink-no-directory-stderr.txt b/Tests/RunCMake/CommandLine/E_create_hardlink-no-directory-stderr.txt index 21e60eec02..63a10d8355 100644 --- a/Tests/RunCMake/CommandLine/E_create_hardlink-no-directory-stderr.txt +++ b/Tests/RunCMake/CommandLine/E_create_hardlink-no-directory-stderr.txt @@ -1 +1 @@ -^CMake Error: failed to create link .* no such file or directory +^CMake Error: failed to create link '[^']+': [A-Za-z] diff --git a/Tests/RunCMake/CommandLine/E_create_hardlink-unresolved-symlink-prereq-check.cmake b/Tests/RunCMake/CommandLine/E_create_hardlink-unresolved-symlink-prereq-check.cmake index 5b97aecc0d..d92554af4d 100644 --- a/Tests/RunCMake/CommandLine/E_create_hardlink-unresolved-symlink-prereq-check.cmake +++ b/Tests/RunCMake/CommandLine/E_create_hardlink-unresolved-symlink-prereq-check.cmake @@ -1,3 +1,3 @@ -if(${actual_stderr_var} MATCHES "operation not permitted") +if(${actual_stderr_var} MATCHES "A required privilege is not held by the client") unset(msg) endif() diff --git a/Tests/RunCMake/CommandLine/E_create_symlink-broken-create-check.cmake b/Tests/RunCMake/CommandLine/E_create_symlink-broken-create-check.cmake index 5df5f2fb70..43573bfe9f 100644 --- a/Tests/RunCMake/CommandLine/E_create_symlink-broken-create-check.cmake +++ b/Tests/RunCMake/CommandLine/E_create_symlink-broken-create-check.cmake @@ -1,4 +1,4 @@ -if(${actual_stderr_var} MATCHES "operation not permitted") +if(${actual_stderr_var} MATCHES "A required privilege is not held by the client") unset(msg) else() if(NOT IS_SYMLINK ${RunCMake_TEST_BINARY_DIR}/L) diff --git a/Tests/RunCMake/CommandLine/E_create_symlink-broken-replace-check.cmake b/Tests/RunCMake/CommandLine/E_create_symlink-broken-replace-check.cmake index d37df01690..639c2237ee 100644 --- a/Tests/RunCMake/CommandLine/E_create_symlink-broken-replace-check.cmake +++ b/Tests/RunCMake/CommandLine/E_create_symlink-broken-replace-check.cmake @@ -1,4 +1,4 @@ -if(${actual_stderr_var} MATCHES "operation not permitted") +if(${actual_stderr_var} MATCHES "A required privilege is not held by the client") unset(msg) else() if(NOT IS_DIRECTORY ${RunCMake_TEST_BINARY_DIR}/L) diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake index 78c3508713..a1edbd0f2b 100644 --- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake @@ -359,7 +359,7 @@ run_cmake_command(E_create_symlink-missing-dir # These tests are special on Windows since it will only fail if the user # running the test does not have the priveldge to create symlinks. If this # happens we clear the msg in the -check.cmake and say that the test passes -set(RunCMake_DEFAULT_stderr "(operation not permitted)?") +set(RunCMake_DEFAULT_stderr "(A required privilege is not held by the client)?") set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/E_create_symlink-broken-build) set(RunCMake_TEST_NO_CLEAN 1) @@ -403,7 +403,7 @@ run_cmake_command(E_create_hardlink-no-directory #On Windows, if the user does not have sufficient privileges #don't fail this test -set(RunCMake_DEFAULT_stderr "(operation not permitted)?") +set(RunCMake_DEFAULT_stderr "(A required privilege is not held by the client)?") run_cmake_command(E_create_hardlink-unresolved-symlink-prereq ${CMAKE_COMMAND} -E create_symlink ${dir}/1 ${dir}/1-symlink ) |