diff options
author | David Cole <david.cole@kitware.com> | 2012-05-17 18:58:54 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2012-05-17 18:58:54 (GMT) |
commit | 8e9101a0cb81374a619686ee820c86d0531d6372 (patch) | |
tree | 7b1d077d46d1c76acbc6d1f80565c5b954d78918 /Source/CTest/cmCTestCoverageHandler.cxx | |
parent | 8f635d0268be899286669f1a8be5da6c97671470 (diff) | |
parent | c806b23cfe08259efed1ed310613f65c16a60680 (diff) | |
download | CMake-8e9101a0cb81374a619686ee820c86d0531d6372.zip CMake-8e9101a0cb81374a619686ee820c86d0531d6372.tar.gz CMake-8e9101a0cb81374a619686ee820c86d0531d6372.tar.bz2 |
Merge topic 'mumps_coverage'
c806b23 CDash now supports lots of files in coverage. So, show all files.
761d931 Do not try to run bullseye coverage if COVFILE env is empty.
5b69ce4 Update test data to match new coverage format.
1b418f1 Change GT.M Coverage Parser global
b0c07a1 Disable bullseye coverage for mumps coverage test.
0a169e6 Remove uncovered files from cache coverage data.
a7abf5e Add ability to specify more than one package directory or coverage directory.
220afca Use <TARGET_FILE> expression to run ctest so it works with Xcode and VS IDE.
62f6bce Use a script to run the test because WORKING_DIRECTORY is not in 2.8.2.
f5c5db0 Fix some warnings and a bug where it went past the length of a vector.
7955e99 Add support for Cache coverage.
a86cd33 Add virutal destructor to silence warning.
319eeb0 Add test for mumps coverage. Also refactor code to prepare for cache coverage.
72210c2 Fix line length.
dd07161 Fix warning about char* instead of const char*.
e6412e0 Add support to ctest for GTM mumps coverage.
Diffstat (limited to 'Source/CTest/cmCTestCoverageHandler.cxx')
-rw-r--r-- | Source/CTest/cmCTestCoverageHandler.cxx | 52 |
1 files changed, 51 insertions, 1 deletions
diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx index 15c02b4..81d3669 100644 --- a/Source/CTest/cmCTestCoverageHandler.cxx +++ b/Source/CTest/cmCTestCoverageHandler.cxx @@ -11,6 +11,8 @@ ============================================================================*/ #include "cmCTestCoverageHandler.h" #include "cmParsePHPCoverage.h" +#include "cmParseGTMCoverage.h" +#include "cmParseCacheCoverage.h" #include "cmCTest.h" #include "cmake.h" #include "cmMakefile.h" @@ -373,21 +375,29 @@ int cmCTestCoverageHandler::ProcessHandler() } int file_count = 0; file_count += this->HandleGCovCoverage(&cont); + error = cont.Error; if ( file_count < 0 ) { return error; } file_count += this->HandleTracePyCoverage(&cont); + error = cont.Error; if ( file_count < 0 ) { return error; } file_count += this->HandlePHPCoverage(&cont); + error = cont.Error; if ( file_count < 0 ) { return error; } + file_count += this->HandleMumpsCoverage(&cont); error = cont.Error; + if ( file_count < 0 ) + { + return error; + } std::set<std::string> uncovered = this->FindUncoveredFiles(&cont); @@ -751,6 +761,46 @@ int cmCTestCoverageHandler::HandlePHPCoverage( } return static_cast<int>(cont->TotalCoverage.size()); } +//---------------------------------------------------------------------- +int cmCTestCoverageHandler::HandleMumpsCoverage( + cmCTestCoverageHandlerContainer* cont) +{ + // try gtm coverage + cmParseGTMCoverage cov(*cont, this->CTest); + std::string coverageFile = this->CTest->GetBinaryDir() + + "/gtm_coverage.mcov"; + if(cmSystemTools::FileExists(coverageFile.c_str())) + { + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + "Parsing Cache Coverage: " << coverageFile + << std::endl); + cov.ReadCoverageFile(coverageFile.c_str()); + return static_cast<int>(cont->TotalCoverage.size()); + } + else + { + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + " Cannot find foobar GTM coverage file: " << coverageFile + << std::endl); + } + cmParseCacheCoverage ccov(*cont, this->CTest); + coverageFile = this->CTest->GetBinaryDir() + + "/cache_coverage.cmcov"; + if(cmSystemTools::FileExists(coverageFile.c_str())) + { + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + "Parsing Cache Coverage: " << coverageFile + << std::endl); + ccov.ReadCoverageFile(coverageFile.c_str()); + } + else + { + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + " Cannot find Cache coverage file: " << coverageFile + << std::endl); + } + return static_cast<int>(cont->TotalCoverage.size()); +} struct cmCTestCoverageHandlerLocale { @@ -1806,7 +1856,7 @@ int cmCTestCoverageHandler::HandleBullseyeCoverage( cmCTestCoverageHandlerContainer* cont) { const char* covfile = cmSystemTools::GetEnv("COVFILE"); - if(!covfile) + if(!covfile || strlen(covfile) == 0) { cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " COVFILE environment variable not found, not running " |