summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2023-11-03 14:28:24 (GMT)
committerKitware Robot <kwrobot@kitware.com>2023-11-03 14:28:36 (GMT)
commitcee364e77fae1d2a8840a38f66686fc01eff7596 (patch)
tree0536092c2e33bc9dfac99e8d08aab9e48aa8658d /Tests
parent6b28b1b933d342ce8a0b9b9f26996ac7c44f81a6 (diff)
parentc4be9c914b045ceb91a7ac7120fc6c6422944ae5 (diff)
downloadCMake-cee364e77fae1d2a8840a38f66686fc01eff7596.zip
CMake-cee364e77fae1d2a8840a38f66686fc01eff7596.tar.gz
CMake-cee364e77fae1d2a8840a38f66686fc01eff7596.tar.bz2
Merge topic 'cmsystemtools-runsinglecommand-stdin'
c4be9c914b cmSystemTools::RunSingleCommand(): Pass stdin to child process Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !8941
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/CMakeLists.txt3
-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
4 files changed, 8 insertions, 1 deletions
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 1b1ecb5..9902e0a 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -837,7 +837,8 @@ endif()
add_executable(pseudo_llvm-rc pseudo_llvm-rc.c)
add_RunCMake_test(CommandLine -DLLVM_RC=$<TARGET_FILE:pseudo_llvm-rc> -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}
-DCYGWIN=${CYGWIN} -DMSYS=${MSYS} -DPython_EXECUTABLE=${Python_EXECUTABLE}
- -DEXIT_CODE_EXE=$<TARGET_FILE:exit_code>)
+ -DEXIT_CODE_EXE=$<TARGET_FILE:exit_code>
+ -DPRINT_STDIN_EXE=$<TARGET_FILE:print_stdin>)
add_RunCMake_test(CommandLineTar)
if(CMAKE_PLATFORM_NO_VERSIONED_SONAME OR (NOT CMAKE_SHARED_LIBRARY_SONAME_FLAG AND NOT CMAKE_SHARED_LIBRARY_SONAME_C_FLAG))
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.