diff options
author | Brad King <brad.king@kitware.com> | 2022-07-18 21:48:21 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-07-20 20:03:12 (GMT) |
commit | 1cf2c94c69cffeb5dde30ca13e5f341f184b3b4c (patch) | |
tree | fac9f175cbb0baa96cbd8162375574a49d6265eb /Tests | |
parent | 11a0f72ac0aa0553d61f7a72e839ec7e88460268 (diff) | |
download | CMake-1cf2c94c69cffeb5dde30ca13e5f341f184b3b4c.zip CMake-1cf2c94c69cffeb5dde30ca13e5f341f184b3b4c.tar.gz CMake-1cf2c94c69cffeb5dde30ca13e5f341f184b3b4c.tar.bz2 |
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')
-rw-r--r-- | Tests/RunCMake/file-CHMOD/RunCMakeTest.cmake | 16 | ||||
-rw-r--r-- | Tests/RunCMake/file-CHMOD/all-perms-stderr.txt | 7 | ||||
-rw-r--r-- | Tests/RunCMake/file-CHMOD/all-perms.cmake | 7 | ||||
-rw-r--r-- | Tests/RunCMake/file-CHMOD/invalid-path-stderr.txt | 8 | ||||
-rw-r--r-- | Tests/RunCMake/file-CHMOD/invalid-path.cmake | 5 | ||||
-rw-r--r-- | Tests/RunCMake/file-CHMOD/invalid-perms-stderr.txt | 7 | ||||
-rw-r--r-- | Tests/RunCMake/file-CHMOD/invalid-perms.cmake | 7 | ||||
-rw-r--r-- | Tests/RunCMake/file-CHMOD/no-keyword-stderr.txt | 7 | ||||
-rw-r--r-- | Tests/RunCMake/file-CHMOD/no-keyword.cmake | 7 | ||||
-rw-r--r-- | Tests/RunCMake/file-CHMOD/no-perms-stderr.txt | 7 | ||||
-rw-r--r-- | Tests/RunCMake/file-CHMOD/no-perms.cmake | 7 | ||||
-rw-r--r-- | Tests/RunCMake/file-CHMOD/ok.cmake | 7 | ||||
-rw-r--r-- | Tests/RunCMake/file-CHMOD/override.cmake | 7 | ||||
-rw-r--r-- | Tests/RunCMake/file-CHMOD/write-only-stderr.txt | 8 | ||||
-rw-r--r-- | Tests/RunCMake/file-CHMOD/write-only.cmake | 9 |
15 files changed, 44 insertions, 72 deletions
diff --git a/Tests/RunCMake/file-CHMOD/RunCMakeTest.cmake b/Tests/RunCMake/file-CHMOD/RunCMakeTest.cmake index 52b6d4e..52a8ad6 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 8853aed..6932a1f 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 b49583d..5ff81b8 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 f2f9c82..eb5fb31 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 36915c1..e8b0313 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 003252a..daab22e 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 22cab0b..42129b9 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 1dfc6a9..41624a3 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 8b62106..602cfc2 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 1d18464..4c5a139 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 9fbd359..346f946 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 87e3e57..7c74d27 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 d9226b8..67e5a23 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 da310a2..169a092 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 1289efc..aa9d803 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) |