summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/File_Generate/RunCMakeTest.cmake
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2014-07-22 13:10:57 (GMT)
committerStephen Kelly <steveire@gmail.com>2014-11-04 21:38:22 (GMT)
commit81afbbc09bac6913e2b83f7eb68923ff5b1911d5 (patch)
tree5ef96145b947affec91a86ae6d009e5a7d03929c /Tests/RunCMake/File_Generate/RunCMakeTest.cmake
parentdb3cfc3376f2021f7c80ba220ecada64832b5ee1 (diff)
downloadCMake-81afbbc09bac6913e2b83f7eb68923ff5b1911d5.zip
CMake-81afbbc09bac6913e2b83f7eb68923ff5b1911d5.tar.gz
CMake-81afbbc09bac6913e2b83f7eb68923ff5b1911d5.tar.bz2
file(GENERATE): Use permissions of input file if present.
Diffstat (limited to 'Tests/RunCMake/File_Generate/RunCMakeTest.cmake')
-rw-r--r--Tests/RunCMake/File_Generate/RunCMakeTest.cmake18
1 files changed, 18 insertions, 0 deletions
diff --git a/Tests/RunCMake/File_Generate/RunCMakeTest.cmake b/Tests/RunCMake/File_Generate/RunCMakeTest.cmake
index dee0692..578df81 100644
--- a/Tests/RunCMake/File_Generate/RunCMakeTest.cmake
+++ b/Tests/RunCMake/File_Generate/RunCMakeTest.cmake
@@ -35,3 +35,21 @@ unset(RunCMake_TEST_NO_CLEAN)
if (NOT timestamp_after STREQUAL timestamp)
message(SEND_ERROR "WriteIfDifferent changed output file.")
endif()
+
+if (UNIX AND EXISTS /bin/sh)
+ set(RunCMake_TEST_NO_CLEAN ON)
+ run_cmake(CarryPermissions)
+ execute_process(
+ COMMAND "${RunCMake_BINARY_DIR}/CarryPermissions-build/output_script.sh"
+ OUTPUT_VARIABLE script_output
+ RESULT_VARIABLE script_result
+ ERROR_VARIABLE script_error
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ )
+ if (script_result)
+ message(SEND_ERROR "Generated script did not execute correctly: [${script_result}]\n${script_output}\n====\n${script_error}")
+ endif()
+ if (NOT script_output STREQUAL SUCCESS)
+ message(SEND_ERROR "Generated script did not execute correctly:\n${script_output}\n====\n${script_error}")
+ endif()
+endif()