clearly it would be nice if this were broken up into a few smaller functions and commented...
| 188 | // clearly it would be nice if this were broken up into a few smaller |
| 189 | // functions and commented... |
| 190 | int cmCTestCoverageHandler::ProcessHandler() |
| 191 | { |
| 192 | this->CTest->ClearSubmitFiles(cmCTest::PartCoverage); |
| 193 | int error = 0; |
| 194 | // do we have time for this |
| 195 | if (this->CTest->GetRemainingTimeAllowed() < std::chrono::minutes(2)) { |
| 196 | return error; |
| 197 | } |
| 198 | |
| 199 | std::string coverage_start_time = this->CTest->CurrentTime(); |
| 200 | auto coverage_start_time_time = std::chrono::system_clock::now(); |
| 201 | std::string sourceDir = |
| 202 | this->CTest->GetCTestConfiguration("SourceDirectory"); |
| 203 | std::string binaryDir = this->CTest->GetCTestConfiguration("BuildDirectory"); |
| 204 | |
| 205 | if (binaryDir.empty()) { |
| 206 | cmCTestLog(this->CTest, ERROR_MESSAGE, |
| 207 | "Binary directory is not set. " |
| 208 | "No coverage checking will be performed." |
| 209 | << std::endl); |
| 210 | return 0; |
| 211 | } |
| 212 | this->LoadLabels(); |
| 213 | |
| 214 | cmGeneratedFileStream ofs; |
| 215 | auto elapsed_time_start = std::chrono::steady_clock::now(); |
| 216 | if (!this->StartLogFile("Coverage", ofs)) { |
| 217 | cmCTestLog(this->CTest, ERROR_MESSAGE, |
| 218 | "Cannot create LastCoverage.log file" << std::endl); |
| 219 | } |
| 220 | |
| 221 | ofs << "Performing coverage: " |
| 222 | << elapsed_time_start.time_since_epoch().count() << std::endl; |
| 223 | this->CleanCoverageLogFiles(ofs); |
| 224 | |
| 225 | cmSystemTools::ConvertToUnixSlashes(sourceDir); |
| 226 | cmSystemTools::ConvertToUnixSlashes(binaryDir); |
| 227 | |
| 228 | cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, |
| 229 | "Performing coverage" << std::endl, this->Quiet); |
| 230 | |
| 231 | cmCTestCoverageHandlerContainer cont; |
| 232 | cont.Error = error; |
| 233 | cont.SourceDir = sourceDir; |
| 234 | cont.BinaryDir = binaryDir; |
| 235 | cont.OFS = &ofs; |
| 236 | cont.Quiet = this->Quiet; |
| 237 | |
| 238 | // setup the regex exclude stuff |
| 239 | this->CustomCoverageExcludeRegex.clear(); |
| 240 | for (std::string const& rex : this->CustomCoverageExclude) { |
| 241 | this->CustomCoverageExcludeRegex.emplace_back(rex); |
| 242 | } |
| 243 | |
| 244 | if (this->HandleBullseyeCoverage(&cont)) { |
| 245 | return cont.Error; |
| 246 | } |
| 247 | int file_count = 0; |
nothing calls this directly
no test coverage detected