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

Method InitialPass

Source/CTest/cmCTestRunScriptCommand.cxx:12–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10#include "cmSystemTools.h"
11
12bool cmCTestRunScriptCommand::InitialPass(std::vector<std::string> const& args,
13 cmExecutionStatus& status) const
14{
15 if (args.empty()) {
16 status.SetError("called with incorrect number of arguments");
17 return false;
18 }
19
20 cmMakefile& mf = status.GetMakefile();
21 bool np = false;
22 unsigned int i = 0;
23 if (args[i] == "NEW_PROCESS") {
24 np = true;
25 i++;
26 }
27 int start = i;
28 // run each script
29 std::string returnVariable;
30 for (i = start; i < args.size(); ++i) {
31 if (args[i] == "RETURN_VALUE") {
32 ++i;
33 if (i < args.size()) {
34 returnVariable = args[i];
35 }
36 }
37 }
38 for (i = start; i < args.size(); ++i) {
39 if (args[i] == "RETURN_VALUE") {
40 ++i;
41 } else {
42 int ret;
43 cmCTestScriptHandler::RunScript(
44 this->CTest, &mf, cmSystemTools::CollapseFullPath(args[i]), !np, &ret);
45 mf.AddDefinition(returnVariable, std::to_string(ret));
46 }
47 }
48 return true;
49}

Callers

nothing calls this directly

Calls 6

to_stringFunction · 0.85
emptyMethod · 0.45
SetErrorMethod · 0.45
GetMakefileMethod · 0.45
sizeMethod · 0.45
AddDefinitionMethod · 0.45

Tested by

no test coverage detected