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


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
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
  • [Lldb-commits] [PATCH] D1345... Michael Buch via Phabricator via lldb-commits

Reply via email to