summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-12-09 12:57:11 (GMT)
committerKitware Robot <kwrobot@kitware.com>2022-12-09 12:57:22 (GMT)
commitd83b1dbac6ff983604e2ec34322ae97d03a3689b (patch)
tree2c110b00c493b30deb4948e5847b060571959cb4 /Tests
parent8e46329f35751f1d3b84d41c9d0bf691949c59be (diff)
parentefae1ab68badef66505363505aecce7a7c3dbe6a (diff)
downloadCMake-d83b1dbac6ff983604e2ec34322ae97d03a3689b.zip
CMake-d83b1dbac6ff983604e2ec34322ae97d03a3689b.tar.gz
CMake-d83b1dbac6ff983604e2ec34322ae97d03a3689b.tar.bz2
Merge topic 'file-make-directory-descriptive-errors'
efae1ab68b file(MAKE_DIRECTORY): Provide a more descriptive error message Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !8003
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/file/MAKE_DIRECTORY-fail-result.txt1
-rw-r--r--Tests/RunCMake/file/MAKE_DIRECTORY-fail-stderr.txt9
-rw-r--r--Tests/RunCMake/file/MAKE_DIRECTORY-fail.cmake2
-rw-r--r--Tests/RunCMake/file/RunCMakeTest.cmake2
4 files changed, 14 insertions, 0 deletions
diff --git a/Tests/RunCMake/file/MAKE_DIRECTORY-fail-result.txt b/Tests/RunCMake/file/MAKE_DIRECTORY-fail-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/file/MAKE_DIRECTORY-fail-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/file/MAKE_DIRECTORY-fail-stderr.txt b/Tests/RunCMake/file/MAKE_DIRECTORY-fail-stderr.txt
new file mode 100644
index 0000000..95fccdf
--- /dev/null
+++ b/Tests/RunCMake/file/MAKE_DIRECTORY-fail-stderr.txt
@@ -0,0 +1,9 @@
+^CMake Error at [^
+]*/MAKE_DIRECTORY-fail.cmake:[0-9]+ \(file\):
+ file failed to create directory:
+
+ [^
+]*/Tests/RunCMake/file/MAKE_DIRECTORY-fail-build/file/directory
+
+ because: [^
+]+$
diff --git a/Tests/RunCMake/file/MAKE_DIRECTORY-fail.cmake b/Tests/RunCMake/file/MAKE_DIRECTORY-fail.cmake
new file mode 100644
index 0000000..57a68e5
--- /dev/null
+++ b/Tests/RunCMake/file/MAKE_DIRECTORY-fail.cmake
@@ -0,0 +1,2 @@
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/file" "")
+file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/file/directory")
diff --git a/Tests/RunCMake/file/RunCMakeTest.cmake b/Tests/RunCMake/file/RunCMakeTest.cmake
index 752f7a0..c75e062 100644
--- a/Tests/RunCMake/file/RunCMakeTest.cmake
+++ b/Tests/RunCMake/file/RunCMakeTest.cmake
@@ -61,6 +61,8 @@ run_cmake_script(COPY_FILE-arg-unknown)
run_cmake_script(COPY_FILE-input-missing)
run_cmake_script(COPY_FILE-output-missing)
+run_cmake_script(MAKE_DIRECTORY-fail)
+
run_cmake_script(RENAME-file-replace)
run_cmake_script(RENAME-file-to-file)
run_cmake_script(RENAME-file-to-dir-capture)