summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/file/LOCK-error-timeout.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/RunCMake/file/LOCK-error-timeout.cmake')
-rw-r--r--Tests/RunCMake/file/LOCK-error-timeout.cmake17
1 files changed, 17 insertions, 0 deletions
diff --git a/Tests/RunCMake/file/LOCK-error-timeout.cmake b/Tests/RunCMake/file/LOCK-error-timeout.cmake
new file mode 100644
index 0000000..b6b9476
--- /dev/null
+++ b/Tests/RunCMake/file/LOCK-error-timeout.cmake
@@ -0,0 +1,17 @@
+set(script "${CMAKE_CURRENT_LIST_DIR}/timeout-script.cmake")
+set(file_to_lock "${CMAKE_CURRENT_BINARY_DIR}/file-to-lock")
+
+file(LOCK "${file_to_lock}")
+execute_process(
+ COMMAND "${CMAKE_COMMAND}" "-Dfile_to_lock=${file_to_lock}" -P "${script}"
+ RESULT_VARIABLE result
+ OUTPUT_VARIABLE output
+ ERROR_VARIABLE error
+)
+
+message("Output: ${output}")
+message("Error: ${error}")
+
+if(NOT result EQUAL 0)
+ message(FATAL_ERROR "Result: ${result}")
+endif()