summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/CommandLine
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2023-11-02 14:02:41 (GMT)
committerKyle Edwards <kyle.edwards@kitware.com>2023-11-02 14:04:00 (GMT)
commitc4be9c914b045ceb91a7ac7120fc6c6422944ae5 (patch)
tree60e05ef7b295f5deea800ce05acf4e6af0c1af43 /Tests/RunCMake/CommandLine
parentae84de5a0c204bbb6ad808f9bae36ef71dcc4ca1 (diff)
downloadCMake-c4be9c914b045ceb91a7ac7120fc6c6422944ae5.zip
CMake-c4be9c914b045ceb91a7ac7120fc6c6422944ae5.tar.gz
CMake-c4be9c914b045ceb91a7ac7120fc6c6422944ae5.tar.bz2
cmSystemTools::RunSingleCommand(): Pass stdin to child process
Fixes: #25383
Diffstat (limited to 'Tests/RunCMake/CommandLine')
-rw-r--r--Tests/RunCMake/CommandLine/E_env-stdin-stdout.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_env-stdin.cmake4
-rw-r--r--Tests/RunCMake/CommandLine/RunCMakeTest.cmake1
3 files changed, 6 insertions, 0 deletions
diff --git a/Tests/RunCMake/CommandLine/E_env-stdin-stdout.txt b/Tests/RunCMake/CommandLine/E_env-stdin-stdout.txt
new file mode 100644
index 0000000..8210d59
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_env-stdin-stdout.txt
@@ -0,0 +1 @@
+^Hello world$
diff --git a/Tests/RunCMake/CommandLine/E_env-stdin.cmake b/Tests/RunCMake/CommandLine/E_env-stdin.cmake
new file mode 100644
index 0000000..4ff0ad2
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_env-stdin.cmake
@@ -0,0 +1,4 @@
+execute_process(
+ COMMAND ${CMAKE_COMMAND} -E echo "Hello world"
+ COMMAND ${CMAKE_COMMAND} -E env ${PRINT_STDIN_EXE}
+ )
diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
index 52be1bb..b29e50a 100644
--- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
@@ -791,6 +791,7 @@ run_cmake_command(E_env-no-command1 ${CMAKE_COMMAND} -E env TEST_ENV=1)
run_cmake_command(E_env-bad-arg1 ${CMAKE_COMMAND} -E env -bad-arg1)
run_cmake_command(E_env-set ${CMAKE_COMMAND} -E env TEST_ENV=1 ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/E_env-set.cmake)
run_cmake_command(E_env-unset ${CMAKE_COMMAND} -E env TEST_ENV=1 ${CMAKE_COMMAND} -E env --unset=TEST_ENV ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/E_env-unset.cmake)
+run_cmake_command(E_env-stdin ${CMAKE_COMMAND} -DPRINT_STDIN_EXE=${PRINT_STDIN_EXE} -P ${RunCMake_SOURCE_DIR}/E_env-stdin.cmake)
# To test whether the double dash (--) works for the env command, we need a command that e.g. contains an equals sign (=)
# and would normally be interpreted as an NAME=VALUE environment variable.