[Lldb-commits] [PATCH] D134573: [lldb][test] 3 - Add gmodules XFAIL test for lang/cpp/gmodules/templates

Michael Buch via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Sep 23 16:42:55 PDT 2022


Michael137 updated this revision to Diff 462618.
Michael137 added a comment.

- Fix breakpoint and move docstring


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D134573/new/

https://reviews.llvm.org/D134573

Files:
  lldb/test/API/lang/cpp/gmodules/templates/Makefile
  lldb/test/API/lang/cpp/gmodules/templates/TestGModules.py
  lldb/test/API/lang/cpp/gmodules/templates/main.cpp


Index: lldb/test/API/lang/cpp/gmodules/templates/main.cpp
===================================================================
--- lldb/test/API/lang/cpp/gmodules/templates/main.cpp
+++ lldb/test/API/lang/cpp/gmodules/templates/main.cpp
@@ -1,9 +1,9 @@
 #include "b.h"
+#include <cstdio>
 
 int main(int argc, const char * argv[])
 {
     Module m;
-    // Test that the type Module which contains a field that is a
-    // template instantiation can be fully resolved.
-    return 0; //% self.assertTrue(self.frame().FindVariable('m').GetChildAtIndex(0).GetChildAtIndex(0).GetChildAtIndex(0).GetName() == 'buffer', 'find template specializations in imported modules')
+    std::puts("Break here");
+    return 0;
 }
Index: lldb/test/API/lang/cpp/gmodules/templates/TestGModules.py
===================================================================
--- lldb/test/API/lang/cpp/gmodules/templates/TestGModules.py
+++ lldb/test/API/lang/cpp/gmodules/templates/TestGModules.py
@@ -1,6 +1,22 @@
-import lldbsuite.test.lldbinline as lldbinline
+"""
+Test that the type Module which contains a field that is a
+template instantiation can be fully resolved.
+"""
+
+import lldb
 from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+class TestGModules(TestBase):
+
+    @add_test_categories(["gmodules"])
+    @expectedFailureAll
+    def test_gmodules(self):
+        self.build()
+        lldbutil.run_to_source_breakpoint(self, "Break here", lldb.SBFileSpec("main.cpp"))
+
+        name = lldbutil.frame().FindVariable('m') \
+                .GetChildAtIndex(0).GetChildAtIndex(0).GetChildAtIndex(0).GetName()
 
-lldbinline.MakeInlineTest(__file__, globals(), [
-    expectedFailureAll(oslist=["linux"], bugnumber="llvm.org/pr36107",
-        debug_info="gmodules")])
+        self.assertEqual(name, 'buffer', 'find template specializations in imported modules')
Index: lldb/test/API/lang/cpp/gmodules/templates/Makefile
===================================================================
--- /dev/null
+++ lldb/test/API/lang/cpp/gmodules/templates/Makefile
@@ -0,0 +1,4 @@
+PCH_CXX_SOURCES = a.h b.h
+CXX_SOURCES    := main.cpp
+
+include Makefile.rules


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D134573.462618.patch
Type: text/x-patch
Size: 2216 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220923/2289a02a/attachment.bin>


More information about the lldb-commits mailing list