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

Method PrintOutputAsJson

Source/CTest/cmCTestMultiProcessHandler.cxx:1399–1433  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1397}
1398
1399void cmCTestMultiProcessHandler::PrintOutputAsJson()
1400{
1401 this->TestHandler->SetMaxIndex(this->FindMaxIndex());
1402
1403 Json::Value result = Json::objectValue;
1404 result["kind"] = "ctestInfo";
1405 result["version"] = DumpVersion(1, 0);
1406
1407 BacktraceData backtraceGraph;
1408 Json::Value tests = Json::arrayValue;
1409 for (auto& it : this->Properties) {
1410 cmCTestTestHandler::cmCTestTestProperties& p = *it.second;
1411
1412 // Don't worry if this fails, we are only showing the test list, not
1413 // running the tests
1414 cmWorkingDirectory workdir(p.Directory);
1415 cmCTestRunTest testRun(*this, p.Index);
1416 testRun.ComputeArguments();
1417
1418 // Skip tests not available in this configuration.
1419 if (p.Args.size() >= 2 && p.Args[1] == "NOT_AVAILABLE") {
1420 continue;
1421 }
1422
1423 Json::Value testInfo = DumpCTestInfo(testRun, p, backtraceGraph);
1424 tests.append(testInfo);
1425 }
1426 result["backtraceGraph"] = backtraceGraph.Dump();
1427 result["tests"] = std::move(tests);
1428
1429 Json::StreamWriterBuilder builder;
1430 builder["indentation"] = " ";
1431 std::unique_ptr<Json::StreamWriter> jout(builder.newStreamWriter());
1432 jout->write(result, &std::cout);
1433}
1434
1435// For ShowOnly mode
1436void cmCTestMultiProcessHandler::PrintTestList()

Callers 1

PrintTestListMethod · 0.95

Calls 11

FindMaxIndexMethod · 0.95
DumpVersionFunction · 0.85
DumpCTestInfoFunction · 0.85
moveFunction · 0.85
SetMaxIndexMethod · 0.80
ComputeArgumentsMethod · 0.80
appendMethod · 0.80
newStreamWriterMethod · 0.80
sizeMethod · 0.45
DumpMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected