summaryrefslogtreecommitdiff
path: root/Tests/RunCMake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-07-18 17:48:21 -0400
committerBrad King <brad.king@kitware.com>2022-07-20 16:03:12 -0400
commit1cf2c94c69cffeb5dde30ca13e5f341f184b3b4c (patch)
treefac9f175cbb0baa96cbd8162375574a49d6265eb /Tests/RunCMake
parent11a0f72ac0aa0553d61f7a72e839ec7e88460268 (diff)
downloadcmake-1cf2c94c69cffeb5dde30ca13e5f341f184b3b4c.tar.gz
Tests: Simplify RunCMake.file-CHMOD cases
Run each case as a `cmake -P` script instead of a full project. The caller handles build directory removal and creation.
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r--Tests/RunCMake/file-CHMOD/RunCMakeTest.cmake16
-rw-r--r--Tests/RunCMake/file-CHMOD/all-perms-stderr.txt7
-rw-r--r--Tests/RunCMake/file-CHMOD/all-perms.cmake7
-rw-r--r--Tests/RunCMake/file-CHMOD/invalid-path-stderr.txt8
-rw-r--r--Tests/RunCMake/file-CHMOD/invalid-path.cmake5
-rw-r--r--Tests/RunCMake/file-CHMOD/invalid-perms-stderr.txt7
-rw-r--r--Tests/RunCMake/file-CHMOD/invalid-perms.cmake7
-rw-r--r--Tests/RunCMake/file-CHMOD/no-keyword-stderr.txt7
-rw-r--r--Tests/RunCMake/file-CHMOD/no-keyword.cmake7
-rw-r--r--Tests/RunCMake/file-CHMOD/no-perms-stderr.txt7
-rw-r--r--Tests/RunCMake/file-CHMOD/no-perms.cmake7
-rw-r--r--Tests/RunCMake/file-CHMOD/ok.cmake7
-rw-r--r--Tests/RunCMake/file-CHMOD/override.cmake7
-rw-r--r--Tests/RunCMake/file-CHMOD/write-only-stderr.txt8
-rw-r--r--Tests/RunCMake/file-CHMOD/write-only.cmake9
15 files changed, 44 insertions, 72 deletions
diff --git a/Tests/RunCMake/file-CHMOD/RunCMakeTest.cmake b/Tests/RunCMake/file-CHMOD/RunCMakeTest.cmake
index 52b6d4e2c2..52a8ad6de9 100644
--- a/Tests/RunCMake/file-CHMOD/RunCMakeTest.cmake
+++ b/Tests/RunCMake/file-CHMOD/RunCMakeTest.cmake
@@ -1,12 +1,12 @@
include(RunCMake)
-run_cmake(no-perms)
-run_cmake(no-keyword)
-run_cmake(all-perms)
-run_cmake(invalid-perms)
-run_cmake(invalid-path)
-run_cmake(ok)
-run_cmake(override)
+run_cmake_script(no-perms)
+run_cmake_script(no-keyword)
+run_cmake_script(all-perms)
+run_cmake_script(invalid-perms)
+run_cmake_script(invalid-path)
+run_cmake_script(ok)
+run_cmake_script(override)
if(UNIX)
execute_process(COMMAND id -u $ENV{USER}
@@ -15,5 +15,5 @@ if(UNIX)
endif()
if(NOT WIN32 AND NOT MSYS AND NOT "${uid}" STREQUAL "0")
- run_cmake(write-only)
+ run_cmake_script(write-only)
endif()
diff --git a/Tests/RunCMake/file-CHMOD/all-perms-stderr.txt b/Tests/RunCMake/file-CHMOD/all-perms-stderr.txt
index 8853aed52a..6932a1f0b8 100644
--- a/Tests/RunCMake/file-CHMOD/all-perms-stderr.txt
+++ b/Tests/RunCMake/file-CHMOD/all-perms-stderr.txt
@@ -1,5 +1,4 @@
-CMake Error at all-perms\.cmake:[0-9]+ \(file\):
+^CMake Error at [^
+]*/all-perms\.cmake:[0-9]+ \(file\):
file Remove either PERMISSIONS or FILE_PERMISSIONS or DIRECTORY_PERMISSIONS
- from the invocation
-Call Stack \(most recent call first\):
- CMakeLists\.txt:[0-9]+ \(include\)
+ from the invocation$
diff --git a/Tests/RunCMake/file-CHMOD/all-perms.cmake b/Tests/RunCMake/file-CHMOD/all-perms.cmake
index b49583d5c3..5ff81b85fd 100644
--- a/Tests/RunCMake/file-CHMOD/all-perms.cmake
+++ b/Tests/RunCMake/file-CHMOD/all-perms.cmake
@@ -1,6 +1,3 @@
-file(REMOVE_RECURSE ${CMAKE_CURRENT_BINARY_DIR}/chmod-tests)
-file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/chmod-tests)
-
-file(TOUCH ${CMAKE_CURRENT_BINARY_DIR}/chmod-tests/a)
-file(CHMOD ${CMAKE_CURRENT_BINARY_DIR}/chmod-tests/a PERMISSIONS OWNER_READ
+file(TOUCH ${CMAKE_CURRENT_BINARY_DIR}/a)
+file(CHMOD ${CMAKE_CURRENT_BINARY_DIR}/a PERMISSIONS OWNER_READ
FILE_PERMISSIONS OWNER_READ DIRECTORY_PERMISSIONS OWNER_READ)
diff --git a/Tests/RunCMake/file-CHMOD/invalid-path-stderr.txt b/Tests/RunCMake/file-CHMOD/invalid-path-stderr.txt
index f2f9c8247a..eb5fb31638 100644
--- a/Tests/RunCMake/file-CHMOD/invalid-path-stderr.txt
+++ b/Tests/RunCMake/file-CHMOD/invalid-path-stderr.txt
@@ -1,6 +1,6 @@
-CMake Error at invalid-path\.cmake:[0-9]+ \(file\):
+^CMake Error at [^
+]*/invalid-path\.cmake:[0-9]+ \(file\):
file does not exist:
- .*/chmod-tests/I_dont_exist
-Call Stack \(most recent call first\):
- CMakeLists\.txt:[0-9]+ \(include\)
+ [^
+]*/Tests/RunCMake/file-CHMOD/invalid-path-build/I_dont_exist$
diff --git a/Tests/RunCMake/file-CHMOD/invalid-path.cmake b/Tests/RunCMake/file-CHMOD/invalid-path.cmake
index 36915c15bd..e8b0313c4a 100644
--- a/Tests/RunCMake/file-CHMOD/invalid-path.cmake
+++ b/Tests/RunCMake/file-CHMOD/invalid-path.cmake
@@ -1,4 +1 @@
-file(REMOVE_RECURSE ${CMAKE_CURRENT_BINARY_DIR}/chmod-tests)
-file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/chmod-tests)
-
-file(CHMOD ${CMAKE_CURRENT_BINARY_DIR}/chmod-tests/I_dont_exist PERMISSIONS OWNER_READ)
+file(CHMOD ${CMAKE_CURRENT_BINARY_DIR}/I_dont_exist PERMISSIONS OWNER_READ)
diff --git a/Tests/RunCMake/file-CHMOD/invalid-perms-stderr.txt b/Tests/RunCMake/file-CHMOD/invalid-perms-stderr.txt
index 003252a384..daab22e4eb 100644
--- a/Tests/RunCMake/file-CHMOD/invalid-perms-stderr.txt
+++ b/Tests/RunCMake/file-CHMOD/invalid-perms-stderr.txt
@@ -1,4 +1,3 @@
-CMake Error at invalid-perms\.cmake:[0-9]+ \(file\):
- file INVALID_PERMISSION is an invalid permission specifier
-Call Stack \(most recent call first\):
- CMakeLists\.txt:[0-9]+ \(include\)
+^CMake Error at [^
+]*/invalid-perms\.cmake:[0-9]+ \(file\):
+ file INVALID_PERMISSION is an invalid permission specifier$
diff --git a/Tests/RunCMake/file-CHMOD/invalid-perms.cmake b/Tests/RunCMake/file-CHMOD/invalid-perms.cmake
index 22cab0b14b..42129b9dfd 100644
--- a/Tests/RunCMake/file-CHMOD/invalid-perms.cmake
+++ b/Tests/RunCMake/file-CHMOD/invalid-perms.cmake
@@ -1,5 +1,2 @@
-file(REMOVE_RECURSE ${CMAKE_CURRENT_BINARY_DIR}/chmod-tests)
-file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/chmod-tests)
-
-file(TOUCH ${CMAKE_CURRENT_BINARY_DIR}/chmod-tests/a)
-file(CHMOD ${CMAKE_CURRENT_BINARY_DIR}/chmod-tests/a PERMISSIONS INVALID_PERMISSION)
+file(TOUCH ${CMAKE_CURRENT_BINARY_DIR}/a)
+file(CHMOD ${CMAKE_CURRENT_BINARY_DIR}/a PERMISSIONS INVALID_PERMISSION)
diff --git a/Tests/RunCMake/file-CHMOD/no-keyword-stderr.txt b/Tests/RunCMake/file-CHMOD/no-keyword-stderr.txt
index 1dfc6a99fb..41624a30f5 100644
--- a/Tests/RunCMake/file-CHMOD/no-keyword-stderr.txt
+++ b/Tests/RunCMake/file-CHMOD/no-keyword-stderr.txt
@@ -1,4 +1,3 @@
-CMake Error at no-keyword\.cmake:[0-9]+ \(file\):
- file No permissions given
-Call Stack \(most recent call first\):
- CMakeLists\.txt:[0-9]+ \(include\)
+^CMake Error at [^
+]*/no-keyword\.cmake:[0-9]+ \(file\):
+ file No permissions given$
diff --git a/Tests/RunCMake/file-CHMOD/no-keyword.cmake b/Tests/RunCMake/file-CHMOD/no-keyword.cmake
index 8b62106513..602cfc20f8 100644
--- a/Tests/RunCMake/file-CHMOD/no-keyword.cmake
+++ b/Tests/RunCMake/file-CHMOD/no-keyword.cmake
@@ -1,5 +1,2 @@
-file(REMOVE_RECURSE ${CMAKE_CURRENT_BINARY_DIR}/chmod-tests)
-file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/chmod-tests)
-
-file(TOUCH ${CMAKE_CURRENT_BINARY_DIR}/chmod-tests/a)
-file(CHMOD ${CMAKE_CURRENT_BINARY_DIR}/chmod-tests/a)
+file(TOUCH ${CMAKE_CURRENT_BINARY_DIR}/a)
+file(CHMOD ${CMAKE_CURRENT_BINARY_DIR}/a)
diff --git a/Tests/RunCMake/file-CHMOD/no-perms-stderr.txt b/Tests/RunCMake/file-CHMOD/no-perms-stderr.txt
index 1d1846473d..4c5a13983e 100644
--- a/Tests/RunCMake/file-CHMOD/no-perms-stderr.txt
+++ b/Tests/RunCMake/file-CHMOD/no-perms-stderr.txt
@@ -1,4 +1,3 @@
-CMake Error at no-perms\.cmake:[0-9]+ \(file\):
- file No permissions given
-Call Stack \(most recent call first\):
- CMakeLists\.txt:[0-9]+ \(include\)
+^CMake Error at [^
+]*/no-perms\.cmake:[0-9]+ \(file\):
+ file No permissions given$
diff --git a/Tests/RunCMake/file-CHMOD/no-perms.cmake b/Tests/RunCMake/file-CHMOD/no-perms.cmake
index 9fbd3599df..346f9461a4 100644
--- a/Tests/RunCMake/file-CHMOD/no-perms.cmake
+++ b/Tests/RunCMake/file-CHMOD/no-perms.cmake
@@ -1,5 +1,2 @@
-file(REMOVE_RECURSE ${CMAKE_CURRENT_BINARY_DIR}/chmod-tests)
-file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/chmod-tests)
-
-file(TOUCH ${CMAKE_CURRENT_BINARY_DIR}/chmod-tests/a)
-file(CHMOD ${CMAKE_CURRENT_BINARY_DIR}/chmod-tests/a PERMISSIONS)
+file(TOUCH ${CMAKE_CURRENT_BINARY_DIR}/a)
+file(CHMOD ${CMAKE_CURRENT_BINARY_DIR}/a PERMISSIONS)
diff --git a/Tests/RunCMake/file-CHMOD/ok.cmake b/Tests/RunCMake/file-CHMOD/ok.cmake
index 87e3e5766f..7c74d27761 100644
--- a/Tests/RunCMake/file-CHMOD/ok.cmake
+++ b/Tests/RunCMake/file-CHMOD/ok.cmake
@@ -1,5 +1,2 @@
-file(REMOVE_RECURSE ${CMAKE_CURRENT_BINARY_DIR}/chmod-tests)
-file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/chmod-tests)
-
-file(TOUCH ${CMAKE_CURRENT_BINARY_DIR}/chmod-tests/a)
-file(CHMOD ${CMAKE_CURRENT_BINARY_DIR}/chmod-tests/a PERMISSIONS OWNER_READ)
+file(TOUCH ${CMAKE_CURRENT_BINARY_DIR}/a)
+file(CHMOD ${CMAKE_CURRENT_BINARY_DIR}/a PERMISSIONS OWNER_READ)
diff --git a/Tests/RunCMake/file-CHMOD/override.cmake b/Tests/RunCMake/file-CHMOD/override.cmake
index d9226b835f..67e5a23cae 100644
--- a/Tests/RunCMake/file-CHMOD/override.cmake
+++ b/Tests/RunCMake/file-CHMOD/override.cmake
@@ -1,6 +1,3 @@
-file(REMOVE_RECURSE ${CMAKE_CURRENT_BINARY_DIR}/chmod-tests)
-file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/chmod-tests)
-
-file(TOUCH ${CMAKE_CURRENT_BINARY_DIR}/chmod-tests/a)
-file(CHMOD ${CMAKE_CURRENT_BINARY_DIR}/chmod-tests/a PERMISSIONS OWNER_READ
+file(TOUCH ${CMAKE_CURRENT_BINARY_DIR}/a)
+file(CHMOD ${CMAKE_CURRENT_BINARY_DIR}/a PERMISSIONS OWNER_READ
FILE_PERMISSIONS OWNER_READ OWNER_WRITE)
diff --git a/Tests/RunCMake/file-CHMOD/write-only-stderr.txt b/Tests/RunCMake/file-CHMOD/write-only-stderr.txt
index da310a2848..169a09266c 100644
--- a/Tests/RunCMake/file-CHMOD/write-only-stderr.txt
+++ b/Tests/RunCMake/file-CHMOD/write-only-stderr.txt
@@ -1,6 +1,6 @@
-CMake Error at write-only\.cmake:[0-9]+ \(file\):
+^CMake Error at [^
+]*/write-only\.cmake:[0-9]+ \(file\):
file failed to open for reading \(Permission denied\):
- .*/chmod-tests/a
-Call Stack \(most recent call first\):
- CMakeLists\.txt:[0-9]+ \(include\)
+ [^
+]*/Tests/RunCMake/file-CHMOD/write-only-build/a$
diff --git a/Tests/RunCMake/file-CHMOD/write-only.cmake b/Tests/RunCMake/file-CHMOD/write-only.cmake
index 1289efc103..aa9d8038b9 100644
--- a/Tests/RunCMake/file-CHMOD/write-only.cmake
+++ b/Tests/RunCMake/file-CHMOD/write-only.cmake
@@ -1,6 +1,3 @@
-file(REMOVE_RECURSE ${CMAKE_CURRENT_BINARY_DIR}/chmod-tests)
-file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/chmod-tests)
-
-file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/chmod-tests/a "CONTENT")
-file(CHMOD ${CMAKE_CURRENT_BINARY_DIR}/chmod-tests/a PERMISSIONS OWNER_WRITE)
-file(READ ${CMAKE_CURRENT_BINARY_DIR}/chmod-tests/a content)
+file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/a "CONTENT")
+file(CHMOD ${CMAKE_CURRENT_BINARY_DIR}/a PERMISSIONS OWNER_WRITE)
+file(READ ${CMAKE_CURRENT_BINARY_DIR}/a content)