summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-07-01 11:02:14 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-07-01 11:03:03 (GMT)
commitb7af2811aecf9aedf31e3ed98209b6a92c227116 (patch)
tree8c0c17a848dd71c925422a909165ec53dcd5f9f4 /Tests
parent57ea0012477828d0f2d34dde994ec6fa18cdd7a1 (diff)
parent27b03281e2028d8239c3f7e43ea67f30a70dc42b (diff)
downloadCMake-b7af2811aecf9aedf31e3ed98209b6a92c227116.zip
CMake-b7af2811aecf9aedf31e3ed98209b6a92c227116.tar.gz
CMake-b7af2811aecf9aedf31e3ed98209b6a92c227116.tar.bz2
Merge topic 'configure_file-permission-control'
27b03281e2 configure_file: Add option to control file permissions transfer to copy Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4941
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/configure_file/NoSourcePermissions.cmake10
-rwxr-xr-xTests/RunCMake/configure_file/NoSourcePermissions.sh3
-rw-r--r--Tests/RunCMake/configure_file/RunCMakeTest.cmake1
3 files changed, 14 insertions, 0 deletions
diff --git a/Tests/RunCMake/configure_file/NoSourcePermissions.cmake b/Tests/RunCMake/configure_file/NoSourcePermissions.cmake
new file mode 100644
index 0000000..c6ad131
--- /dev/null
+++ b/Tests/RunCMake/configure_file/NoSourcePermissions.cmake
@@ -0,0 +1,10 @@
+configure_file(NoSourcePermissions.sh NoSourcePermissions.sh.out
+ NO_SOURCE_PERMISSIONS)
+
+if (UNIX)
+ execute_process(COMMAND ${CMAKE_CURRENT_BINARY_DIR}/NoSourcePermissions.sh.out
+ RESULT_VARIABLE result)
+ if (result EQUAL "0")
+ message(FATAL_ERROR "Copied file has executable permissions")
+ endif()
+endif()
diff --git a/Tests/RunCMake/configure_file/NoSourcePermissions.sh b/Tests/RunCMake/configure_file/NoSourcePermissions.sh
new file mode 100755
index 0000000..0aa8f41
--- /dev/null
+++ b/Tests/RunCMake/configure_file/NoSourcePermissions.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+#Testing NO_SOURCE_PERMISSIONS option of configure_file.
diff --git a/Tests/RunCMake/configure_file/RunCMakeTest.cmake b/Tests/RunCMake/configure_file/RunCMakeTest.cmake
index 32a0770..71694fb 100644
--- a/Tests/RunCMake/configure_file/RunCMakeTest.cmake
+++ b/Tests/RunCMake/configure_file/RunCMakeTest.cmake
@@ -15,6 +15,7 @@ run_cmake(NewLineStyle-NoArg)
run_cmake(NewLineStyle-WrongArg)
run_cmake(NewLineStyle-ValidArg)
run_cmake(NewLineStyle-COPYONLY)
+run_cmake(NoSourcePermissions)
if(RunCMake_GENERATOR MATCHES "Make")
# Use a single build tree for a few tests without cleaning.