summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/execute_process/EchoVariable.cmake
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2020-04-07 18:54:54 (GMT)
committerKyle Edwards <kyle.edwards@kitware.com>2020-04-07 18:54:54 (GMT)
commitd54f0aa9b71dfcc04f077e5b19c6122cb4b98d83 (patch)
tree987fbabfbdda89ed4aaea7fa9c99ee99f4e27084 /Tests/RunCMake/execute_process/EchoVariable.cmake
parent2f949be4b3a4e9da43a1c445300084a2d63837e2 (diff)
parentb8b804e2ed8dca3c6d116a6e8a1cb66cbd6ad241 (diff)
downloadCMake-d54f0aa9b71dfcc04f077e5b19c6122cb4b98d83.zip
CMake-d54f0aa9b71dfcc04f077e5b19c6122cb4b98d83.tar.gz
CMake-d54f0aa9b71dfcc04f077e5b19c6122cb4b98d83.tar.bz2
Merge branch 'master' into ninja-order-depends
Diffstat (limited to 'Tests/RunCMake/execute_process/EchoVariable.cmake')
-rw-r--r--Tests/RunCMake/execute_process/EchoVariable.cmake23
1 files changed, 23 insertions, 0 deletions
diff --git a/Tests/RunCMake/execute_process/EchoVariable.cmake b/Tests/RunCMake/execute_process/EchoVariable.cmake
new file mode 100644
index 0000000..99999c7
--- /dev/null
+++ b/Tests/RunCMake/execute_process/EchoVariable.cmake
@@ -0,0 +1,23 @@
+execute_process(
+ COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_LIST_DIR}/EchoVariableOutput.cmake
+ OUTPUT_VARIABLE stdout
+ ERROR_QUIET
+ ECHO_OUTPUT_VARIABLE
+)
+
+file(READ ${CMAKE_CURRENT_LIST_DIR}/EchoVariable-stdout.txt expected_stdout)
+if (NOT stdout MATCHES "${expected_stdout}")
+ message(FATAL_ERROR "stdout differs from the expected stdout")
+endif()
+
+execute_process(
+ COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_LIST_DIR}/EchoVariableOutput.cmake
+ ERROR_VARIABLE stderr
+ OUTPUT_QUIET
+ ECHO_ERROR_VARIABLE
+)
+
+file(READ ${CMAKE_CURRENT_LIST_DIR}/EchoVariable-stderr.txt expected_stderr)
+if (NOT stderr MATCHES "${expected_stderr}")
+ message(FATAL_ERROR "stderr differs from the expected stderr")
+endif()