summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/file/RENAME-file-to-file.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/RunCMake/file/RENAME-file-to-file.cmake')
-rw-r--r--Tests/RunCMake/file/RENAME-file-to-file.cmake10
1 files changed, 10 insertions, 0 deletions
diff --git a/Tests/RunCMake/file/RENAME-file-to-file.cmake b/Tests/RunCMake/file/RENAME-file-to-file.cmake
new file mode 100644
index 0000000..dbc411be
--- /dev/null
+++ b/Tests/RunCMake/file/RENAME-file-to-file.cmake
@@ -0,0 +1,10 @@
+set(oldname "${CMAKE_CURRENT_BINARY_DIR}/input")
+set(newname "${CMAKE_CURRENT_BINARY_DIR}/output")
+file(WRITE "${oldname}" "")
+file(RENAME "${oldname}" "${newname}")
+if(EXISTS "${oldname}")
+ message(FATAL_ERROR "The old name still exists:\n ${oldname}")
+endif()
+if(NOT EXISTS "${newname}")
+ message(FATAL_ERROR "The new name does not exist:\n ${newname}")
+endif()