summaryrefslogtreecommitdiffstats
path: root/Source/CTest
diff options
context:
space:
mode:
authorDāvis Mosāns <davispuh@gmail.com>2016-11-01 18:36:58 (GMT)
committerDāvis Mosāns <davispuh@gmail.com>2016-11-14 23:00:46 (GMT)
commit40bd42dfbcafd572ccd3541f1f84177453c9c255 (patch)
treed6f0528a9320341c2163930a586bb4404501faed /Source/CTest
parent595feb323479ce6e8f8e8a3a863f9286d9f7bd64 (diff)
downloadCMake-40bd42dfbcafd572ccd3541f1f84177453c9c255.zip
CMake-40bd42dfbcafd572ccd3541f1f84177453c9c255.tar.gz
CMake-40bd42dfbcafd572ccd3541f1f84177453c9c255.tar.bz2
Add Encoding option for RunChild, RunMakeCommand and RunProcess
Diffstat (limited to 'Source/CTest')
-rw-r--r--Source/CTest/cmCTestBuildHandler.cxx4
-rw-r--r--Source/CTest/cmCTestBuildHandler.h5
-rw-r--r--Source/CTest/cmCTestVC.cxx9
-rw-r--r--Source/CTest/cmCTestVC.h6
4 files changed, 15 insertions, 9 deletions
diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx
index cd1f879..a455908 100644
--- a/Source/CTest/cmCTestBuildHandler.cxx
+++ b/Source/CTest/cmCTestBuildHandler.cxx
@@ -766,7 +766,7 @@ void cmCTestBuildHandler::LaunchHelper::WriteScrapeMatchers(
int cmCTestBuildHandler::RunMakeCommand(const char* command, int* retVal,
const char* dir, int timeout,
- std::ostream& ofs)
+ std::ostream& ofs, Encoding encoding)
{
// First generate the command and arguments
std::vector<std::string> args = cmSystemTools::ParseArguments(command);
@@ -810,7 +810,7 @@ int cmCTestBuildHandler::RunMakeCommand(const char* command, int* retVal,
char* data;
int length;
- cmProcessOutput processOutput;
+ cmProcessOutput processOutput(encoding);
std::string strdata;
cmCTestOptionalLog(
this->CTest, HANDLER_PROGRESS_OUTPUT, " Each symbol represents "
diff --git a/Source/CTest/cmCTestBuildHandler.h b/Source/CTest/cmCTestBuildHandler.h
index 9c64c10..a2f6112 100644
--- a/Source/CTest/cmCTestBuildHandler.h
+++ b/Source/CTest/cmCTestBuildHandler.h
@@ -7,6 +7,7 @@
#include "cmCTestGenericHandler.h"
+#include <cmProcessOutput.h>
#include <cmsys/RegularExpression.hxx>
#include <deque>
#include <iosfwd>
@@ -25,6 +26,7 @@ class cmCTestBuildHandler : public cmCTestGenericHandler
{
public:
typedef cmCTestGenericHandler Superclass;
+ typedef cmProcessOutput::Encoding Encoding;
/*
* The main entry point for this class
@@ -49,7 +51,8 @@ private:
//! Run command specialized for make and configure. Returns process status
// and retVal is return value or exception.
int RunMakeCommand(const char* command, int* retVal, const char* dir,
- int timeout, std::ostream& ofs);
+ int timeout, std::ostream& ofs,
+ Encoding encoding = cmProcessOutput::Auto);
enum
{
diff --git a/Source/CTest/cmCTestVC.cxx b/Source/CTest/cmCTestVC.cxx
index 7a2fa69..444c43d 100644
--- a/Source/CTest/cmCTestVC.cxx
+++ b/Source/CTest/cmCTestVC.cxx
@@ -76,7 +76,8 @@ bool cmCTestVC::InitialCheckout(const char* command)
}
bool cmCTestVC::RunChild(char const* const* cmd, OutputParser* out,
- OutputParser* err, const char* workDir)
+ OutputParser* err, const char* workDir,
+ Encoding encoding)
{
this->Log << this->ComputeCommandLine(cmd) << "\n";
@@ -84,7 +85,7 @@ bool cmCTestVC::RunChild(char const* const* cmd, OutputParser* out,
cmsysProcess_SetCommand(cp, cmd);
workDir = workDir ? workDir : this->SourceDirectory.c_str();
cmsysProcess_SetWorkingDirectory(cp, workDir);
- this->RunProcess(cp, out, err);
+ this->RunProcess(cp, out, err, encoding);
int result = cmsysProcess_GetExitValue(cp);
cmsysProcess_Delete(cp);
return result == 0;
@@ -102,7 +103,7 @@ std::string cmCTestVC::ComputeCommandLine(char const* const* cmd)
}
bool cmCTestVC::RunUpdateCommand(char const* const* cmd, OutputParser* out,
- OutputParser* err)
+ OutputParser* err, Encoding encoding)
{
// Report the command line.
this->UpdateCommandLine = this->ComputeCommandLine(cmd);
@@ -112,7 +113,7 @@ bool cmCTestVC::RunUpdateCommand(char const* const* cmd, OutputParser* out,
}
// Run the command.
- return this->RunChild(cmd, out, err);
+ return this->RunChild(cmd, out, err, CM_NULLPTR, encoding);
}
std::string cmCTestVC::GetNightlyTime()
diff --git a/Source/CTest/cmCTestVC.h b/Source/CTest/cmCTestVC.h
index 4f2bba0..dd8b973 100644
--- a/Source/CTest/cmCTestVC.h
+++ b/Source/CTest/cmCTestVC.h
@@ -116,11 +116,13 @@ protected:
/** Run a command line and send output to given parsers. */
bool RunChild(char const* const* cmd, OutputParser* out, OutputParser* err,
- const char* workDir = CM_NULLPTR);
+ const char* workDir = CM_NULLPTR,
+ Encoding encoding = cmProcessOutput::Auto);
/** Run VC update command line and send output to given parsers. */
bool RunUpdateCommand(char const* const* cmd, OutputParser* out,
- OutputParser* err = CM_NULLPTR);
+ OutputParser* err = CM_NULLPTR,
+ Encoding encoding = cmProcessOutput::Auto);
/** Write xml element for one file. */
void WriteXMLEntry(cmXMLWriter& xml, std::string const& path,