[Lldb-commits] [PATCH] D158893: [lldb] Fix TestVSCode_completions on Darwin
Jonas Devlieghere via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Fri Aug 25 14:15:10 PDT 2023
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> &",
}
],
)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D158893.553619.patch
Type: text/x-patch
Size: 2424 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20230825/585f54e7/attachment.bin>
More information about the lldb-commits
mailing list