MCPcopy Index your code
hub / github.com/Kitware/CMake / cmAddTestCommandHandleNameMode

Function cmAddTestCommandHandleNameMode

Source/cmAddTestCommand.cxx:84–191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82}
83
84bool cmAddTestCommandHandleNameMode(std::vector<std::string> const& args,
85 cmExecutionStatus& status)
86{
87 cmMakefile& mf = status.GetMakefile();
88
89 std::string name;
90 std::vector<std::string> configurations;
91 std::string working_directory;
92 std::vector<std::string> command;
93 bool command_expand_lists = false;
94 cmPolicies::PolicyStatus cmp0178 = mf.GetPolicyStatus(cmPolicies::CMP0178);
95
96 // Read the arguments.
97 enum Doing
98 {
99 DoingName,
100 DoingCommand,
101 DoingConfigs,
102 DoingWorkingDirectory,
103 DoingCmp0178,
104 DoingNone
105 };
106 Doing doing = DoingName;
107 for (unsigned int i = 1; i < args.size(); ++i) {
108 if (args[i] == "COMMAND") {
109 if (!command.empty()) {
110 status.SetError(" may be given at most one COMMAND.");
111 return false;
112 }
113 doing = DoingCommand;
114 } else if (args[i] == "CONFIGURATIONS") {
115 if (!configurations.empty()) {
116 status.SetError(" may be given at most one set of CONFIGURATIONS.");
117 return false;
118 }
119 doing = DoingConfigs;
120 } else if (args[i] == "WORKING_DIRECTORY") {
121 if (!working_directory.empty()) {
122 status.SetError(" may be given at most one WORKING_DIRECTORY.");
123 return false;
124 }
125 doing = DoingWorkingDirectory;
126 } else if (args[i] == keywordCMP0178) {
127 doing = DoingCmp0178;
128 } else if (args[i] == "COMMAND_EXPAND_LISTS") {
129 if (command_expand_lists) {
130 status.SetError(" may be given at most one COMMAND_EXPAND_LISTS.");
131 return false;
132 }
133 command_expand_lists = true;
134 doing = DoingNone;
135 } else if (doing == DoingName) {
136 name = args[i];
137 doing = DoingNone;
138 } else if (doing == DoingCommand) {
139 command.push_back(args[i]);
140 } else if (doing == DoingConfigs) {
141 configurations.push_back(args[i]);

Callers 1

cmAddTestCommandFunction · 0.85

Calls 15

push_backMethod · 0.80
CreateTestMethod · 0.80
SetOldStyleMethod · 0.80
SetCMP0178Method · 0.80
AddTestGeneratorMethod · 0.80
cmStrCatFunction · 0.70
GetMakefileMethod · 0.45
GetPolicyStatusMethod · 0.45
sizeMethod · 0.45
emptyMethod · 0.45
SetErrorMethod · 0.45
GetTestMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…