summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/file/COPY_FILE-file-replace.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/RunCMake/file/COPY_FILE-file-replace.cmake')
-rw-r--r--Tests/RunCMake/file/COPY_FILE-file-replace.cmake9
1 files changed, 9 insertions, 0 deletions
diff --git a/Tests/RunCMake/file/COPY_FILE-file-replace.cmake b/Tests/RunCMake/file/COPY_FILE-file-replace.cmake
new file mode 100644
index 0000000..40e4290
--- /dev/null
+++ b/Tests/RunCMake/file/COPY_FILE-file-replace.cmake
@@ -0,0 +1,9 @@
+set(oldname "${CMAKE_CURRENT_BINARY_DIR}/input")
+set(newname "${CMAKE_CURRENT_BINARY_DIR}/output")
+file(WRITE "${oldname}" "a")
+file(WRITE "${newname}" "b")
+file(COPY_FILE "${oldname}" "${newname}")
+file(READ "${newname}" new)
+if(NOT "${new}" STREQUAL "a")
+ message(FATAL_ERROR "New name:\n ${newname}\ndoes not contain expected content 'a'.")
+endif()