summaryrefslogtreecommitdiffstats
path: root/Source/CTest/cmCTestCoverageHandler.cxx
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2011-10-22 14:38:16 (GMT)
committerDavid Cole <david.cole@kitware.com>2011-10-22 15:01:58 (GMT)
commit2f309cba455d0a946e935f66a53561ba64717faf (patch)
treeec3ab5e4cc06c84d4958eba48334db4371a95b21 /Source/CTest/cmCTestCoverageHandler.cxx
parentaf772893b856b50697f18c9bb7b1a0fb326cf715 (diff)
downloadCMake-2f309cba455d0a946e935f66a53561ba64717faf.zip
CMake-2f309cba455d0a946e935f66a53561ba64717faf.tar.gz
CMake-2f309cba455d0a946e935f66a53561ba64717faf.tar.bz2
CTest: Add COVERAGE_EXTRA_FLAGS cache variable (#12490)
COVERAGE_EXTRA_FLAGS is a space separated value of extra flags that will be passed to gcov when ctest's coverage handler invokes gcov to do coverage analysis. Map to CoverageExtraFlags in the CTest ini file. Use default value of "-l" to match the coverage handler's earlier behavior from ctest 2.8.4 and earlier. The fix for related issue #11717 had added a " -p" which was the cause of both #12415 and #12490. Here, we revert that change to the default value, so -p is no longer there by default. The people that care to add -p may do so in their own build trees by appending " -p" to the new cache variable COVERAGE_EXTRA_FLAGS.
Diffstat (limited to 'Source/CTest/cmCTestCoverageHandler.cxx')
-rw-r--r--Source/CTest/cmCTestCoverageHandler.cxx9
1 files changed, 7 insertions, 2 deletions
diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx
index 005651f..0b1c9fe 100644
--- a/Source/CTest/cmCTestCoverageHandler.cxx
+++ b/Source/CTest/cmCTestCoverageHandler.cxx
@@ -751,12 +751,15 @@ int cmCTestCoverageHandler::HandlePHPCoverage(
}
return static_cast<int>(cont->TotalCoverage.size());
}
+
//----------------------------------------------------------------------
int cmCTestCoverageHandler::HandleGCovCoverage(
cmCTestCoverageHandlerContainer* cont)
{
std::string gcovCommand
= this->CTest->GetCTestConfiguration("CoverageCommand");
+ std::string gcovExtraFlags
+ = this->CTest->GetCTestConfiguration("CoverageExtraFlags");
// Style 1
std::string st1gcovOutputRex1
@@ -825,8 +828,10 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
// Call gcov to get coverage data for this *.gcda file:
//
std::string fileDir = cmSystemTools::GetFilenamePath(it->c_str());
- std::string command = "\"" + gcovCommand + "\" -l -p -o \"" + fileDir
- + "\" \"" + *it + "\"";
+ std::string command = "\"" + gcovCommand + "\" " +
+ gcovExtraFlags + " " +
+ "-o \"" + fileDir + "\" " +
+ "\"" + *it + "\"";
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, command.c_str()
<< std::endl);