| 363 | } |
| 364 | |
| 365 | static bool testCreateFromMakefile() |
| 366 | { |
| 367 | auto variablesManager = |
| 368 | std::make_shared<cmDebugger::cmDebuggerVariablesManager>(); |
| 369 | |
| 370 | auto dummies = CreateDummies("Foo"); |
| 371 | auto snapshot = dummies.Makefile->GetStateSnapshot(); |
| 372 | auto state = dummies.Makefile->GetState(); |
| 373 | state->SetSourceDirectory("c:/HomeDirectory"); |
| 374 | state->SetBinaryDirectory("c:/HomeOutputDirectory"); |
| 375 | auto vars = cmDebugger::cmDebuggerVariablesHelper::CreateIfAny( |
| 376 | variablesManager, "Locals", true, dummies.Makefile.get()); |
| 377 | |
| 378 | dap::array<dap::Variable> variables = |
| 379 | variablesManager->HandleVariablesRequest( |
| 380 | CreateVariablesRequest(vars->GetId())); |
| 381 | |
| 382 | ASSERT_TRUE(variables.size() == 12); |
| 383 | ASSERT_VARIABLE(variables[0], "AppleSDKType", "MacOS", "string"); |
| 384 | ASSERT_VARIABLE(variables[1], "CurrentBinaryDirectory", |
| 385 | snapshot.GetDirectory().GetCurrentBinary(), "string"); |
| 386 | ASSERT_VARIABLE(variables[2], "CurrentSourceDirectory", |
| 387 | snapshot.GetDirectory().GetCurrentSource(), "string"); |
| 388 | ASSERT_VARIABLE(variables[3], "DefineFlags", " ", "string"); |
| 389 | ASSERT_VARIABLE(variables[4], "DirectoryId", |
| 390 | dummies.Makefile->GetDirectoryId().String, "string"); |
| 391 | ASSERT_VARIABLE(variables[5], "HomeDirectory", state->GetSourceDirectory(), |
| 392 | "string"); |
| 393 | ASSERT_VARIABLE(variables[6], "HomeOutputDirectory", |
| 394 | state->GetBinaryDirectory(), "string"); |
| 395 | ASSERT_VARIABLE(variables[7], "IsRootMakefile", "TRUE", "bool"); |
| 396 | ASSERT_VARIABLE(variables[8], "PlatformIs32Bit", "FALSE", "bool"); |
| 397 | ASSERT_VARIABLE(variables[9], "PlatformIs64Bit", "FALSE", "bool"); |
| 398 | ASSERT_VARIABLE(variables[10], "PlatformIsAppleEmbedded", "FALSE", "bool"); |
| 399 | ASSERT_VARIABLE(variables[11], "PlatformIsx32", "FALSE", "bool"); |
| 400 | |
| 401 | auto none = cmDebugger::cmDebuggerVariablesHelper::CreateIfAny( |
| 402 | variablesManager, "Locals", true, static_cast<cmMakefile*>(nullptr)); |
| 403 | |
| 404 | ASSERT_TRUE(none == nullptr); |
| 405 | |
| 406 | return true; |
| 407 | } |
| 408 | |
| 409 | static bool testCreateFromStackFrame() |
| 410 | { |
nothing calls this directly
no test coverage detected
searching dependent graphs…