| 346 | } |
| 347 | |
| 348 | int cmCTestTestHandler::ProcessHandler() |
| 349 | { |
| 350 | if (!this->ProcessOptions()) { |
| 351 | return -1; |
| 352 | } |
| 353 | |
| 354 | this->TestResults.clear(); |
| 355 | |
| 356 | cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, |
| 357 | (this->MemCheck ? "Memory check" : "Test") |
| 358 | << " project " |
| 359 | << cmSystemTools::GetLogicalWorkingDirectory() |
| 360 | << std::endl, |
| 361 | this->Quiet); |
| 362 | if (!this->PreProcessHandler()) { |
| 363 | return -1; |
| 364 | } |
| 365 | |
| 366 | cmGeneratedFileStream mLogFile; |
| 367 | this->StartLogFile((this->MemCheck ? "DynamicAnalysis" : "Test"), mLogFile); |
| 368 | this->LogFile = &mLogFile; |
| 369 | |
| 370 | std::vector<std::string> passed; |
| 371 | std::vector<std::string> failed; |
| 372 | |
| 373 | // start the real time clock |
| 374 | auto clock_start = std::chrono::steady_clock::now(); |
| 375 | |
| 376 | if (!this->ProcessDirectory(passed, failed)) { |
| 377 | return -1; |
| 378 | } |
| 379 | |
| 380 | auto clock_finish = std::chrono::steady_clock::now(); |
| 381 | |
| 382 | bool noTestsFoundError = false; |
| 383 | if (passed.size() + failed.size() == 0) { |
| 384 | if (!this->CTest->GetShowOnly() && !this->CTest->ShouldPrintLabels() && |
| 385 | this->CTest->GetNoTestsMode() != cmCTest::NoTests::Ignore) { |
| 386 | cmCTestLog(this->CTest, ERROR_MESSAGE, |
| 387 | "No tests were found!!!" << std::endl); |
| 388 | if (this->CTest->GetNoTestsMode() == cmCTest::NoTests::Error) { |
| 389 | noTestsFoundError = true; |
| 390 | } |
| 391 | } |
| 392 | } else { |
| 393 | if (this->HandlerVerbose && !passed.empty() && |
| 394 | (this->UseIncludeRegExpFlag || this->UseExcludeRegExpFlag)) { |
| 395 | cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, |
| 396 | std::endl |
| 397 | << "The following tests passed:" << std::endl, |
| 398 | this->Quiet); |
| 399 | for (std::string const& j : passed) { |
| 400 | cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, |
| 401 | "\t" << j << std::endl, this->Quiet); |
| 402 | } |
| 403 | } |
| 404 | |
| 405 | SetOfTests resultsSet(this->TestResults.begin(), this->TestResults.end()); |
no test coverage detected