diff options
author | David Cole <david.cole@kitware.com> | 2012-04-25 18:02:09 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2012-04-25 18:02:09 (GMT) |
commit | ee35d8a0eac00abb041f6e4005579f1b97890b5f (patch) | |
tree | 1362b331e105a7c49eca8f094c34d8853efb7bcb | |
parent | 65a4926326ccc7e76187f10909223a664ceb244c (diff) | |
parent | 3247d63abbb0ed2c5aafcc14ef693db769eeb055 (diff) | |
download | CMake-ee35d8a0eac00abb041f6e4005579f1b97890b5f.zip CMake-ee35d8a0eac00abb041f6e4005579f1b97890b5f.tar.gz CMake-ee35d8a0eac00abb041f6e4005579f1b97890b5f.tar.bz2 |
Merge topic 'ctest_coverage-locale'
3247d63 ctest_coverage: Save/restore LC_ALL around gcov (#13136)
-rw-r--r-- | Source/CTest/cmCTestCoverageHandler.cxx | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx index 309abb1..ae06b0f 100644 --- a/Source/CTest/cmCTestCoverageHandler.cxx +++ b/Source/CTest/cmCTestCoverageHandler.cxx @@ -752,6 +752,33 @@ int cmCTestCoverageHandler::HandlePHPCoverage( 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) @@ -815,7 +842,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 |