Author: Jonas Devlieghere
Date: 2023-08-25T14:35:07-07:00
New Revision: a7ca1175d0d4f3ec8ed04cf2e2d380d007681f6e

URL: 
https://github.com/llvm/llvm-project/commit/a7ca1175d0d4f3ec8ed04cf2e2d380d007681f6e
DIFF: 
https://github.com/llvm/llvm-project/commit/a7ca1175d0d4f3ec8ed04cf2e2d380d007681f6e.diff

LOG: [lldb] Fix & re-enable TestVSCode_completions on Darwin

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).

Differential revision: https://reviews.llvm.org/D158893

Added: 
    

Modified: 
    lldb/test/API/tools/lldb-vscode/completions/TestVSCode_completions.py
    lldb/test/API/tools/lldb-vscode/completions/main.cpp

Removed: 
    


################################################################################
diff  --git 
a/lldb/test/API/tools/lldb-vscode/completions/TestVSCode_completions.py 
b/lldb/test/API/tools/lldb-vscode/completions/TestVSCode_completions.py
index ab5a70c3227417..1cec2aad3b7e1f 100644
--- a/lldb/test/API/tools/lldb-vscode/completions/TestVSCode_completions.py
+++ b/lldb/test/API/tools/lldb-vscode/completions/TestVSCode_completions.py
@@ -19,19 +19,18 @@ def verify_completions(self, actual_list, expected_list, 
not_expected_list=[]):
             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 
diff erent 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 @@ def test_completions(self):
             [
                 {
                     "text": "var",
-                    "label": "var -- vector<basic_string<char>> &",
+                    "label": "var -- vector<baz> &",
                 }
             ],
             [
@@ -71,7 +70,7 @@ def test_completions(self):
             [
                 {
                     "text": "var",
-                    "label": "var -- vector<basic_string<char>> &",
+                    "label": "var -- vector<baz> &",
                 }
             ],
         )

diff  --git a/lldb/test/API/tools/lldb-vscode/completions/main.cpp 
b/lldb/test/API/tools/lldb-vscode/completions/main.cpp
index f77dba592f5527..dccf43ff6feb81 100644
--- a/lldb/test/API/tools/lldb-vscode/completions/main.cpp
+++ b/lldb/test/API/tools/lldb-vscode/completions/main.cpp
@@ -12,7 +12,11 @@ struct foo {
   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 main(int argc, char const *argv[]) {
   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
 }


        
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to