| 175 | } |
| 176 | |
| 177 | static bool testCreateFromTarget() |
| 178 | { |
| 179 | auto variablesManager = |
| 180 | std::make_shared<cmDebugger::cmDebuggerVariablesManager>(); |
| 181 | |
| 182 | auto dummies = CreateDummies("Foo"); |
| 183 | |
| 184 | auto vars = cmDebugger::cmDebuggerVariablesHelper::CreateIfAny( |
| 185 | variablesManager, "Locals", true, dummies.Makefile->GetOrderedTargets()); |
| 186 | |
| 187 | dap::array<dap::Variable> variables = |
| 188 | variablesManager->HandleVariablesRequest( |
| 189 | CreateVariablesRequest(vars->GetId())); |
| 190 | |
| 191 | ASSERT_TRUE(variables.size() == 1); |
| 192 | ASSERT_VARIABLE(variables[0], "Foo", "EXECUTABLE", "collection"); |
| 193 | |
| 194 | variables = variablesManager->HandleVariablesRequest( |
| 195 | CreateVariablesRequest(variables[0].variablesReference)); |
| 196 | |
| 197 | ASSERT_TRUE(variables.size() == 15); |
| 198 | ASSERT_VARIABLE(variables[0], "GlobalGenerator", "Generic", "collection"); |
| 199 | ASSERT_VARIABLE(variables[1], "IsAIX", "FALSE", "bool"); |
| 200 | ASSERT_VARIABLE(variables[2], "IsAndroidGuiExecutable", "FALSE", "bool"); |
| 201 | ASSERT_VARIABLE(variables[3], "IsAppBundleOnApple", "FALSE", "bool"); |
| 202 | ASSERT_VARIABLE(variables[4], "IsDLLPlatform", "FALSE", "bool"); |
| 203 | ASSERT_VARIABLE(variables[5], "IsExecutableWithExports", "FALSE", "bool"); |
| 204 | ASSERT_VARIABLE(variables[6], "IsFrameworkOnApple", "FALSE", "bool"); |
| 205 | ASSERT_VARIABLE(variables[7], "IsImported", "FALSE", "bool"); |
| 206 | ASSERT_VARIABLE(variables[8], "IsImportedGloballyVisible", "FALSE", "bool"); |
| 207 | ASSERT_VARIABLE(variables[9], "IsPerConfig", "TRUE", "bool"); |
| 208 | ASSERT_VARIABLE(variables[10], "Makefile", |
| 209 | dummies.Makefile->GetDirectoryId().String, "collection"); |
| 210 | ASSERT_VARIABLE(variables[11], "Name", "Foo", "string"); |
| 211 | ASSERT_VARIABLE(variables[12], "PolicyMap", "", "collection"); |
| 212 | ASSERT_VARIABLE(variables[13], "Properties", |
| 213 | std::to_string(dummies.Makefile->GetOrderedTargets()[0] |
| 214 | ->GetProperties() |
| 215 | .GetList() |
| 216 | .size()), |
| 217 | "collection"); |
| 218 | ASSERT_VARIABLE(variables[14], "Type", "EXECUTABLE", "string"); |
| 219 | |
| 220 | auto none = cmDebugger::cmDebuggerVariablesHelper::CreateIfAny( |
| 221 | variablesManager, "Locals", true, std::vector<cmTarget*>()); |
| 222 | |
| 223 | ASSERT_TRUE(none == nullptr); |
| 224 | |
| 225 | return true; |
| 226 | } |
| 227 | |
| 228 | static bool testCreateFromGlobalGenerator() |
| 229 | { |
nothing calls this directly
no test coverage detected
searching dependent graphs…