[Lldb-commits] [PATCH] D123401: [lldb] Fix debug_info decorators for NO_DEBUG_INFO_TESTCASE

Jonas Devlieghere via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Apr 8 09:22:32 PDT 2022


JDevlieghere created this revision.
JDevlieghere added reviewers: labath, mib.
Herald added a project: All.
JDevlieghere requested review of this revision.

Currently a NO_DEBUG_INFO_TESTCASE will return None as it's debug info
type, causing the decorator to consider it a match. If such a test case
is marked as an expected failure, the decorator will incorrectly cause
an XPASS.

I discovered this issue when I was trying to speed up our remote test
suite by running every test as a single variant.


https://reviews.llvm.org/D123401

Files:
  lldb/packages/Python/lldbsuite/test/decorators.py
  lldb/test/API/test_utils/TestDecorators.py


Index: lldb/test/API/test_utils/TestDecorators.py
===================================================================
--- /dev/null
+++ lldb/test/API/test_utils/TestDecorators.py
@@ -0,0 +1,13 @@
+from lldbsuite.test.lldbtest import Base
+from lldbsuite.test.decorators import *
+
+
+class TestDecorators(Base):
+
+    mydir = Base.compute_mydir(__file__)
+    NO_DEBUG_INFO_TESTCASE = True
+
+    @expectedFailureAll(debug_info="dwarf")
+    def test_decorator_skip_no_debug_info(self):
+        """Test that specifying a debug info category works for a NO_DEBUG_INFO_TESTCASE"""
+        pass
Index: lldb/packages/Python/lldbsuite/test/decorators.py
===================================================================
--- lldb/packages/Python/lldbsuite/test/decorators.py
+++ lldb/packages/Python/lldbsuite/test/decorators.py
@@ -183,7 +183,7 @@
         skip_for_arch = _match_decorator_property(
             archs, self.getArchitecture())
         skip_for_debug_info = _match_decorator_property(
-            debug_info, self.getDebugInfo())
+            debug_info, self.getDebugInfo() if self.getDebugInfo() else "")
         skip_for_triple = _match_decorator_property(
             triple, lldb.selected_platform.GetTriple())
         skip_for_remote = _match_decorator_property(


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D123401.421548.patch
Type: text/x-patch
Size: 1290 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220408/f7735503/attachment.bin>


More information about the lldb-commits mailing list