summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-11-16 14:35:59 (GMT)
committerKitware Robot <kwrobot@kitware.com>2022-11-16 14:36:29 (GMT)
commit48d52c2cfe7a39ab7e24d7d6816c2ba084e02eb0 (patch)
tree6f8a765c0cbc0c663b7f72cc3e521306aa06380c /Tests/RunCMake
parentad02e67a8990b2446db15425c83bc5f7f6afc1a8 (diff)
parent89b144789d969e4af06de515df2595b9a043431f (diff)
downloadCMake-48d52c2cfe7a39ab7e24d7d6816c2ba084e02eb0.zip
CMake-48d52c2cfe7a39ab7e24d7d6816c2ba084e02eb0.tar.gz
CMake-48d52c2cfe7a39ab7e24d7d6816c2ba084e02eb0.tar.bz2
Merge topic 'file-copy-error-path'
89b144789d file(COPY_FILE): Report if failure occurred on input or output path 91dd7898ee Merge branch 'upstream-KWSys' into file-copy-error-path a9c659b1b6 KWSys 2022-11-15 (6c92b9b0) Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Acked-by: Ben Boeckel <ben.boeckel@kitware.com> Merge-request: !7916
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r--Tests/RunCMake/file/COPY_FILE-input-missing-result.txt1
-rw-r--r--Tests/RunCMake/file/COPY_FILE-input-missing-stderr.txt14
-rw-r--r--Tests/RunCMake/file/COPY_FILE-input-missing.cmake3
-rw-r--r--Tests/RunCMake/file/COPY_FILE-output-missing-result.txt1
-rw-r--r--Tests/RunCMake/file/COPY_FILE-output-missing-stderr.txt14
-rw-r--r--Tests/RunCMake/file/COPY_FILE-output-missing.cmake4
-rw-r--r--Tests/RunCMake/file/RunCMakeTest.cmake2
7 files changed, 39 insertions, 0 deletions
diff --git a/Tests/RunCMake/file/COPY_FILE-input-missing-result.txt b/Tests/RunCMake/file/COPY_FILE-input-missing-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/file/COPY_FILE-input-missing-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/file/COPY_FILE-input-missing-stderr.txt b/Tests/RunCMake/file/COPY_FILE-input-missing-stderr.txt
new file mode 100644
index 0000000..989925d
--- /dev/null
+++ b/Tests/RunCMake/file/COPY_FILE-input-missing-stderr.txt
@@ -0,0 +1,14 @@
+^CMake Error at [^
+]*/Tests/RunCMake/file/COPY_FILE-input-missing.cmake:[0-9]+ \(file\):
+ file COPY_FILE failed to copy
+
+ [^
+]*/Tests/RunCMake/file/COPY_FILE-input-missing-build/input-missing
+
+ to
+
+ [^
+]*/Tests/RunCMake/file/COPY_FILE-input-missing-build/output
+
+ because: [^
+]+ \(input\)$
diff --git a/Tests/RunCMake/file/COPY_FILE-input-missing.cmake b/Tests/RunCMake/file/COPY_FILE-input-missing.cmake
new file mode 100644
index 0000000..2d2c55e
--- /dev/null
+++ b/Tests/RunCMake/file/COPY_FILE-input-missing.cmake
@@ -0,0 +1,3 @@
+set(oldname "${CMAKE_CURRENT_BINARY_DIR}/input-missing")
+set(newname "${CMAKE_CURRENT_BINARY_DIR}/output")
+file(COPY_FILE "${oldname}" "${newname}")
diff --git a/Tests/RunCMake/file/COPY_FILE-output-missing-result.txt b/Tests/RunCMake/file/COPY_FILE-output-missing-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/file/COPY_FILE-output-missing-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/file/COPY_FILE-output-missing-stderr.txt b/Tests/RunCMake/file/COPY_FILE-output-missing-stderr.txt
new file mode 100644
index 0000000..0e7d9f7
--- /dev/null
+++ b/Tests/RunCMake/file/COPY_FILE-output-missing-stderr.txt
@@ -0,0 +1,14 @@
+^CMake Error at [^
+]*/Tests/RunCMake/file/COPY_FILE-output-missing.cmake:[0-9]+ \(file\):
+ file COPY_FILE failed to copy
+
+ [^
+]*/Tests/RunCMake/file/COPY_FILE-output-missing-build/input
+
+ to
+
+ [^
+]*/Tests/RunCMake/file/COPY_FILE-output-missing-build/output-missing/output
+
+ because: [^
+]+ \(output\)$
diff --git a/Tests/RunCMake/file/COPY_FILE-output-missing.cmake b/Tests/RunCMake/file/COPY_FILE-output-missing.cmake
new file mode 100644
index 0000000..22133e7
--- /dev/null
+++ b/Tests/RunCMake/file/COPY_FILE-output-missing.cmake
@@ -0,0 +1,4 @@
+set(oldname "${CMAKE_CURRENT_BINARY_DIR}/input")
+set(newname "${CMAKE_CURRENT_BINARY_DIR}/output-missing/output")
+file(WRITE "${oldname}" "")
+file(COPY_FILE "${oldname}" "${newname}")
diff --git a/Tests/RunCMake/file/RunCMakeTest.cmake b/Tests/RunCMake/file/RunCMakeTest.cmake
index db88956..4ad00ff 100644
--- a/Tests/RunCMake/file/RunCMakeTest.cmake
+++ b/Tests/RunCMake/file/RunCMakeTest.cmake
@@ -65,6 +65,8 @@ run_cmake_script(COPY_FILE-file-ONLY_IF_DIFFERENT-no-overwrite)
run_cmake_script(COPY_FILE-link-to-file)
run_cmake_script(COPY_FILE-arg-missing)
run_cmake_script(COPY_FILE-arg-unknown)
+run_cmake_script(COPY_FILE-input-missing)
+run_cmake_script(COPY_FILE-output-missing)
run_cmake_script(RENAME-file-replace)
run_cmake_script(RENAME-file-to-file)