MCPcopy Create free account
hub / github.com/Kitware/CMake / ProcessHandler

Method ProcessHandler

Source/CTest/cmCTestTestHandler.cxx:348–448  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

346}
347
348int 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());

Callers 3

RunScriptsMethod · 0.45
ExecuteTestsMethod · 0.45
ExecuteHandlerCommandMethod · 0.45

Calls 15

ProcessOptionsMethod · 0.95
PreProcessHandlerMethod · 0.95
ProcessDirectoryMethod · 0.95
LogTestSummaryMethod · 0.95
LogDisabledTestsMethod · 0.95
LogFailedTestsMethod · 0.95
GenerateXMLMethod · 0.95
WriteJUnitXMLMethod · 0.95
PostProcessHandlerMethod · 0.95
cmHasLiteralPrefixFunction · 0.85
GetShowOnlyMethod · 0.80
ShouldPrintLabelsMethod · 0.80

Tested by

no test coverage detected