summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorAsit Dhal <dhal.asitk@gmail.com>2020-06-21 21:17:34 (GMT)
committerKyle Edwards <kyle.edwards@kitware.com>2020-06-25 18:43:30 (GMT)
commitd4812a955b679ca4426192db4276cd4e1c1bd373 (patch)
treece97b1b98c26db58c2905e7d36214c7159c414d9 /Tests
parentaae35feea2048e6ffe4d47a068aa5246c89bd606 (diff)
downloadCMake-d4812a955b679ca4426192db4276cd4e1c1bd373.zip
CMake-d4812a955b679ca4426192db4276cd4e1c1bd373.tar.gz
CMake-d4812a955b679ca4426192db4276cd4e1c1bd373.tar.bz2
cmake-install: implement default directory permissions
provide an argument for default directory permissions in cmake --install Fixes: #20700
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/CommandLine/RunCMakeTest.cmake26
-rw-r--r--Tests/RunCMake/CommandLine/dir-permissions-install-options-to-vars/cmake_install.cmake3
-rw-r--r--Tests/RunCMake/CommandLine/install-default-dir-permissions-afew-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/install-default-dir-permissions-afew-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/install-default-dir-permissions-all-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/install-default-dir-permissions-all-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/install-default-dir-permissions-assignment-at-the-beginning-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/install-default-dir-permissions-assignment-at-the-beginning-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/install-default-dir-permissions-assignment-at-the-end-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/install-default-dir-permissions-assignment-at-the-end-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/install-default-dir-permissions-comma-at-the-end-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/install-default-dir-permissions-comma-at-the-end-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-assignment-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-assignment-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-comma1-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-comma1-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-comma2-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-comma2-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/install-default-dir-permissions-none-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/install-default-dir-permissions-none-stderr.txt1
20 files changed, 47 insertions, 0 deletions
diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
index f291f15..6d69945 100644
--- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
@@ -67,6 +67,32 @@ run_cmake_command(install-bad-dir
run_cmake_command(install-options-to-vars
${CMAKE_COMMAND} --install ${RunCMake_SOURCE_DIR}/dir-install-options-to-vars
--strip --prefix /var/test --config sample --component pack)
+run_cmake_command(install-default-dir-permissions-all
+ ${CMAKE_COMMAND} --install ${RunCMake_SOURCE_DIR}/dir-permissions-install-options-to-vars
+ --default-directory-permissions u=rwx,g=rx,o=rx)
+run_cmake_command(install-default-dir-permissions-afew
+ ${CMAKE_COMMAND} --install ${RunCMake_SOURCE_DIR}/dir-permissions-install-options-to-vars
+ --default-directory-permissions u=rwx,g=rx)
+run_cmake_command(install-default-dir-permissions-none
+ ${CMAKE_COMMAND} --install ${RunCMake_SOURCE_DIR}/dir-permissions-install-options-to-vars)
+run_cmake_command(install-default-dir-permissions-invalid-comma1
+ ${CMAKE_COMMAND} --install ${RunCMake_SOURCE_DIR}/dir-permissions-install-options-to-vars
+ --default-directory-permissions u=rwxg=,x)
+run_cmake_command(install-default-dir-permissions-invalid-comma2
+ ${CMAKE_COMMAND} --install ${RunCMake_SOURCE_DIR}/dir-permissions-install-options-to-vars
+ --default-directory-permissions u=rwxg,=x)
+run_cmake_command(install-default-dir-permissions-comma-at-the-end
+ ${CMAKE_COMMAND} --install ${RunCMake_SOURCE_DIR}/dir-permissions-install-options-to-vars
+ --default-directory-permissions u=rwx,)
+run_cmake_command(install-default-dir-permissions-invalid-assignment
+ ${CMAKE_COMMAND} --install ${RunCMake_SOURCE_DIR}/dir-permissions-install-options-to-vars
+ --default-directory-permissions u=rwx,=x)
+run_cmake_command(install-default-dir-permissions-assignment-at-the-end
+ ${CMAKE_COMMAND} --install ${RunCMake_SOURCE_DIR}/dir-permissions-install-options-to-vars
+ --default-directory-permissions u=rwx,g=)
+run_cmake_command(install-default-dir-permissions-assignment-at-the-beginning
+ ${CMAKE_COMMAND} --install ${RunCMake_SOURCE_DIR}/dir-permissions-install-options-to-vars
+ --default-directory-permissions =u=rwx,g=rx)
run_cmake_command(cache-bad-entry
${CMAKE_COMMAND} --build ${RunCMake_SOURCE_DIR}/cache-bad-entry/)
diff --git a/Tests/RunCMake/CommandLine/dir-permissions-install-options-to-vars/cmake_install.cmake b/Tests/RunCMake/CommandLine/dir-permissions-install-options-to-vars/cmake_install.cmake
new file mode 100644
index 0000000..42ef745
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/dir-permissions-install-options-to-vars/cmake_install.cmake
@@ -0,0 +1,3 @@
+if(CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS)
+ message("CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS is ${CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS}")
+endif()
diff --git a/Tests/RunCMake/CommandLine/install-default-dir-permissions-afew-result.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-afew-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-afew-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CommandLine/install-default-dir-permissions-afew-stderr.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-afew-stderr.txt
new file mode 100644
index 0000000..42f4b3f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-afew-stderr.txt
@@ -0,0 +1 @@
+CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS is OWNER_READ;OWNER_WRITE;OWNER_EXECUTE;GROUP_READ;GROUP_EXECUTE
diff --git a/Tests/RunCMake/CommandLine/install-default-dir-permissions-all-result.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-all-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-all-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CommandLine/install-default-dir-permissions-all-stderr.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-all-stderr.txt
new file mode 100644
index 0000000..813d9c3
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-all-stderr.txt
@@ -0,0 +1 @@
+CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS is OWNER_READ;OWNER_WRITE;OWNER_EXECUTE;GROUP_READ;GROUP_EXECUTE;WORLD_READ;WORLD_EXECUTE
diff --git a/Tests/RunCMake/CommandLine/install-default-dir-permissions-assignment-at-the-beginning-result.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-assignment-at-the-beginning-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-assignment-at-the-beginning-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/install-default-dir-permissions-assignment-at-the-beginning-stderr.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-assignment-at-the-beginning-stderr.txt
new file mode 100644
index 0000000..1b80952
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-assignment-at-the-beginning-stderr.txt
@@ -0,0 +1 @@
+--default-directory-permissions is in incorrect format
diff --git a/Tests/RunCMake/CommandLine/install-default-dir-permissions-assignment-at-the-end-result.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-assignment-at-the-end-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-assignment-at-the-end-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CommandLine/install-default-dir-permissions-assignment-at-the-end-stderr.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-assignment-at-the-end-stderr.txt
new file mode 100644
index 0000000..6680932
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-assignment-at-the-end-stderr.txt
@@ -0,0 +1 @@
+CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS is OWNER_READ;OWNER_WRITE;OWNER_EXECUTE
diff --git a/Tests/RunCMake/CommandLine/install-default-dir-permissions-comma-at-the-end-result.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-comma-at-the-end-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-comma-at-the-end-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/install-default-dir-permissions-comma-at-the-end-stderr.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-comma-at-the-end-stderr.txt
new file mode 100644
index 0000000..1b80952
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-comma-at-the-end-stderr.txt
@@ -0,0 +1 @@
+--default-directory-permissions is in incorrect format
diff --git a/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-assignment-result.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-assignment-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-assignment-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-assignment-stderr.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-assignment-stderr.txt
new file mode 100644
index 0000000..1b80952
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-assignment-stderr.txt
@@ -0,0 +1 @@
+--default-directory-permissions is in incorrect format
diff --git a/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-comma1-result.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-comma1-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-comma1-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-comma1-stderr.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-comma1-stderr.txt
new file mode 100644
index 0000000..1b80952
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-comma1-stderr.txt
@@ -0,0 +1 @@
+--default-directory-permissions is in incorrect format
diff --git a/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-comma2-result.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-comma2-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-comma2-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-comma2-stderr.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-comma2-stderr.txt
new file mode 100644
index 0000000..1b80952
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-comma2-stderr.txt
@@ -0,0 +1 @@
+--default-directory-permissions is in incorrect format
diff --git a/Tests/RunCMake/CommandLine/install-default-dir-permissions-none-result.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-none-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-none-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CommandLine/install-default-dir-permissions-none-stderr.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-none-stderr.txt
new file mode 100644
index 0000000..10f3293
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-none-stderr.txt
@@ -0,0 +1 @@
+^$