summaryrefslogtreecommitdiffstats
path: root/Source/CTest/cmCTestSubmitHandler.cxx
diff options
context:
space:
mode:
authorDāvis Mosāns <davispuh@gmail.com>2016-11-01 18:29:17 (GMT)
committerDāvis Mosāns <davispuh@gmail.com>2016-11-14 19:21:20 (GMT)
commit595feb323479ce6e8f8e8a3a863f9286d9f7bd64 (patch)
tree26a12439994c3b2480b859d8b8eda20681cb2c98 /Source/CTest/cmCTestSubmitHandler.cxx
parent96103972ea1c478a2845fb68aee70a3395c148e0 (diff)
downloadCMake-595feb323479ce6e8f8e8a3a863f9286d9f7bd64.zip
CMake-595feb323479ce6e8f8e8a3a863f9286d9f7bd64.tar.gz
CMake-595feb323479ce6e8f8e8a3a863f9286d9f7bd64.tar.bz2
Windows: Encode child process output to internally-used encoding
Typically Windows applications (eg. MSVC compiler) use current console's codepage for output to pipes so we need to encode that to our internally-used encoding (`KWSYS_ENCODING_DEFAULT_CODEPAGE`).
Diffstat (limited to 'Source/CTest/cmCTestSubmitHandler.cxx')
-rw-r--r--Source/CTest/cmCTestSubmitHandler.cxx13
1 files changed, 12 insertions, 1 deletions
diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx
index 8383132..2b2d207 100644
--- a/Source/CTest/cmCTestSubmitHandler.cxx
+++ b/Source/CTest/cmCTestSubmitHandler.cxx
@@ -7,6 +7,7 @@
#include "cmCTestScriptHandler.h"
#include "cmCurl.h"
#include "cmGeneratedFileStream.h"
+#include "cmProcessOutput.h"
#include "cmState.h"
#include "cmStateTypes.h"
#include "cmSystemTools.h"
@@ -784,10 +785,20 @@ bool cmCTestSubmitHandler::SubmitUsingSCP(const std::string& scp_command,
cmsysProcess_Execute(cp);
char* data;
int length;
+ cmProcessOutput processOutput;
+ std::string strdata;
while (cmsysProcess_WaitForData(cp, &data, &length, CM_NULLPTR)) {
+ processOutput.DecodeText(data, length, strdata);
cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
- cmCTestLogWrite(data, length), this->Quiet);
+ cmCTestLogWrite(strdata.c_str(), strdata.size()),
+ this->Quiet);
+ }
+ processOutput.DecodeText(std::string(), strdata);
+ if (!strdata.empty()) {
+ cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
+ cmCTestLogWrite(strdata.c_str(), strdata.size()),
+ this->Quiet);
}
cmsysProcess_WaitForExit(cp, CM_NULLPTR);