diff options
Diffstat (limited to 'Tests/RunCMake/File_Generate')
5 files changed, 28 insertions, 0 deletions
diff --git a/Tests/RunCMake/File_Generate/CarryPermissions-result.txt b/Tests/RunCMake/File_Generate/CarryPermissions-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/File_Generate/CarryPermissions-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/File_Generate/CarryPermissions-stderr.txt b/Tests/RunCMake/File_Generate/CarryPermissions-stderr.txt new file mode 100644 index 0000000..10f3293 --- /dev/null +++ b/Tests/RunCMake/File_Generate/CarryPermissions-stderr.txt @@ -0,0 +1 @@ +^$ diff --git a/Tests/RunCMake/File_Generate/CarryPermissions.cmake b/Tests/RunCMake/File_Generate/CarryPermissions.cmake new file mode 100644 index 0000000..a04334f --- /dev/null +++ b/Tests/RunCMake/File_Generate/CarryPermissions.cmake @@ -0,0 +1,5 @@ + +file(GENERATE + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/output_script.sh" + INPUT "${CMAKE_CURRENT_SOURCE_DIR}/input_script.sh" +) 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() diff --git a/Tests/RunCMake/File_Generate/input_script.sh b/Tests/RunCMake/File_Generate/input_script.sh new file mode 100755 index 0000000..2cc0983 --- /dev/null +++ b/Tests/RunCMake/File_Generate/input_script.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +echo "$<$<STREQUAL:foo,foo>:SUCCESS>" |