This is an archive of the discontinued LLVM Phabricator instance.

[don't review]Creating environment variable test for lldbd
AbandonedPublic

Authored by diazhector98 on Feb 13 2020, 1:37 PM.

Details

Reviewers
wallace

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptFeb 13 2020, 1:37 PM
diazhector98 retitled this revision from Creating environment variable test for lldb d to Creating environment variable test for lldbd.Feb 13 2020, 1:38 PM
diazhector98 added a reviewer: wallace.

Creating env tes

diazhector98 retitled this revision from Creating environment variable test for lldbd to [don't review]Creating environment variable test for lldbd.Feb 13 2020, 1:47 PM
wallace requested changes to this revision.Feb 13 2020, 5:04 PM
wallace added inline comments.
lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/completions/TestVSCode_completions.py
26

don't forget to remove the #

lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/environmentVariables/TestVSCode_environmentVariables.py
20–25

remove this

39–44

you can write different tests:

  • inheritEnvironment = false -> no PATH
  • inheritEnvironment = true
    • send an additional env in the config -> it should override the inherited
    • PATH should be correct
lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/vscode.py
906

inheritEnv should be passed here

lldb/tools/lldb-vscode/lldb-vscode.cpp
1400–1415

the env sent by the user in the launch.json config should have more priority than the inherited environment. For example, if env = ["X=A"] and the inherited env is ["X=Z", "Y=V"], then the resulting environment should be ["X=A", "Y=V"].
You should also write a test for that

1405

remove this

2250–2251

lol

lldb/tools/lldb-vscode/package.json
89 ↗(On Diff #244547)

Inherit the debugger environment when launching a process. Only works for binaries launched directly by LLDB.

This revision now requires changes to proceed.Feb 13 2020, 5:04 PM

Working on comments

wallace added inline comments.Feb 14 2020, 10:32 AM
lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/environmentVariables/TestVSCode_environmentVariables.py
32–36

this becomes more readable if you make it a function. That way you avoid having the mutable found variable and you can stop the for loop as soon as you return

lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/environmentVariables/main.cpp
11

remove this comment

lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py
315

try not to delete existing blank lines

lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/vscode.py
906

I think you need a comma here

907–908

put the ) in line 906

lldb/tools/lldb-vscode/lldb-vscode.cpp
1411–1413

in llvm, you don't need to use { } for one line ifs

diazhector98 abandoned this revision.Feb 14 2020, 11:56 AM