diff options
author | Brad King <brad.king@kitware.com> | 2016-12-02 14:54:09 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2016-12-02 14:54:09 (GMT) |
commit | f7425c2177e3368ec83e2731cc092dcd2a999d82 (patch) | |
tree | 9d94cabc91f3cc9c343d16ea3b661f81ec64ebcd /Tests/RunCMake | |
parent | bd6a269e1acf7f5634d05bb085d9e12cf51e9e35 (diff) | |
parent | 2ed473b3b8e28485e6a14a49c7e0e4133eb02eee (diff) | |
download | CMake-f7425c2177e3368ec83e2731cc092dcd2a999d82.zip CMake-f7425c2177e3368ec83e2731cc092dcd2a999d82.tar.gz CMake-f7425c2177e3368ec83e2731cc092dcd2a999d82.tar.bz2 |
Merge topic 'execute_process-encoding'
2ed473b3 execute_process: Add ENCODING option for Windows child process output
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r-- | Tests/RunCMake/CMakeLists.txt | 3 | ||||
-rw-r--r-- | Tests/RunCMake/RunCMake.cmake | 2 | ||||
-rw-r--r-- | Tests/RunCMake/execute_process/CMakeLists.txt | 3 | ||||
-rw-r--r-- | Tests/RunCMake/execute_process/Encoding.cmake | 6 | ||||
-rw-r--r-- | Tests/RunCMake/execute_process/EncodingMissing-result.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/execute_process/EncodingMissing-stderr.txt | 4 | ||||
-rw-r--r-- | Tests/RunCMake/execute_process/EncodingMissing.cmake | 1 | ||||
-rw-r--r-- | Tests/RunCMake/execute_process/EncodingUTF8-stderr.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/execute_process/RunCMakeTest.cmake | 5 |
9 files changed, 26 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 9dc540f..c02b917 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -179,6 +179,9 @@ add_RunCMake_test(add_custom_target) add_RunCMake_test(add_dependencies) add_RunCMake_test(add_subdirectory) add_RunCMake_test(build_command) +if(NOT CMake_TEST_EXTERNAL_CMAKE) + set(execute_process_ARGS -DTEST_ENCODING_EXE=$<TARGET_FILE:testEncoding>) +endif() add_RunCMake_test(execute_process) add_RunCMake_test(export) add_RunCMake_test(cmake_minimum_required) diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake index 247855a..6cc3054 100644 --- a/Tests/RunCMake/RunCMake.cmake +++ b/Tests/RunCMake/RunCMake.cmake @@ -75,6 +75,7 @@ function(run_cmake test) OUTPUT_VARIABLE actual_stdout ERROR_VARIABLE ${actual_stderr_var} RESULT_VARIABLE actual_result + ENCODING UTF8 ${maybe_timeout} ) else() @@ -90,6 +91,7 @@ function(run_cmake test) OUTPUT_VARIABLE actual_stdout ERROR_VARIABLE ${actual_stderr_var} RESULT_VARIABLE actual_result + ENCODING UTF8 ${maybe_timeout} ) endif() diff --git a/Tests/RunCMake/execute_process/CMakeLists.txt b/Tests/RunCMake/execute_process/CMakeLists.txt new file mode 100644 index 0000000..a640c56 --- /dev/null +++ b/Tests/RunCMake/execute_process/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.7) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/execute_process/Encoding.cmake b/Tests/RunCMake/execute_process/Encoding.cmake new file mode 100644 index 0000000..3dc7c39 --- /dev/null +++ b/Tests/RunCMake/execute_process/Encoding.cmake @@ -0,0 +1,6 @@ +execute_process( + COMMAND ${TEST_ENCODING_EXE} ${TEST_ENCODING} ${CMAKE_CURRENT_LIST_DIR}/EncodingUTF8-stderr.txt + OUTPUT_VARIABLE out + ENCODING ${TEST_ENCODING} + ) +message("${out}") diff --git a/Tests/RunCMake/execute_process/EncodingMissing-result.txt b/Tests/RunCMake/execute_process/EncodingMissing-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/execute_process/EncodingMissing-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/execute_process/EncodingMissing-stderr.txt b/Tests/RunCMake/execute_process/EncodingMissing-stderr.txt new file mode 100644 index 0000000..1a69579 --- /dev/null +++ b/Tests/RunCMake/execute_process/EncodingMissing-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at EncodingMissing.cmake:[0-9]+ \(execute_process\): + execute_process called with no value for ENCODING. +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/execute_process/EncodingMissing.cmake b/Tests/RunCMake/execute_process/EncodingMissing.cmake new file mode 100644 index 0000000..ae97480 --- /dev/null +++ b/Tests/RunCMake/execute_process/EncodingMissing.cmake @@ -0,0 +1 @@ +execute_process(ENCODING) diff --git a/Tests/RunCMake/execute_process/EncodingUTF8-stderr.txt b/Tests/RunCMake/execute_process/EncodingUTF8-stderr.txt new file mode 100644 index 0000000..0ac68de --- /dev/null +++ b/Tests/RunCMake/execute_process/EncodingUTF8-stderr.txt @@ -0,0 +1 @@ +यूनिकोड είναι very здорово! diff --git a/Tests/RunCMake/execute_process/RunCMakeTest.cmake b/Tests/RunCMake/execute_process/RunCMakeTest.cmake index 2080437..62e18c6 100644 --- a/Tests/RunCMake/execute_process/RunCMakeTest.cmake +++ b/Tests/RunCMake/execute_process/RunCMakeTest.cmake @@ -6,3 +6,8 @@ unset(RunCMake_TEST_OUTPUT_MERGE) run_cmake_command(MergeOutputFile ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/MergeOutputFile.cmake) run_cmake_command(MergeOutputVars ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/MergeOutputVars.cmake) + +run_cmake(EncodingMissing) +if(TEST_ENCODING_EXE) + run_cmake_command(EncodingUTF8 ${CMAKE_COMMAND} -DTEST_ENCODING=UTF8 -DTEST_ENCODING_EXE=${TEST_ENCODING_EXE} -P ${RunCMake_SOURCE_DIR}/Encoding.cmake) +endif() |