summaryrefslogtreecommitdiffstats
path: root/Source/CTest
diff options
context:
space:
mode:
Diffstat (limited to 'Source/CTest')
-rw-r--r--Source/CTest/cmCTestCoverageHandler.cxx32
-rw-r--r--Source/CTest/cmCTestMemCheckHandler.cxx2
-rw-r--r--Source/CTest/cmCTestRunTest.cxx2
-rw-r--r--Source/CTest/cmCTestScriptHandler.cxx6
4 files changed, 33 insertions, 9 deletions
diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx
index bb39e0d..81d3669 100644
--- a/Source/CTest/cmCTestCoverageHandler.cxx
+++ b/Source/CTest/cmCTestCoverageHandler.cxx
@@ -802,6 +802,33 @@ int cmCTestCoverageHandler::HandleMumpsCoverage(
return static_cast<int>(cont->TotalCoverage.size());
}
+struct cmCTestCoverageHandlerLocale
+{
+ cmCTestCoverageHandlerLocale()
+ {
+ if(const char* l = cmSystemTools::GetEnv("LC_ALL"))
+ {
+ lc_all = l;
+ }
+ if(lc_all != "C")
+ {
+ cmSystemTools::PutEnv("LC_ALL=C");
+ }
+ }
+ ~cmCTestCoverageHandlerLocale()
+ {
+ if(!lc_all.empty())
+ {
+ cmSystemTools::PutEnv(("LC_ALL=" + lc_all).c_str());
+ }
+ else
+ {
+ cmSystemTools::UnsetEnv("LC_ALL");
+ }
+ }
+ std::string lc_all;
+};
+
//----------------------------------------------------------------------
int cmCTestCoverageHandler::HandleGCovCoverage(
cmCTestCoverageHandlerContainer* cont)
@@ -823,7 +850,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
std::string st2gcovOutputRex1 = "^File *[`'](.*)'$";
std::string st2gcovOutputRex2
= "Lines executed: *[0-9]+\\.[0-9]+% of [0-9]+$";
- std::string st2gcovOutputRex3 = "^(.*):creating [`'](.*\\.gcov)'";
+ std::string st2gcovOutputRex3 = "^(.*)reating [`'](.*\\.gcov)'";
std::string st2gcovOutputRex4 = "^(.*):unexpected EOF *$";
std::string st2gcovOutputRex5 = "^(.*):cannot open source file*$";
std::string st2gcovOutputRex6
@@ -865,7 +892,8 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
int file_count = 0;
// make sure output from gcov is in English!
- cmSystemTools::PutEnv("LC_ALL=POSIX");
+ cmCTestCoverageHandlerLocale locale_C;
+ static_cast<void>(locale_C);
// files is a list of *.da and *.gcda files with coverage data in them.
// These are binary files that you give as input to gcov so that it will
diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx
index 035aaa9..3e4ecdd 100644
--- a/Source/CTest/cmCTestMemCheckHandler.cxx
+++ b/Source/CTest/cmCTestMemCheckHandler.cxx
@@ -358,7 +358,7 @@ void cmCTestMemCheckHandler::GenerateDartOutput(std::ostream& os)
os
<< "\t\t</Results>\n"
- << logTag << memcheckstr << std::endl
+ << logTag << cmXMLSafe(memcheckstr) << std::endl
<< "\t</Log>\n";
this->WriteTestResultFooter(os, result);
if ( current < cc )
diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx
index 81f18b0..c3de5dc 100644
--- a/Source/CTest/cmCTestRunTest.cxx
+++ b/Source/CTest/cmCTestRunTest.cxx
@@ -671,7 +671,7 @@ bool cmCTestRunTest::ForkProcess(double testTimeOut, bool explicitTimeout,
if (environment && environment->size()>0)
{
- cmSystemTools::AppendEnv(environment);
+ cmSystemTools::AppendEnv(*environment);
}
return this->TestProcess->StartProcess();
diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx
index 5841b8d..d3ab2ef 100644
--- a/Source/CTest/cmCTestScriptHandler.cxx
+++ b/Source/CTest/cmCTestScriptHandler.cxx
@@ -643,11 +643,7 @@ int cmCTestScriptHandler::RunCurrentScript()
{
std::vector<std::string> envArgs;
cmSystemTools::ExpandListArgument(this->CTestEnv.c_str(),envArgs);
- // for each variable/argument do a putenv
- for (unsigned i = 0; i < envArgs.size(); ++i)
- {
- cmSystemTools::PutEnv(envArgs[i].c_str());
- }
+ cmSystemTools::AppendEnv(envArgs);
}
// now that we have done most of the error checking finally run the