| 23 | cmParseMumpsCoverage::~cmParseMumpsCoverage() = default; |
| 24 | |
| 25 | bool cmParseMumpsCoverage::ReadCoverageFile(char const* file) |
| 26 | { |
| 27 | // Read the gtm_coverage.mcov file, that has two lines of data: |
| 28 | // packages:/full/path/to/Vista/Packages |
| 29 | // coverage_dir:/full/path/to/dir/with/*.mcov |
| 30 | cmsys::ifstream in(file); |
| 31 | if (!in) { |
| 32 | return false; |
| 33 | } |
| 34 | std::string line; |
| 35 | while (cmSystemTools::GetLineFromStream(in, line)) { |
| 36 | std::string::size_type pos = line.find(':', 0); |
| 37 | std::string packages; |
| 38 | if (pos != std::string::npos) { |
| 39 | std::string type = line.substr(0, pos); |
| 40 | std::string path = line.substr(pos + 1); |
| 41 | if (type == "packages") { |
| 42 | this->LoadPackages(path); |
| 43 | } else if (type == "coverage_dir") { |
| 44 | this->LoadCoverageData(path); |
| 45 | } else { |
| 46 | cmCTestLog(this->CTest, ERROR_MESSAGE, |
| 47 | "Parse Error in Mumps coverage file :\n" |
| 48 | << file << "\ntype: [" << type << "]\npath:[" << path |
| 49 | << "]\n" |
| 50 | "input line: [" |
| 51 | << line << "]\n"); |
| 52 | } |
| 53 | } |
| 54 | } |
| 55 | return true; |
| 56 | } |
| 57 | |
| 58 | void cmParseMumpsCoverage::InitializeMumpsFile(std::string& file) |
| 59 | { |