JDevlieghere created this revision. JDevlieghere added reviewers: wallace, clayborg. Herald added a project: All. JDevlieghere requested review of this revision.
The test was expecting `vector<basic_string<char>> &` while the test returned `vector<string> &`. Since `verify_completions` doesn't support regex matching, sidestep the issue by using a custom type (`baz`). https://reviews.llvm.org/D158893 Files: lldb/test/API/tools/lldb-vscode/completions/TestVSCode_completions.py lldb/test/API/tools/lldb-vscode/completions/main.cpp Index: lldb/test/API/tools/lldb-vscode/completions/main.cpp =================================================================== --- lldb/test/API/tools/lldb-vscode/completions/main.cpp +++ lldb/test/API/tools/lldb-vscode/completions/main.cpp @@ -12,7 +12,11 @@ foo* next_foo; }; -int fun(std::vector<std::string> var) { +struct baz { + char c; +}; + +int fun(std::vector<baz> var) { return var.size(); // breakpoint 1 } @@ -21,10 +25,10 @@ int var2 = 1; std::string str1 = "a"; std::string str2 = "b"; - std::vector<std::string> vec; + std::vector<baz> vec; fun(vec); bar bar1 = {2}; - bar* bar2 = &bar1; + bar* bar2 = &bar1; foo foo1 = {3,&bar1, bar1, NULL}; return 0; // breakpoint 2 } Index: lldb/test/API/tools/lldb-vscode/completions/TestVSCode_completions.py =================================================================== --- lldb/test/API/tools/lldb-vscode/completions/TestVSCode_completions.py +++ lldb/test/API/tools/lldb-vscode/completions/TestVSCode_completions.py @@ -19,19 +19,18 @@ self.assertNotIn(not_expected_item, actual_list) @skipIfWindows - @skipIfDarwin # Skip this test for now until we can figure out why tings aren't working on build bots def test_completions(self): """ Tests the completion request at different breakpoints """ program = self.getBuildArtifact("a.out") self.build_and_launch(program) + source = "main.cpp" breakpoint1_line = line_number(source, "// breakpoint 1") breakpoint2_line = line_number(source, "// breakpoint 2") - breakpoint_ids = self.set_source_breakpoints( - source, [breakpoint1_line, breakpoint2_line] - ) + + self.set_source_breakpoints(source, [breakpoint1_line, breakpoint2_line]) self.continue_to_next_stop() # shouldn't see variables inside main @@ -40,7 +39,7 @@ [ { "text": "var", - "label": "var -- vector<basic_string<char>> &", + "label": "var -- vector<baz> &", } ], [ @@ -71,7 +70,7 @@ [ { "text": "var", - "label": "var -- vector<basic_string<char>> &", + "label": "var -- vector<baz> &", } ], )
Index: lldb/test/API/tools/lldb-vscode/completions/main.cpp =================================================================== --- lldb/test/API/tools/lldb-vscode/completions/main.cpp +++ lldb/test/API/tools/lldb-vscode/completions/main.cpp @@ -12,7 +12,11 @@ foo* next_foo; }; -int fun(std::vector<std::string> var) { +struct baz { + char c; +}; + +int fun(std::vector<baz> var) { return var.size(); // breakpoint 1 } @@ -21,10 +25,10 @@ int var2 = 1; std::string str1 = "a"; std::string str2 = "b"; - std::vector<std::string> vec; + std::vector<baz> vec; fun(vec); bar bar1 = {2}; - bar* bar2 = &bar1; + bar* bar2 = &bar1; foo foo1 = {3,&bar1, bar1, NULL}; return 0; // breakpoint 2 } Index: lldb/test/API/tools/lldb-vscode/completions/TestVSCode_completions.py =================================================================== --- lldb/test/API/tools/lldb-vscode/completions/TestVSCode_completions.py +++ lldb/test/API/tools/lldb-vscode/completions/TestVSCode_completions.py @@ -19,19 +19,18 @@ self.assertNotIn(not_expected_item, actual_list) @skipIfWindows - @skipIfDarwin # Skip this test for now until we can figure out why tings aren't working on build bots def test_completions(self): """ Tests the completion request at different breakpoints """ program = self.getBuildArtifact("a.out") self.build_and_launch(program) + source = "main.cpp" breakpoint1_line = line_number(source, "// breakpoint 1") breakpoint2_line = line_number(source, "// breakpoint 2") - breakpoint_ids = self.set_source_breakpoints( - source, [breakpoint1_line, breakpoint2_line] - ) + + self.set_source_breakpoints(source, [breakpoint1_line, breakpoint2_line]) self.continue_to_next_stop() # shouldn't see variables inside main @@ -40,7 +39,7 @@ [ { "text": "var", - "label": "var -- vector<basic_string<char>> &", + "label": "var -- vector<baz> &", } ], [ @@ -71,7 +70,7 @@ [ { "text": "var", - "label": "var -- vector<basic_string<char>> &", + "label": "var -- vector<baz> &", } ], )
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits