[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:32:23 PDT 2022


Michael137 created this revision.
Michael137 added a reviewer: aprantl.
Herald added a project: All.
Michael137 requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

Since we don't implicitly compile tests with `gmodules` now,
add a `gmodules` test category to this test explicitly.


Repository:
  rG LLVM Github Monorepo

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
@@ -5,5 +5,5 @@
     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')
+    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,17 @@
-import lldbsuite.test.lldbinline as lldbinline
+import lldb
 from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
 
-lldbinline.MakeInlineTest(__file__, globals(), [
-    expectedFailureAll(oslist=["linux"], bugnumber="llvm.org/pr36107",
-        debug_info="gmodules")])
+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()
+
+        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.462614.patch
Type: text/x-patch
Size: 1986 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220923/26590308/attachment.bin>


More information about the lldb-commits mailing list